I would like command similar to \phantom, but which moves not forward, but backward. See the following example:
$k+1,k+2,k+3,\dots,\overline{2k,\phantom{1}}\hspace{-2.8mm}\underbrace{1,2,3,\dots,k,}2k+1$
I would like to do this in a more elegant way than to use \hspace with negative value.
Of course, any other solutions which show how to combine \overline and \underbrace are welcomed, but I would also like to know whether there is "backwards phantom" for other purposes.
Thank you in advance.
General ⇒ How to write \phantom text backwards?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to write \phantom text backwards?
There is a command \negthinspace (short form \!) which could be used here.
In this case the second part is placed more precisely. I don't know any other predefined negative space. But you can define your own ones.
Best regards
Thorsten¹
Code: Select all
$k+1,k+2,k+3,\dots,\overline{2k,\phantom{1}}\!\!\!\!\underbrace{1,2,3,\dots,k,}2k+1$
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
How to write \phantom text backwards?
Just a comment: 2 \negthinspace =(aprox.) 1 \negthickspace:
Supplement:
as far as I know there are these commands for negative space:
\negthinspace (short version \!) = 3mu
\negmedspace = 4mu plus 2mu minus 4mu
\negthickspace = 5mu plus 5 mu
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$k+1,k+2,k+3,\dots,\overline{2k,\phantom{1}}\hspace{-2.8mm}\underbrace{1,2,3,\dots,k,}2k+1$
$k+1,k+2,k+3,\dots,\overline{2k,\phantom{1}}\!\!\!\!\underbrace{1,2,3,\dots,k,}2k+1$
$k+1,k+2,k+3,\dots,\overline{2k,\phantom{1}}\negthickspace\negthickspace\underbrace{1,2,3,\dots,k},2k+1$
\end{document}
as far as I know there are these commands for negative space:
\negthinspace (short version \!) = 3mu
\negmedspace = 4mu plus 2mu minus 4mu
\negthickspace = 5mu plus 5 mu
1,1,2,3,5,8,13,21,34,55,89,144,233,...
How to write \phantom text backwards?
Here it is an alternative that doesn't use negative space:
Code: Select all
$k+1,k+2,k+3,\dots,\makebox[0pt][l]{$\overline{\phantom{2k,1}}$}2k,\underbrace{1,2,3,\dots,k,}2k+1$
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Re: How to write \phantom text backwards?
Seems that there is no way to do what I described. Thank you all anyway, especially Juanjo, whose solution is very nice and I believe that it can be adapted for most of the similar problems.