1

The following code

\documentclass{book}
\usepackage{lipsum}
\usepackage[lf]{electrum}
\usepackage{enumitem}
\usepackage{xcolor}

\begin{document} \thispagestyle{empty}

\large \SetLabelAlign{chron}{\raisebox{-.75ex}[0pt][0pt]{\makebox[0pt][r]{\textbf{#1 --- }}}}

\begin{description}[align=chron, itemindent=0pt, leftmargin=100pt, rightmargin=0cm, parsep=2ex]

\item[September 24, 2021] \lipsum[12]

\item[September 25, 2021] \lipsum[4]

\item[September 26, 2021] A short description. \end{description} \end{document}

produces the output

enter image description here

As you can see, the third item label appears to be a little out of sorts because the description is very short. For descriptions of this type, I would like to raise the date and dash a little so it does not appear to be hanging beneath the adjoining sentence. I have not been able to do this, although it seems like a thing that should not be too complicated to accomplish.

QUESTION: How may the code of the MWE be modified in order to adjust a particular date and dash (such as September 26, 2021 ---) upwards without affecting the particulars set forth in \SetLabelAlign{chron}? (In this actual document, this occurs more than once, so I would like to be able to employ a "quick fix" as needed.)

Thank you.

DDS
  • 8,816
  • 4
  • 9
  • 36

1 Answers1

1

A quick solution is to put the offset of the raisebox in a macro and change the definition of that macro between the items:

\documentclass{book}
\usepackage{lipsum}
\usepackage[lf]{electrum}
\usepackage{enumitem}
\usepackage{xcolor}

\begin{document} \thispagestyle{empty}

\large \def\raiseamount{-.75ex} \SetLabelAlign{chron}{\raisebox{\raiseamount}[0pt][0pt]{\makebox[0pt][r]{\textbf{#1 --- }}}}

\begin{description}[align=chron, itemindent=0pt, leftmargin=100pt, rightmargin=0cm, parsep=2ex]

\item[September 24, 2021] \lipsum[12]

\def\raiseamount{0ex} \item[September 26, 2021] A short description.

\def\raiseamount{-.75ex} \item[September 25, 2021] \lipsum[4] \end{description} \end{document}

enter image description here

Marijn
  • 37,699
  • It seems that when I need to raise the dashes a little, I use \def\raiseamount{0ex} just prior to that item; then after the item, use \def\raiseamount{-.75ex} until a raising of the dashes is needed again, upon which I repeat the aforesaid two-step procedure. Thank you for your answer, it appears to work quite nicely. – DDS Sep 25 '21 at 17:01
  • Incidentally, I have noticed that you have written, "that solving LaTeX problems may be hard, but there is always a solution." Perhaps, if you have time, you will consider this one: https://tex.stackexchange.com/questions/616290/how-to-replace-page-numbers-by-item-numbers-in-the-index. Thanks again. – DDS Sep 25 '21 at 17:08