From 620c24ad66138ccc070b24676b5e0e51854524f5 Mon Sep 17 00:00:00 2001 From: Andreas Richardson Date: Tue, 29 Sep 2026 23:28:23 +0100 Subject: [PATCH] Treat a blank \cventry description as empty (#312) The description (#7) was tested with \ifx&, so a description holding only whitespace, such as the line break left when its content is commented out, counted as non-empty and added an empty description line. Test it with etoolbox's \ifblank in all body styles instead. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Ay3NRtLtypuStJdysepuJU --- CHANGELOG | 1 + moderncvbodyi.sty | 2 +- moderncvbodyiii.sty | 2 +- moderncvbodyiv.sty | 2 +- moderncvbodyv.sty | 2 +- moderncvbodyvi.sty | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 50ddd43..81d4bdb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ version next - Fix "Underfull \hbox (badness 10000)" warning in banking \subsection dotted rules by adding \hss glue as in \dotfill (#307) - Update "circle" option to allow for half-filled circles in skill matrix (#309) +- Treat a \cventry description containing only whitespace as empty (#312) version 2.6.1 (24 Jun 2026) - Allow the customisation of the contemporary style (#297) diff --git a/moderncvbodyi.sty b/moderncvbodyi.sty index b1155d2..77c916c 100644 --- a/moderncvbodyi.sty +++ b/moderncvbodyi.sty @@ -132,7 +132,7 @@ \ifthenelse{\equal{#5}{}}{}{, #5}% \ifthenelse{\equal{#6}{}}{}{, #6}% \strut% - \ifx&% + \ifblank{#7}{\@tempswatrue}{\@tempswafalse}\if@tempswa% \else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}} \@initializebox{\cvitemwithcommentbox} diff --git a/moderncvbodyiii.sty b/moderncvbodyiii.sty index ab77f1d..6c0d523 100644 --- a/moderncvbodyiii.sty +++ b/moderncvbodyiii.sty @@ -190,7 +190,7 @@ {{\bfseries #4} & {\bfseries #5}\\}% {\itshape #3\ifstrempty{#6}{}{, #6}} & {\itshape #2}\\% \end{tabular*}% - \ifx&% + \ifblank{#7}{\@tempswatrue}{\@tempswafalse}\if@tempswa% \else{\\% \begin{minipage}{\maincolumnwidth}% \small#7% diff --git a/moderncvbodyiv.sty b/moderncvbodyiv.sty index 5049b47..4dd5ec7 100644 --- a/moderncvbodyiv.sty +++ b/moderncvbodyiv.sty @@ -129,7 +129,7 @@ .\strut}% \usebox{\cventryyearbox}% \end{minipage}\strut% - \ifx&% + \ifblank{#7}{\@tempswatrue}{\@tempswafalse}\if@tempswa% \else{% \newline{}% \strut% diff --git a/moderncvbodyv.sty b/moderncvbodyv.sty index 3481389..f7d0b23 100644 --- a/moderncvbodyv.sty +++ b/moderncvbodyv.sty @@ -159,7 +159,7 @@ \ifthenelse{\equal{#6}{}}{}{, #6}% .\strut}% \usebox{\cventryyearbox}}% - \ifx&% + \ifblank{#7}{\@tempswatrue}{\@tempswafalse}\if@tempswa% \else% \vspace*{-4pt}% \cvitem[#1]{}{\small#7}\fi} diff --git a/moderncvbodyvi.sty b/moderncvbodyvi.sty index 79b9d3f..37459f6 100644 --- a/moderncvbodyvi.sty +++ b/moderncvbodyvi.sty @@ -138,7 +138,7 @@ \ifthenelse{\equal{#5}{}}{}{, #5}% \ifthenelse{\equal{#6}{}}{}{, #6}% \strut% - \ifx&% + \ifblank{#7}{\@tempswatrue}{\@tempswafalse}\if@tempswa% \else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}} \@initializebox{\cvitemwithcommentbox}