# How to add parsep to itemsep and set parsep to 0pt, when declaring my list?

By reading \topsep, \itemsep, \partopsep and \parsep - what does each of them mean (and what about the bottom)?, I learned how spacing works, therefore I am trying to do some spacing settings/adjusting.

Initially I tried this:

\documentclass[12pt]{article}

\usepackage[T1]{fontenc}
\usepackage[brazil]{babel}
\usepackage[a4paper, margin=2cm]{geometry}

\usepackage[utf8]{inputenc}
\usepackage[shortlabels]{enumitem}

\begin{document}

\begin{enumerate}[itemsep=\parsep+\itemsep,parsep=0pt] % <--- Here

\item https://github.com/jbeder/yaml-cpp

Some text.

\item https://github.com/trishume/syntect

\end{enumerate}

\end{document}


But the the compiler seems not liked:

test.tex:12: Missing number, treated as zero. [...rate}[itemsep=\parsep+\itemsep,parsep=0pt]]
test.tex:12: Illegal unit of measure (pt inserted). [...rate}[itemsep=\parsep+\itemsep,parsep=0pt]]


# Update

I would like to:

1. Sum the parsep and itemsep values
2. Attribute them to my list option itemsep
3. And set parsep to zero.

This is a picture about it from [1]:

• \dimexpr\parsep+\itemsep\relax – David Carlisle Apr 26 '17 at 23:16
• It's not clear what you want to achieve here. If you want to add lengths you need to add \usepackage{calc} but what do you think itemsep=\itemsep+\parsep should give you? – Alan Munn Apr 26 '17 at 23:16
• I want to sum the parsep and itemsep values, attribute them to my list itemsepand set parsep to zero. I Updated the question within a picture. Thanks @DavidCarlisle, I tried your expression and it worked! – user Apr 26 '17 at 23:27
• Ok. If you don't feel like dealing with the raw TeX that @DavidCarlisle suggested you can simply load the calc package instead (a bit more LaTeXy). – Alan Munn Apr 26 '17 at 23:37

It seems a slightly strange setting for the list but the arithmetic can be performed using an e-tex dimension expression.

\dimexpr\parsep+\itemsep\relax


A more LaTeXy way to do this is to load the calc package, and then you don't need the \dimexpr and \relax in David's answer.

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[brazil]{babel}
\usepackage[a4paper, margin=2cm]{geometry}

\usepackage[shortlabels]{enumitem}
\usepackage{calc}

\begin{document}

\begin{enumerate}[itemsep=\parsep+\itemsep,parsep=0pt]

\item https://github.com/jbeder/yaml-cpp

Some text.

\item https://github.com/trishume/syntect

\end{document}