26

If I use a \llap{text} command at the beginning of an indented paragraph, the text is not indented and is put on the line above the paragraph.

\documentclass{article}
\begin{document}

\parindent=2cm

\llap{x}Hello

H\llap{x}ello

\end{document}

Using the code above, I get the x above and far too the left, relative to the H in the first case, but I get the correct result in the second case (the x is just to the left of the e).

Screenshot of the above code

How can I get the x just to the left of the H?

I tried putting a vphantom{X} just before the \llap to force the paragraph to start, but that didn't change the result at all.

3
  • 5
    you need \leavevmode as \llap is \hbox not \mbox The supported LaTeX syntax is \makebox[0pt][l]{...} which does not have this surprise. Nov 20, 2013 at 22:12
  • 1
    You can also do \hspace*{0pt}\llap{x}Hello.
    – user11232
    Nov 20, 2013 at 22:23
  • 2
    @DavidCarlisle: Except \makebox[0pt][l]{...} is \rlap, while \makebox[0pt][r]{...} is \llap.
    – Dan
    Nov 21, 2013 at 22:07

2 Answers 2

34

\llap is not a LaTeX box command and does not start a paragraph.

\documentclass{article}
\begin{document}

\parindent=2cm

\makebox[0pt][r]{x}Hello

H\makebox[0pt][r]{x}ello

\end{document}

enter image description here

9

You can also use

\indent\llap{x}Hello

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .