3

I am new to LaTeX and have a weird task. I need to write a line between two others. Think of like that:

foo boo doo(1)

              you soup pope(3)

doo boo foo(2)

But the thing is I am not allowed to add a new line between (1) and (2). In other words, (3) must be in between. How do I do such a thing?

5
  • 10
    Why are you not allowed to add a new line? Is this some kind of homework assignment?
    – AVH
    Oct 27, 2011 at 15:28
  • Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question.
    – Werner
    Oct 27, 2011 at 15:50
  • 4
    In its current form, your question might not get many answers. Please take a look at the How to Ask-page and try to improve your question according to the guidance found there. If you have questions about what to do or if you don't quite understand what I mean, please ask for clarification using the Comment function. Specifically, elaborate on your interpretation of "new line" and show what you've attempted thus far to achieve such output.
    – Werner
    Oct 27, 2011 at 15:56
  • @Darhuuk yeap, that is a meaningless homework
    – Cagatay
    Oct 27, 2011 at 17:48
  • @Cagatay: It is not encouraged
    – Leo Liu
    Oct 27, 2011 at 17:54

3 Answers 3

3

If I understood your question correctly, then here is your answer: use a raisebox in an llap. Working example:

\documentclass{minimal}

\begin{document}
\noindent foo boo doo(1)\llap{\raisebox{-2\baselineskip}[0pt][0pt]{doo boo foo(2)}}

\noindent you soup pope(3)

\noindent\phantom{doo boo foo(2)}

\noindent Lorem ipsum dolor sit amet, invitamus me missam ne velocitate renovasti dolorum.

\end{document}

Minimal Working Example

2
  • 1
    An even more sophisticated solution is to use \baselineskip: \noindent foo boo doo(1)\llap{\raisebox{-2\baselineskip}[0pt][0pt]{doo boo foo(2)}}
    – szantaii
    Oct 27, 2011 at 17:29
  • You could even use a phantom copy of the second line after writing the third, see my updated answer. Sorry for the \noindents.
    – szantaii
    Oct 27, 2011 at 17:50
1

You could use a simple minibox environment as follows:

\documentclass[border=2pt]{standalone}
\begin{document}
\begin{minipage}{0.3\linewidth}
foo boo doo(1)\\%[0.5cm]
doo boo foo(2)
\end{minipage}
\begin{minipage}{0.3\linewidth}
    you soup pope(3)
\end{minipage}
\end{document}

which yields:

enter image description here

if you remove the % comment character in the %[0.5cm] you get:

enter image description here


If the content happens to be in a table, you could adapt the solution from Table: Can I shift a column by half the height of a row? to yield similar results:

\documentclass[border=2pt]{standalone}
\usepackage{collcell}

\newcommand*{\movedown}[1]{\smash{\raisebox{-1ex}{#1}}}%
\newcolumntype{M}{>{\collectcell\movedown}r<{\endcollectcell}}% (M for Middle)

\begin{document}
\begin{tabular}{@{}lM}
foo boo doo(1) & you soup pope(3)\\
doo boo foo(2)\\
\end{tabular}
\end{document}

The @{} is simply used to eliminate the column spacing on the left.

0

Something like this?

\noindent
foo boo doo\\
doo boo foo\\
\raisebox{1.7\baselineskip}[0pt]{\hspace{8em}you soup pope}

enter image description here

0

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