1

I have been keeping my CV in the form of longtables for a few years now. I recently got a new computer (Win 10), and thus a new version of MikTex, and I'm finding that the CV no longer compiles right. In particular, it used to be the case that at the end of an entry in a longtable, you could put \\[6pt] to get some space before the next entry. Now this only works when the entry is less than one line long.

Can anyone suggest a fix? Thank you!

MWE:

\documentclass[letterpaper,12pt]{article}
\usepackage{array, xcolor}

\usepackage{longtable}

\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{0.18\textwidth}}
\newcolumntype{R}{p{.78\textwidth}}
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}

\begin{document}
    
     
    \section*{A List Where It Works}
    \begin{longtable}{L!{\VRule}R}
        2021&If it stays on one line, the spacing works!\\[6pt]
        2020&If it stays on one line, the spacing works!\\[6pt]
        2018&If it stays on one line, the spacing works!\\[6pt]
    \end{longtable}
    
    \vspace{10pt}
    
        \section*{A List Where It Doesn't}
    \begin{longtable}{L!{\VRule}R}
        2021&If it runs over to more than one line, all of a sudden the spacing no longer works.\\[6pt]
        2020&If it runs over to more than one line, all of a sudden the spacing no longer works.\\[6pt]
        2018&If it runs over to more than one line, all of a sudden the spacing no longer works.\\[6pt]
    \end{longtable}

        \section*{Looks Bad When Mixed!}
\begin{longtable}{L!{\VRule}R}
    2021&If it runs over to more than one line, all of a sudden the spacing no longer works.\\[6pt]
    2020&If it stays on one line, it works.\\[6pt]
    2018&If it runs over to more than one line, all of a sudden the spacing no longer works.\\[6pt]
\end{longtable}
    
\end{document}
2
  • that behaviour hasn't changed for 30 years \\[length] adds to the default depth of the row but a p column is all depth so typically has already added more depth than teh[] argument. May 14 at 18:56
  • I'm not sure I understand. On my old computers, \\[length] did add space between items, regardless of whether they were one line or several. Now, however, it only adds space between items when they are one line long. So it does seem like this behavior has changed somehow. What am I missing?
    – LukeB
    May 14 at 19:11
1

I propose a solution based on bigstrut: you may add \bigstrut[b] either automatically at the end of each cell in the last column (which I did in the following code), or add it by hand for the rows for which you're interested in adding a space.

\documentclass[letterpaper, 12pt]{article}
\usepackage{array, xcolor}
\usepackage{longtable}

\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{0.18\textwidth}}
\newcolumntype{R}{p{.78\textwidth}}
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}
\usepackage{bigstrut}

\begin{document}

    \section*{A List Where It Works}
    \begin{longtable}{L!{\VRule}R}
        2021&If it stays on one line, the spacing works!\\[6pt]
        2020&If it stays on one line, the spacing works!\\[6pt]
        2018&If it stays on one line, the spacing works!\\[6pt]
    \end{longtable}

    \vspace{10pt}

        \section*{Another List Where It Works}
\setlength{\bigstrutjot}{6pt}
    \begin{longtable}{L!{\VRule}R<{\bigstrut[b]}}
        2021&If it runs over to more than one line, all of a sudden the spacing no longer works.\bigstrut[b]\\
        2020&If it runs over to more than one line, all of a sudden the spacing no longer works.\\
        2018&If it runs over to more than one line, all of a sudden the spacing no longer works.\\
    \end{longtable}

        \section*{Doesn’t Look So Bad When Mixed!}
\begin{longtable}{L!{\VRule}R<{\bigstrut[b]}}
    2021&If it runs over to more than one line, all of a sudden the spacing no longer works.\\
    2020&If it stays on one line, it works.\\
    2018&If it runs over to more than one line, all of a sudden the spacing no longer works.\\
\end{longtable}

\end{document} 

enter image description here

3
  • This works for the MWE! But for some reason, when I apply the same solution to the actual CV, which has a different font, the spaces become very small. Is there a way to adjust the amount of space added by \bigstrut[b]?
    – LukeB
    May 14 at 20:29
  • Yes. That's what I did just before the table code: \setlength{\bigstrutjot}{6pt}. Change the value (maybe it's better to use ex as a unit, not the typographical point).
    – Bernard
    May 14 at 20:38
  • Ah, I missed that! Thank you, that works great!
    – LukeB
    May 14 at 20:44
1

What about this approach based on a different value of \arraystretch? (I additionally made sure to get rid of the overfull hbox warnings by modifying one of the custom columns.)

\documentclass[letterpaper,12pt]{article}
\usepackage{array, xcolor}
\usepackage{longtable}

\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft\arraybackslash}p{\dimexpr 0.18\textwidth-2\tabcolsep}}
\newcolumntype{R}{p{.78\textwidth}}
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}

\begin{document}
\renewcommand*{\arraystretch}{1.4}
     
    \section*{A List Where It Works}
    \begin{longtable}{L!{\VRule}R}
        2021&If it stays on one line, the spacing works!\\
        2020&If it stays on one line, the spacing works!\\
        2018&If it stays on one line, the spacing works!\\
    \end{longtable}
    
    \vspace{10pt}
    
        \section*{A List Where It Doesn't}
    \begin{longtable}{L!{\VRule}R}
        2021&If it runs over to more than one line, all of a sudden the spacing no longer works.\\
        2020&If it runs over to more than one line, all of a sudden the spacing no longer works.\\
        2018&If it runs over to more than one line, all of a sudden the spacing no longer works.\\
    \end{longtable}

        \section*{Looks Bad When Mixed!}
\begin{longtable}{L!{\VRule}R}
    2021&If it runs over to more than one line, all of a sudden the spacing no longer works.\\
    2020&If it stays on one line, it works.\\
    2018&If it runs over to more than one line, all of a sudden the spacing no longer works.\\
\end{longtable}
    
\end{document}
1
  • There are some instances when I don't want to have spacing between lines though. This seems to add the spacing universally, right?
    – LukeB
    May 14 at 18:31

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.