How to Remove the Blank Line Between Items in twentysecondcv
At a glance
- 1. Find the list
Check that the entries are inside the twenty environment and identify which spacing appears too large.
- 2. Reduce item spacing
Set itemsep to zero after the list begins; adjust parsep or topsep only if paragraph or list-edge spacing is also unwanted.
- 3. Check conditionals
If the gap remains, inspect the item macro for blank paragraphs or line breaks in its ifthenelse branches.
The twenty environment in common versions of the twentysecondcv class is a list, but the class definition already sets \itemsep to 0pt. If your copy has a nonzero value, reduce the list’s \itemsep before adding the first item. If the gap remains, check the entry macro for a paragraph break or line break that is being added regardless of the \ifthenelse result.
Reduce the spacing between entries
The class’s twenty environment is a list, and its entries are list items. In commonly distributed versions of the class, \itemsep and \parsep are already set to 0pt; if your class version or local modifications use a nonzero value, you can set them before the first \twentyitem:
\documentclass{twentysecondcv}
\begin{document}
\begin{twenty}
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
\twentyitem{2022--2024}{Research assistant}{University}{Worked on a project.}
\twentyitem{2020--2022}{Student}{College}{Completed a degree.}
\end{twenty}
\end{document}
This assumes the twentysecondcv class file is installed and your class version provides the usual twenty environment and \twentyitem command. \itemsep controls the gap between separate items. \parsep controls extra vertical space between paragraphs within an item; setting it to zero is useful if an entry’s description wraps into multiple paragraphs. If only the gap between entries is too large, try changing \itemsep alone first. If it is already zero, inspect the entry macro and any formatting commands it uses.
The example uses 0pt to show how to remove extra list spacing. If that makes the entries feel crowded, use a smaller positive value instead, such as 2pt.
What the other spacing lengths control
A list can have spacing at its beginning and end as well as between items. If the unwanted space is above the first entry or below the last, set \topsep before the list begins. For example:
{%
\setlength{\topsep}{0pt}
\begin{twenty}
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
% Entries go here
\end{twenty}
}
These settings are local to this group and twenty environment, so they should not change spacing elsewhere in the CV. If setting them has no effect, check the class file for the actual environment definition and for list settings in that definition that override the values.
Check for unwanted paragraphs or line breaks
If the gap appears only when a particular optional field is empty, inspect the macro that prints that field. \ifthenelse does not itself add vertical space, but its branches can contain commands that do. A blank line in a macro definition creates a paragraph break, and a \\ can leave an unintended line break if it is placed outside the conditional.
For example, keep punctuation and the line break inside the branch that prints the optional field, or put the line break after the conditional only when it is needed. The exact edit depends on the \twentyitem definition in your copy of the class. Avoid adding \\ or \vspace between every pair of entries as a first fix: that can produce inconsistent spacing and may cause layout problems when an entry wraps.
Common mistakes
- Changing
\parskipwhen the problem is\itemsep. These lengths control different kinds of space. Start with the list-item spacing. - Adding
\vspace{-...}between entries. This hides the cause and can make the layout fragile, especially when text wraps or a page breaks. - Assuming an empty conditional branch creates a blank line. The conditional only selects content. Look for paragraph breaks, line breaks, or spacing commands in the selected code.
- Changing the global list settings. A local adjustment inside
twentyis less likely to alter unrelated lists elsewhere in the document.
If the gap is uniform after every entry, check whether \itemsep is nonzero; in the common class definition it is already zero. If the gap appears only for entries with an empty field, inspect the entry macro’s conditional formatting as well.
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.