2

I'm struggling to achieve a desired spacing between list items when the items contain a custom macro,

enter image description here

\documentclass[12pt]{article}

\usepackage[paperwidth=297mm, paperheight=420mm]{geometry}
\usepackage[default]{sourcesanspro}

\usepackage{enumitem}
\setitemize{itemsep=1em}
\setitemize{parsep=0.2em}

\newcommand\concept[1]{\parbox[t][\totalheight][t]{200mm}{\fontsize{21pt}{22pt}\scshape\bfseries#1\selectfont}}

\renewcommand\labelitemi{\raisebox{0.15em}{$\bullet$}}

\begin{document}

\fontsize{18pt}{21pt}\selectfont
\begin{itemize}
\item
  \concept{Formal structure of special relativity}

  scalars, vectors, tensors in Minkowski space \\
  Lorentz-invariant formulation of physical laws
\item
  \concept{Electromagnetism as a field theory}

  Lagrangian for fields • general Euler-Lagrange equations

\item
  \concept{Radiation of charges in ultra-\\relativistic motion}

  generalised Lienard-Wiechert potentials • synchrotron light
\end{itemize}

\end{document}

I've tweaked the item spacing and also moved the item bullets, but one thing I cannot seem to address is the spacing of the last item: the normal text is too close to the "concept". What would be a better approach / a simple fix for this?

I tried the various alignment options of parbox but they move the item quite far from its original baseline.

4

A \parbox[t] has its height equal to the height of the first line, all the rest contributes to the depth. So, when the box has more than one line, it has very large depth and TeX will insert between it and the next line \lineskip glue (default 1pt).

The trick is to store the depth of the last line and reinsert it after the box, see https://tex.stackexchange.com/a/34982/4427

I also added \nopagebreak to avoid the title being separated from the relevant text.

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{fix-cm}

\usepackage[paperwidth=297mm, paperheight=420mm]{geometry}
\usepackage[default]{sourcesanspro}

\usepackage{enumitem}
\setitemize{itemsep=1em,parsep=0.2em}

\newcommand\concept[1]{%
  \parbox[t]{0.8\linewidth}{%
    \raggedright
    \fontsize{21pt}{22pt}\scshape\bfseries#1\par
    \xdef\keepprevdepth{\the\prevdepth}%
  }\par\nopagebreak\prevdepth\keepprevdepth}

\renewcommand\labelitemi{\raisebox{0.15em}{\textbullet}}

\begin{document}

\fontsize{18pt}{21pt}\selectfont
\begin{itemize}
\item
  \concept{Formal structure of special relativity}

  scalars, vectors, tensors in Minkowski space \\
  Lorentz-invariant formulation of physical laws
\item
  \concept{Electromagnetism as a field theory}

  Lagrangian for fields • general Euler-Lagrange equations

\item
  \concept{Radiation of charges in ultrarelativistic motion}

  generalised Lienard-Wiechert potentials • synchrotron light
\end{itemize}

\end{document}

The 0.8\linewidth is just to get two lines in the last title.

enter image description here

  • thanks a lot for this great fix. Somehow I managed to ask this question using a new account that I can't log back into so I'm unable to accept the answer :(, but I've upvoted at least. – baptiste Apr 13 '18 at 22:35
  • @baptiste Damn! I'm already rep capped. 😀 – egreg Apr 13 '18 at 22:54

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.