2

Spacing in enumerate is hard. I have a list with some items that wrap to a second line (not a second item though). But that second line doesn't line up with the first.

I've been playing with parsep, itemindent, labelindent, and other things with enumerate, but I can't seem to get any to work.

I have two issues.

1) The item labels ignore my 1.5in margin on the left.

2) The second line that is wrapped doesn't indent to the same place as the first line. I'd maybe even like it to 'hang' in even more.

Here is a MWE of what I have so far

\documentclass[12pt]{report}
\usepackage{polyglossia} 

\setdefaultlanguage[variant=american]{english}

\usepackage{fontspec} % [T1]{fontenc} is used for others, lualatex says do fontspec
\defaultfontfeatures{Ligatures=TeX} 
\setmainfont[
SmallCapsFont={Tex Gyre Termes},
SmallCapsFeatures={Letters=SmallCaps},
]{Latin Modern Roman}

\usepackage{csquotes}
%
%   Page Margins and Page Layout
%
\usepackage[letterpaper]{geometry}

% Make new variables for what the margins will be.
\newcommand{\pageMargin}{1.0in}
\newcommand{\pageMarginLeft}{1.5in}

% Define page geometry
\geometry{left=\pageMarginLeft}
\geometry{top=\pageMargin}
\geometry{right=\pageMargin}
\geometry{bottom=\pageMargin}
\geometry{includefoot} % This makes the page number and other footers, come in the margin as well.


% List layouts, enumerated lists, mainly for CV
\usepackage{enumitem}

\usepackage{setspace}
\doublespacing
%\onehalfspacing


\begin{document}


        \begin{enumerate}[align=right,parsep=-0.05in]
            \singlespacing
            \item[Thing here] \hskip 0.5in Definition goes here
            \item[Another thing here] \hskip 0.5in Another definition goes here
            \item[A longer first item here] \hskip 0.5in And another definition to go with this one
            \item[Another thing2 here] \hskip 0.5in Another definition2 goes here, but this time with a very long definition that will skip to a second line.
            \item[Final] \hskip 0.5in And a final definition.

        \end{enumerate}

\end{document}

Here's a picture, I hope its obvious what I'm looking for.

enter image description here

2

labelsep sets the gap between left and right columns, and leftmargin is set to the width of the widest label plus the \labelsep.

\documentclass[12pt]{report}
\usepackage{polyglossia} 

\setdefaultlanguage[variant=american]{english}

\usepackage{fontspec} % [T1]{fontenc} is used for others, lualatex says do fontspec
\defaultfontfeatures{Ligatures=TeX} 
\setmainfont[
SmallCapsFont={Tex Gyre Termes},
SmallCapsFeatures={Letters=SmallCaps},
]{Latin Modern Roman}

\usepackage{csquotes}
%
%   Page Margins and Page Layout
%
\usepackage[letterpaper]{geometry}

% Make new variables for what the margins will be.
\newcommand{\pageMargin}{1.0in}
\newcommand{\pageMarginLeft}{1.5in}

% Define page geometry
\geometry{left=\pageMarginLeft}
\geometry{top=\pageMargin}
\geometry{right=\pageMargin}
\geometry{bottom=\pageMargin}
\geometry{includefoot} % This makes the page number and other footers, come in the margin as well.


% List layouts, enumerated lists, mainly for CV
\usepackage{enumitem}

\usepackage{setspace}
\doublespacing
%\onehalfspacing


\begin{document}

\setbox0=\hbox{A longer first item here}

        \begin{enumerate}[parsep=-0.05in,labelsep=.5in,
           leftmargin=\dimexpr\wd0+\labelsep\relax]
            \singlespacing
            \item[Thing here] Definition goes here
            \item[Another thing here] Another definition goes here
            \item[A longer first item here] And another definition to go with this one
            \item[Another thing2 here] Another definition2 goes here, but this time with a very long definition that will skip to a second line.
            \item[Final] And a final definition.

        \end{enumerate}
        \noindent\hrulefill

