I know about \! which creates a thin negative space but is there any native command for large negative spaces (like quad or qquad for positive spaces) ?
3 Answers
In text mode: \kern-1em equals "minus quad"
In math mode: \mkern-18mu equals "minus quad"
For "minus qquad" use -2em or -36mu respectively.
-
what about negative simple space in text mode? (according to the selected font)Qaher– Qaher2020-12-01 16:28:06 +00:00Commented Dec 1, 2020 at 16:28
For LaTeX, horizontal spacing is achieved using \hspace{<len>} where <len> is a length (either positive or negative); TeX's equivalent to \hskip. Since \quad [\qquad] is equivalent to a horizontal skip of 1em [2em], use \hspace{-1em} [\hspace{-2em}] to obtain a negative space amount.
\kern inserts a space depending on the mode that TeX is in, and could therefore be either vertical or horizontal.
Text-based spacing can be inserted using any of the \phantom-related commands: \phantom{<stuff>}, or \hphantom{<stuff>}, for example.
-
18I would also love to use some
phantom-like command but for negative space, i.e., going back in an amount given by a forward-written word. Example, I want to write math over path. Then my code should be:math \negphantom{math} path. Is it possible in an easy way? Maybe folding aphantominside something to rotate/reflect it? But would that provide the same placement for the h's of math and path?Andrestand– Andrestand2014-02-11 09:00:39 +00:00Commented Feb 11, 2014 at 9:00 -
1Or maybe some way of getting the size in pt of
{whichever strange code object}may print in the pdf? (like\fontcharwd..., but not for simple characters, here)Andrestand– Andrestand2014-02-11 10:04:55 +00:00Commented Feb 11, 2014 at 10:04 -
2My approach for my first comment is:
math\begin{rotate}{180}\scalebox{-1}[-1]{p\phantom{ath}}\end{rotate}, which requires therotatingpackage and alsographicx. It would be nice to do withrotateboxwhat I do with therotateenvironment, in order to avoid using both packages, but I haven't be able due to the way it rotates or keeps a fixed center.Andrestand– Andrestand2014-02-11 13:30:57 +00:00Commented Feb 11, 2014 at 13:30 -
20@Andrestand: Use
\newcommand{\negphantom}[1]{\settowidth{\dimen0}{#1}\hspace*{-\dimen0}}.2014-02-11 15:13:26 +00:00Commented Feb 11, 2014 at 15:13 -
1I do not understand what you need to create the second makebox-command for @Andrestand.
bla math\makebox[-\width]{path}\phantom{path} blarenders the exact same for me. Anyway, thanks a lot for the code!Dominikus K.– Dominikus K.2015-12-04 10:07:49 +00:00Commented Dec 4, 2015 at 10:07
What about simply \!\! or \!\!\! ?
It worked for me fine...
-
Welcome to TeX.SE. Please note that outside of code environments the backslash `` is treated as an escape character by MarkDown, this is why none of the backslashes you typed originally showed up. I've wrapped them in code blocks so now they show.Willie Wong– Willie Wong2021-07-23 03:04:22 +00:00Commented Jul 23, 2021 at 3:04
bla \rlap{math}path bla. This renders the two words left aligned. For right alignment use\llap.