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.

Inside of a table column with a width determined by a p{5in} tag, I want all but the first line of text to be indented.

Is there any way to achieve this? Doing it by hand would make later edits overly cumbersome.

Thanks!

share|improve this question
3  
it's called a hanging indent :) –  Kit Sep 6 '10 at 7:14
add comment

2 Answers 2

\everypar{\hangindent1em \hangafter1} seems to do what you want.

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{lipsum}
\begin{document}
\noindent
\begin{tabular}{cp{5in}c}
X&\everypar{\hangindent1em \hangafter1} \lipsum[1-3]&X
\end{tabular}
\end{document}
share|improve this answer
    
Caveat: \everypar shouldn't be used outside of such restricted contexts; various standard LaTeX commands will (unfortunately) clobber it. –  Will Robertson Sep 6 '10 at 9:05
1  
It's too bad really. It wouldn't be that hard to implement a stack of \everypar commands that one could push/pop tokens to/from. –  TH. Sep 6 '10 at 9:17
2  
See the everyhook package. –  Philipp Oct 17 '10 at 19:33
    
@TH Just \parindent-1em \lipsum would do the trick. –  Yiannis Lazarides Oct 17 '10 at 23:42
    
@Yiannis Lazarides: Not really. That causes the first line to stick out into the space between columns. Try changing the column specification to c@{}p{5in}c to see it overlap the X. One could increase the spacing between those columns by 1 em and then use 5in - 1em as the width of the parbox to compensate. –  TH. Oct 18 '10 at 7:28
add comment

One "pure LaTeX" way of doing this looks something like this, using a custom list environment:

\newenvironment{hanglist}[1][\parindent]{%
    \begin{list}{}{%
        \setlength{\leftmargin}{#1}
        \setlength{\labelwidth}{0pt}
        \setlength{\labelsep}{0pt}
        \setlength{\itemindent}{-#1}}
    }{%
        \end{list}
    }

\begin{hanglist}[2cm]
\item\lipsum[1]
\item\lipsum[2]
\end{hanglist}
share|improve this answer
add comment

Your Answer

 
discard

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