\end{document}

enter image description here

1

Your problem is that you have an \hskip command that will be executed just in the beginning of the item's main text. This means that if a newline will be inserted, the \hskip has to be executed again to give you the desired output... But (Xe)LaTeX, can't know that.

A fast fix:

\documentclass[12pt]{report}
\usepackage{polyglossia} 

\setdefaultlanguage[variant=american]{english}

\usepackage{fontspec} % [T1]{fontenc} is used for others, lualatex says do fontspec
\defaultfontfeatures{Ligatures=TeX} 
\setmainfont{Linux Libertine O}

\usepackage{csquotes}
%
%   Page Margins and Page Layout
%
\usepackage[letterpaper]{geometry}

% Make new variables for what the margins will be.
\newcommand{\pageMargin}{1.0in}
\newcommand{\pageMarginLeft}{1.5in}

% Define page geometry
\geometry{left=\pageMarginLeft}
\geometry{top=\pageMargin}
\geometry{right=\pageMargin}
\geometry{bottom=\pageMargin}
\geometry{includefoot} % This makes the page number and other footers, come in the margin as well.


% List layouts, enumerated lists, mainly for CV
\usepackage{enumitem}

\usepackage{setspace}
\doublespacing
%\onehalfspacing


\begin{document}


        \begin{enumerate}[align=right,parsep=-0.05in,]
            \singlespacing
            \item[Thing here] \hskip 0.5in Definition goes here
            \item[Another thing here] \hskip 0.5in Another definition goes here
            \item[A longer first item here] \hskip 0.5in And another definition to go with this one
            \item[Another thing2 here] \hskip 0.5in \begin{minipage}[inner sep=0]{\dimexpr \linewidth-0.5in }Another definition2 goes here, but this time with a very long definition that will skip to a second line.\end{minipage}
            \item[Final] \hskip 0.5in And a final definition.Big enought to compare with the previous line length and adjust 

        \end{enumerate}

\end{document}

enter image description here

If you want, you can also create a new kind of list like this:

\documentclass[12pt]{report}
\usepackage{polyglossia} 

\setdefaultlanguage[variant=american]{english}

\usepackage{fontspec} % [T1]{fontenc} is used for others, lualatex says do fontspec
\defaultfontfeatures{Ligatures=TeX} 
\setmainfont{Linux Libertine O}

\usepackage{csquotes}
%
%   Page Margins and Page Layout
%
\usepackage[letterpaper]{geometry}

% Make new variables for what the margins will be.
\newcommand{\pageMargin}{1.0in}
\newcommand{\pageMarginLeft}{1.5in}

% Define page geometry
\geometry{left=\pageMarginLeft}
\geometry{top=\pageMargin}
\geometry{right=\pageMargin}
\geometry{bottom=\pageMargin}
\geometry{includefoot} % This makes the page number and other footers, come in the margin as well.


% List layouts, enumerated lists, mainly for CV
\usepackage{enumitem}

\usepackage{setspace}
\doublespacing
%\onehalfspacing

\def\myitem#1#2{\olditem[#1]\hspace{0.5in}\begin{minipage}[inner sep=0]{\dimexpr\linewidth-0.5in}#2\end{minipage}}

\newlist{mylist}{enumerate}{1}
\setlist[mylist,1]{align=right,parsep=-0.05in,before={\let\olditem\item\let\item\myitem}, after=\let\item\olditem}

\begin{document}


        \begin{mylist}
            \singlespacing
            \item{Thing here}{Definition goes here}
            \item{Another thing here}{Another definition goes here}
            \item{A longer first item here}{And another definition to go with this one}
            \item{Another thing2 here}{Another definition2 goes here, but this time with a very long definition that will skip to a second line.}
            \item{Final}{And a final definition.Big enought to compare with the previous line length and adjust} 
        \end{mylist}

