0

I have a tabular environment, where I want to separate "paragraphs" with empty lines or spaces. The paragraphs have one major title on the left whereas the column on the right has several lines. Here is an example:

\documentclass{article}
\usepackage{tabularx}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{@{}l<{}@{\ }X@{}}
    \textbf{Paragraph 1} &
    \textbf{Header 1} \\
    & Next line \\
    & Third piece of text \\
    & Fourth line of text \\

    % \medskip

    \textbf{Paragraph 2} &
    \textbf{Header 2} \\
    & Next line \\
    & Third piece of text \\
    & Fourth line of text 
\end{tabularx}
\end{document}

enter image description here

In the middle I have commented out \medskip command that would insert the space I need. However, that appears unintuitively after the second paragaph header not before it:

enter image description here

I found similar problem here: https://www.reddit.com/r/LaTeX/comments/5om827/vspace_after_newline_in_tabularx/

The solution is to use \vskip command, but somehow that brings an error message in the table form that I need:

ERROR: Extra alignment tab has been changed to \cr

My guess is that I should tweak the line \begin{tabularx} but I have no idea how.

  • Is there a special reason for using a table for this kind of content? If the text in the paragraphs gets longer you might get problems with page breaks (unless you use a longtable). Maybe you could use a description environment instead? – leandriis Jan 11 at 9:29
  • Good point! tabular works in my case because the "table" won't stretch several pages. For more general cases, I need to familiarize myself with description. Thanks! – Antti Jan 11 at 10:16
1
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{@{}l<{}@{\ }X@{}}
    \textbf{Paragraph 1} &
    \textbf{Header 1} \\
    & Next line \\
    & Third piece of text \\
    & Fourth line of text \\[2cm]

    \textbf{Paragraph 2} &
    \textbf{Header 2} \\
    & Next line \\
    & Third piece of text \\
    & Fourth line of text 
\end{tabularx}
\end{document}

or perhaps better

\documentclass{article}
\usepackage{tabularx}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{@{}l<{}@{\ }X@{}}
    \textbf{Paragraph 1} &
    \textbf{Header 1} \\
    & Next line \\
    & Third piece of text \\
    & Fourth line of text 

\vspace{2\baselineskip}\\

    \textbf{Paragraph 2} &
    \textbf{Header 2} \\
    & Next line \\
    & Third piece of text \\
    & Fourth line of text 
\end{tabularx}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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