As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [phantom]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
1 answer
59 views

Align two rows only using \phantom command

I want to achieve the following picture: What I have tried so far: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{matrix} \phantom{(n+{}}2^3-1^3\phantom{{}-1)^3}&=&3\...
manooooh's user avatar
  • 3,143
3 votes
1 answer
56 views

Hiding the dividing line in a fraction [duplicate]

I would like to be able to hide the dividing line in the fraction that arises from applying a command such as \dfrac. In particular, what I would like to do is take an expression such as the following:...
OGBond's user avatar
  • 75
2 votes
1 answer
67 views

Hiding verbatim material on beamer slide while saving the space

The bigger picture is the following: I want to have a minted environment hidden in the presentation but save the space and have it available in my notes. So I created a command: \newcommand{\hidden}[1]...
Tia Chung's user avatar
2 votes
4 answers
280 views

How to modify the cell dimensions in tikzcd?

Code: \[ \begin{tikzcd}[cells={nodes={draw=gray}}] \text{Math is excellent!} \ar[r, rightarrow] \ar[d, leftarrow] & \text{w} \ar[d, rightarrow]\\ \text{w} \ar[u, rightarrow] \ar[r, ...
Atom's user avatar
  • 335
3 votes
1 answer
195 views

How to obtain overline to a blank character?

I tried the $\overline{\phantom}$, but it doesn't work. The output should look like this. [] This can also included between single quotes. 1:
Kiran K U's user avatar
  • 191
2 votes
3 answers
323 views

Align 2 lines horizontally starting from a dash symbol , with the first previous one without subscript and the second previous one with subscript

I try to align horizontally 2 lines after 2 words, the first one not containing a subscript in text (see below with "WL") and the second one with a subscript (see GC_{sp}). I used for this ...
user avatar
-1 votes
1 answer
43 views

I want to hide characters in a quick manner. \phantom hides but also takes a space

For example \begin{align*} \Omega \phantom{\Omega..}(A\phantom{\Omega..}) \end{align*} Prints: O (A ) I want it to print O(A) without resorting to \begin{align*} \Omega %\Omega.. (A %\Omega.. ) \...
TheGreatJRB's user avatar
1 vote
0 answers
59 views

Controlling the space between lines of an Array environment

I have an array enviroment in which the various lines are matrices. A simple example is \begin_inset Formula \begin{align*} A & =\left[\begin{array}{cc} a & b\\ c & d \end{array}\right]\\ ...
Thomas Philips's user avatar
0 votes
2 answers
188 views

Why does the "LaTeX error... perhaps a missing item" error pop up when I try to create a phantom (0-space) lemma?

I wanted to create a theorem which does not occupy any space yet adds to the theorem counter. Here is the MWE. \documentclass{article} \usepackage{amsthm} \theoremstyle{plain} \newtheorem{thm}{Theorem}...
Longlisted's user avatar
0 votes
0 answers
161 views

phantom command error

At wikipedia this <math>\phantom{-}\frac{8}{2}=\phantom{-}4</math> should produce $\phantom{-}\frac{8}{2}=\phantom{-}4$ (I dont know how to make that display correctly here either) but I ...
R. Emery's user avatar
  • 101
2 votes
0 answers
107 views

\phantom \begin{figure} does not work

Why doesn't this work? \phantom{ \begin{figure}[H] \includegraphics{fig.pdf} \end{figure} } It outputs Error: Something's wrong--perhaps a missing \item. I'm trying to do ...
Volker Weißmann's user avatar
2 votes
2 answers
136 views

Aligning a broken equation using phantom

I am trying to break an equation and align the characters under each other. Here is an example: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} f(a) &= f(b) + 3 + \\ &...
Tyler D's user avatar
  • 301
0 votes
1 answer
311 views

repeating decimals with siunitx

I am using siunitx with comma as output-decimal-marker. (localization) For the representation of numbers with repeating decimals I use overlaps. Is there an easy way to request the current value of ...
user avatar
7 votes
2 answers
199 views

\hphantom with \footnotesize, siunitx and unicode-math

Consider the following MWE. It is supposed to print the three equations with space added after the equal signs so that the right edge of the equations (the units) are horizontally aligned. % !TeX ...
schtandard's user avatar
  • 13.9k
0 votes
1 answer
94 views

List of invisible things

I need to create a list of invisible things. For instance, in the following MWE, there is a list of examples, but it should not appear in the text. MWE: \documentclass{article} \usepackage{tocloft} \...
Morzen's user avatar
  • 335
0 votes
0 answers
84 views

Set \phantom{-} for all columns of a matrix that has at least one negative entry

I would like to add \phantom{-} to every column of a matrix that contains at least one entry with a - in front. Here is an answer that my current code is based off. It inserts \phantom{-} in front of ...
Jason1923's user avatar
  • 149
1 vote
1 answer
71 views

How to align columns with multiple phantom characters?

I couldn't figure how to align a column containing { 1.00, -1.00, 10.00, 0.00 }. I aligned the first two using \phantom{-} and the last two using \phantom{1} but failed to align all 4 lines at once. ...
ssd's user avatar
  • 137
3 votes
2 answers
348 views

How to make a superscript of arbitrary width?

I'm trying to make the following two commands of the same width: \newcommand{\Bsh}{\ensuremath{B^{H}_{s}}\xspace} \newcommand{\Bsl}{\ensuremath{B^{L}_{s}}\xspace} in order to avoid these ugly ...
Alberto Bragagnolo's user avatar
1 vote
1 answer
106 views

Aligning wrapped lines and multiple equations inside align differently

In a guide I was proposed with the following problem, long equations inside an align environment are more involved to handle when the goal is to properly align the equality signs of multiple equations ...
hjkhuui1999's user avatar
1 vote
1 answer
135 views

Define an underline with white contour that allows breaklines and hyphenation

I define an underline (based on the following site: https://alexwlchan.net/2017/10/latex-underlines/). This was my initial code: \usepackage{ulem} \renewcommand{\ULdepth}{1.8pt} \contourlength{0.8pt} \...
hllspwn's user avatar
  • 47
0 votes
2 answers
120 views

Alignment in cases environment with \hphantom

I am using the \hphantom command to center the middle 0, but the middle 0 is still too far left. Here is a picture of my problem: Here is my MWE: \documentclass{article} \usepackage[utf8]{inputenc} \...
hobbicon's user avatar
0 votes
0 answers
65 views

How to locally deactivate \phantom

I need to use \phantom for an argument and to deactivate it just sometimes to show only the numbers of enumerates. I spend a lot of time and I tried many things but I can't achieve it. Here is a ...
Moïse's user avatar
  • 21
3 votes
3 answers
279 views

Multilines, multipages \phantom analog macro

I need a macro to be able, in pdflatex (EDIT : or lualatex if necessary), to remove some text/formulas/images which can go on many paragraphs and pages, without changing the layout (there must be an ...
alfazaz's user avatar
  • 33
7 votes
2 answers
942 views

How to make text appear in the middle of a phantom in math mode?

I want to make a part of an equation to appear in the center of a (horizontal) phantom. This would be awesome for example for making bra-kets that are all of the same width and still look natural. ...
m93a's user avatar
  • 271
1 vote
1 answer
251 views

Nested \left and \right) make \vphantom have non-zero width

I have many nested \left( and \right) parentheses in my document and I'm trying to find a flexible way to make outer pairs larger. Unfortunately, I cannot use \delimitershortfall recommended here. ...
Leo's user avatar
  • 389
4 votes
3 answers
173 views

How to make multiple variables take the same width in math mode?

I would like to use characters as variable names and adjust their width to all be the maximum width of a character. This way, brackets around them would align nicely as shown in the example below. ...
danijar's user avatar
  • 965
0 votes
0 answers
87 views

How to turn \phantom on/off for an entire document before compiling

I want to create a cloze with a lot of formulas and a lot of phantom blanks. But in the end, I need two versions, one with blanks and one without. Manually deleting all phantom is no solution. Is ...
Marco's user avatar
  • 159
0 votes
1 answer
172 views

baseline alignment in subscripts that have superscripts

How can I vertically align these subscripts? the problem is that the second one has a hat and the first one not. I tried \phantom and other commands, but I'm unable to get the desired results. EDIT:...
paketecuento's user avatar
5 votes
1 answer
513 views

Using phantom inside itemize

I'd like to use \phantom{} for spacing inside an itemize environment. It however breaks a line. What should I do? The best solution I found was to replace \phantom{} by \hspace{} which is quite ...
Tex Exchanger's user avatar
2 votes
3 answers
670 views

How to set \phantom{-} automatically for entries of matrices?

I want a way to set matrix entries aligned by their sign automatically. For example, output of \begin{bmatrix} 1&1&-1\\ -1&1& 1\\ 1&-1& 1 \end{bmatrix} be same ...
user avatar
1 vote
1 answer
53 views

Align numbers at "," [duplicate]

I have a table contains tens, hundreds, or thousands numbers with or without decimal. I need those numbers to be aligned at ",", the decimal symbol (Indonesian). I try to use \newcommand\ph{$\phantom{...
Enos Lolang's user avatar
3 votes
1 answer
309 views

Underline needed using Phantom for cells in Tables

Underline need to set selected Cell using phantom text(not cell width) so that I do not want to change Column alignment? Is any way to achieve this? Kindly ignore my \al definitions. Please find MWE ...
Rajesh N's user avatar
  • 839
2 votes
1 answer
167 views

Vertical spacing for dynkin-diagram labels

I'm trying to achieve the same vertical alignment for labels with different heights inside dynkin diagrams provided by the dynkin-diagrams package. \dynkin[Coxeter, labels={a,b,c,d}]{F}{4} gives My ...
Sirion's user avatar
  • 235
5 votes
2 answers
410 views

Align equalities using stackrel

I have a code block looking like this \begin{align*} ||Ty - Tz||_w &\stackrel{\text{Satz 4.3}}{=} \sup_{t \in I}e^{-2L(t-t_0)}||(Ty)(t) - (Tz)(t)||_\infty \\ &\stackrel{\phantom{Satz ...
user7802048's user avatar
5 votes
2 answers
110 views

How to align these two expressions, one has one more number?

I am trying to align (-(a-1)^2-1)x+(-(a-1)^2-1) and (-(a-1)^2-1)x+1 using \phantom command. Since (-(a-1)^2-1)x+1 is missing the (-(a-1)^2-1) part, I added \phantom{(-(a-1)^2-1)}, but there is an ...
manooooh's user avatar
  • 3,143
0 votes
2 answers
1k views

Hide text without keeping space

I want to hide some text but : I don't want the hidden text to take space I still want that LaTeX parse the content (to keep numbering) I have found this solution : \vphantom{\hphantom{text}} This ...
Matheod's user avatar
  • 440
0 votes
0 answers
125 views

Incomplete \iffalse; all text was ignored in tabstackengine

My MWE \documentclass[10pt]{article} \usepackage{tabstackengine,xcolor} \usepackage{amssymb} \makeatletter \newcommand*{\pmzerodot}{% \nfss@text{% \sbox0{$\vcenter{}$}% math axis \sbox2{0}% \sbox4{...
Özgür's user avatar
  • 3,242
8 votes
1 answer
582 views

tikzmarknode and vphantom take up horizontal space

A tikzmarknode combined with a vphantom character takes up horizontal space. Minimal but nonetheless noticeable. \documentclass{article} \usepackage{tikz} \usetikzlibrary{tikzmark} \begin{document}...
jan's user avatar
  • 2,216
5 votes
1 answer
427 views

Incomplete \iffalse in \caption, but correct in regular text. Where's the \if?

I'm trying to create a new character as a superposition of $\bot$ and =, as follows: For some reason it is not working in \caption environments, as opposed to regular environments. What is wrong; ...
plbt's user avatar
  • 53
1 vote
1 answer
410 views

Vertical alignment of inf subscripts without vphantom

I was wondering whether it would be possible to align the index of multiple infimums (or supremums, or limits..) without recurring to the \vphantom command - I feel somehow it's kind of "cheating". ...
G. Gare's user avatar
  • 673
4 votes
3 answers
599 views

Alignment of terms within align environment

The solutions below require up-to-date versions of LaTeX When I tried to run the solutions below on my own machine I was not able to reproduce their results, but still got unwanted offsets. This was ...
oliversm's user avatar
  • 2,587
1 vote
2 answers
261 views

Spacing from phantom symbol being consumed by summation symbol

The problem I have found that when I add a phantom{{}+{}} in an aligned environment, if this is followed by a summation symbol, the horizontal spacing is not the same as if I had actually used +. ...
oliversm's user avatar
  • 2,587
0 votes
0 answers
88 views

\phantom not working with $\varbigcirc$ [duplicate]

When I do \documentclass{article} \usepackage{stmaryrd} \begin{document} $\varbigcirc$ test \par \phantom{$\varbigcirc$} test \end{document} I get which is not what I would expect. I would ...
Colas's user avatar
  • 6,516
6 votes
1 answer
1k views

How to make some character "unreadable" as text in the pdf output but still visible?

This question might be seen is a follow up/complement to this question and answer. I'm actually taking the example from there: \documentclass{article} \usepackage{xcolor} \usepackage{transparent} \...
phollox's user avatar
  • 584
1 vote
3 answers
252 views

Specific alignment of subscripts in math mode joint with overleftarrow. How to avoid phantom space fiddling?

The oveleft/rightarrow-command is not optimal because it shiftes indices to much to the right in formulas like: $\overleftarrow{D}_v$ Therefore, I use the following macro which I have adapted from ...
Christoph's user avatar
  • 332
4 votes
2 answers
1k views

How to vertically align subscripts in mathmode [duplicate]

I would like the "AB" subscripts in my formula to be vertically aligned with each other--ideally, by adjusting the second subscript to match the current placement of the first. MWE: \documentclass{...
user143410's user avatar
2 votes
0 answers
202 views

Is there a long version of \phantom?

Is there a macro or environment that hides its content, replacing it by blank space like \phantom, that accepts content consisting of multiple paragraphs? (I am aware that I could use \color{white} ...
schtandard's user avatar
  • 13.9k
2 votes
0 answers
441 views

\phantom ignored at beginning of line (or line break inserted) [duplicate]

In a document, I tried to use \phantom{} to indent the next line. However, it seems the phantom part is removed and/or a line break inserted. \documentclass[xcolor=pdftex,dvipsnames,table]{beamer} % ...
user52366's user avatar
  • 655
19 votes
4 answers
1k views

The phantom directive does not do what I expect

Typing these two codes on http://latex2png.com/: \sqrt{\phantom{a^2}b} and \sqrt{a^2b} I get the following results:       You will notice that the two square roots ...
Wynne's user avatar
  • 311
0 votes
1 answer
3k views

How to use format=hang *within* \caption{} which is already set to \captionsetup{format=hang}?

I know that \captionsetup{format=hang} will give me a figure caption like this: Figure 1.3: Example: This is an example that is shown here. Look at the details of this picture! But how ...
Nemgathos's user avatar
  • 545