Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Oct 27 '11 at 15:28

This question came from our site for professional and enthusiast programmers.

closed as not a real question by Mico, Marco Daniel, Leo Liu, Alan Munn, diabonas Oct 27 '11 at 20:08

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

10  
Why are you not allowed to add a new line? Is this some kind of homework assignment? –  Darhuuk Oct 27 '11 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 '11 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 '11 at 15:56
    
@Darhuuk yeap, that is a meaningless homework –  Cagatay Oct 27 '11 at 17:48
    
@Cagatay: It is not encouraged –  Leo Liu Oct 27 '11 at 17:54

3 Answers 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

share|improve this answer
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 '11 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 '11 at 17:50

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.

share|improve this answer

Something like this?

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

enter image description here

share|improve this answer
    
that did help. thanks a lot (= –  Cagatay Oct 27 '11 at 17:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.