How do you make a paragraph indent within a table?
Around line ends/beginnings, LaTeX swallows spaces. To force these spaces to stay in place, use \hspace*{<length>}
:
\ctable[
cap= A short caption,
caption= This is a longer caption,
]{lp{2in}p{2in}}{}{\FL
title1 & title2 & title3\ML
label &
\hspace{1em} This is paragraph one. This is paragraph one.\newline
\hspace*{1em} This is paragraph two. This is paragraph two.&
\hspace{1em} This is paragraph one. This is paragraph one.\newline
\hspace*{1em} This is paragraph two. This is paragraph two.\NN
label2 &
\hspace{1em} This is paragraph one. This is paragraph one.\newline
\hspace*{1em} This is paragraph two. This is paragraph two.&
\hspace{1em} This is paragraph one. This is paragraph one.\newline
\hspace*{1em} This is paragraph two. This is paragraph two.\LL
}
Another alternative stems from the fact the paragraph indentation is removed within tables since their typesetting may be somewhat different from that of regular text. Consequently, setting \parindent
to the appropriate value within \ctable
should do the trick:
...
\setlength{\parindent}{1em}This is ... \endgraf &
\setlength{\parindent}{1em}This is ... \endgraf \\
...
However, you have to use \endgraf
in order to terminate paragraphs together with the \setlength
command here since neither \par
nor \newline
would help.
Use the \endgraf
macro -- it works the same way as \par
, but is also allowed in places where \par
isn't. (Thanks to egreg for the tip.)
\documentclass{article}
\usepackage{ctable}
\newcolumntype{q}[1]{>{\setlength{\parindent}{1em}}p{#1}}
\begin{document}
\ctable[
cap= A short caption,
caption= This is a longer caption,
]{lq{2in}q{2in}}{}{\FL
title1 & title2 & title3\ML
label &
This is paragraph one. This is paragraph one.\endgraf
This is paragraph two. This is paragraph two.&
This is paragraph one. This is paragraph one.\endgraf
This is paragraph two. This is paragraph two.\NN
label2 &
This is paragraph one. This is paragraph one.\endgraf
This is paragraph two. This is paragraph two.&
This is paragraph one. This is paragraph one.\endgraf
This is paragraph two. This is paragraph two.\LL
}
\end{document}