\end{document}

Result:

enter image description here

But the format is much easier

For align to top the easy solution is to use a tabular instead of a minipage:

\documentclass[12pt]{report}
\usepackage{polyglossia} 

\setdefaultlanguage[variant=american]{english}

\usepackage{fontspec} % [T1]{fontenc} is used for others, lualatex says do fontspec
\defaultfontfeatures{Ligatures=TeX} 
\setmainfont{Linux Libertine O}

\usepackage{csquotes}
%
%   Page Margins and Page Layout
%
\usepackage[letterpaper]{geometry}

% Make new variables for what the margins will be.
\newcommand{\pageMargin}{1.0in}
\newcommand{\pageMarginLeft}{1.5in}

% Define page geometry
\geometry{left=\pageMarginLeft}
\geometry{top=\pageMargin}
\geometry{right=\pageMargin}
\geometry{bottom=\pageMargin}
\geometry{includefoot} % This makes the page number and other footers, come in the margin as well.


% List layouts, enumerated lists, mainly for CV
\usepackage{enumitem}

\usepackage{setspace}
\doublespacing
%\onehalfspacing

\def\myitem#1#2{\olditem[#1]\hspace{0.5in}\begin{tabular}[t]{p{\dimexpr\linewidth-0.5in}}#2\end{tabular}}

\newlist{mylist}{enumerate}{1}
\setlist[mylist,1]{align=right,parsep=-0.05in,before={\let\olditem\item\let\item\myitem}, after=\let\item\olditem}

\begin{document}


        \begin{mylist}
            \singlespacing
            \item{Thing here}{Definition goes here}
            \item{Another thing here}{Another definition goes here}
            \item{A longer first item here}{And another definition to go with this one}
            \item{Another thing2 here}{Another definition2 goes here, but this time with a very long definition that will skip to a second line.}
            \item{Final}{And a final definition.Big enought to compare with the previous line length and adjust} 
        \end{mylist}

\end{document}

Result:

enter image description here

  • We can align to top too with both methods... (Just adding the method) – koleygr Mar 7 '18 at 17:19
1

Another solution, changing the value of \leftmargin to the length of the longest label + 0.5in:

\documentclass[12pt]{report}
\usepackage{polyglossia}

\setdefaultlanguage[variant=american]{english}

\usepackage{fontspec} % [T1]{fontenc} is used for others, lualatex says do fontspec
\defaultfontfeatures{Ligatures=TeX}
\setmainfont[
SmallCapsFont={Tex Gyre Termes},
SmallCapsFeatures={Letters=SmallCaps},
]{Latin Modern Roman}

\usepackage{csquotes}
%
% Page Margins and Page Layout
%
\usepackage[letterpaper, showframe]{geometry}

% Make new variables for what the margins will be.
\newcommand{\pageMargin}{1.0in}
\newcommand{\pageMarginLeft}{1.5in}

% Define page geometry
\geometry{left=\pageMarginLeft}
\geometry{top=\pageMargin}
\geometry{right=\pageMargin}
\geometry{bottom=\pageMargin}
\geometry{includefoot} % This makes the page number and other footers, come in the margin as well.


% List layouts, enumerated lists, mainly for CV
\usepackage{enumitem}

\usepackage{setspace}
\doublespacing
\usepackage{calc} 

\begin{document}

        \begin{enumerate}[align=right,parsep=-0.05in, labelsep = 0.5in, leftmargin = \widthof{A longer first item here\hskip\labelsep}]
            \singlespacing
            \item[Thing here] Definition goes here
            \item[Another thing here] Another definition goes here
            \item[A longer first item here] And another definition to go with this one
            \item[Another thing2 here] Another definition2 goes here, but this time with a very long definition that will skip to a second line.
            \item[Final] And a final definition.
        \end{enumerate}

\end{document} 

enter image description here

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.