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.

How can I indent several lines with respect to the position of some text? For example, this is the effect I'm looking for:

480-479: Battle of Thermopyle
         Greek Victories at Salamis and Plataea end Persian war

Where the the second line is aligned with 'B' of Battle. Is there something similar to the align environment for text?

share|improve this question
    
If you have "several lines,", I assume you're going to have to allow for breaking at the end of the page, correct? –  Werner Jan 21 '13 at 2:07
    
Yeah. But for now, a quick-fix that doesn't allow for it is OK (though it would be preferred) –  asymptotically Jan 21 '13 at 2:08
add comment

1 Answer

up vote 6 down vote accepted

This looks like something which a tabbing environment can solve

\documentclass{article}
\pagestyle{empty}
\begin{document}

\begin{tabbing}
 480-479: \=Battle of Thermopyle\\
          \>Greek Victories at Salamis and Plataea end Persian war
\end{tabbing}

\end{document}

enter image description here

Alternatively, you can use tabular.

\documentclass{article}
\pagestyle{empty}
\begin{document}

\begin{tabular}{lp{4in}}
 480-479: & Battle of Thermopyle\\
          & Greek Victories at Salamis and Plataea end Persian war
\end{tabular}

\end{document}

enter image description here

The spacing is a little bit different, but then you don't have to battle with extraspace before and after the environment. Also, this later approach will let you use longtable that can span multiple pages.

share|improve this answer
    
Very nice :) Thanks! –  asymptotically Jan 21 '13 at 2:47
1  
Note that with tabular, it may be indented with \parindent. Prepending it with \noindent would remove this indent. Additionally, depending on the width of the second column, you might consider using tabularx. –  Werner Jan 21 '13 at 2:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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