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 need to add some vertical space between two lines in a p-column of a tabular. Outside of a table I'd use \\[1ex], but inside of a table I have to use \newline which doesn't have an optional argument for extra vertical space. So how can I get the vertical space?

share|improve this question
add comment

3 Answers

Get yourself a copy of the macro that does the real work when \\ is found in normal circumstances:

\documentclass{article}

\expandafter\let\expandafter\pnewline\csname\string\ \endcsname


\begin{document}
\begin{tabular}{|p{5cm}|l|}
some text with\pnewline[1cm]
a forced line break
&
Second
\end{tabular}
\end{document}

enter image description here

Explanation. The usual definition of \\ is

\DeclareRobustCommand{\\}{...}

so the macro doing the real work is named \\⍽ (with a trailing space in the name). We can access that macro with \csname\string\ \endcsname.

I don't think it's necessary to make \pnewline robust, as long as you use it only in tabular cells.

share|improve this answer
add comment

This works (but is obviously not for general use):

\makeatletter\@newline[1.1mm]\makeatother

\@newline is the internal macro that does the \\[foo] stuff.

share|improve this answer
add comment

Use \par \vpsace{1ex}

\documentclass{article}
\usepackage{lipsum}

\begin{document}
\begin{tabular}{p{25em}}
    \lipsum[1] \par \vspace{5ex} \lipsum[1] \\
\end{tabular}
\end{document}
share|improve this answer
    
\par does a bit too much: The next line may be indented (by \parindent) and TeX executes \everypar. –  Martin Schröder Jul 23 '13 at 10:31
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.