1

I recognize this is a bad question but I am quite desperate and thought someone might be able to at least point me in the right direction.

When I add a value for itemindent, \setlist[1]{leftmargin=0.25in, itemindent=14pt} , it causes the first item label to be out alignment with the rest of the item labels like so:

1. Text text text 
     2. text text text
     3. text text text

When I remove the itemindent specification, all labels are vertically aligned again. Also, this only affects the first level, as in \setlist[2]{leftmargin=0.25in, itemindent=14pt} works fine.

Unfortunately, I cannot provide a minimum working example because it compiles correctly on my local environment; it's when I compile in my Heroku web application that they become messed up. I'm compiling using latexmk and lualatex.

Concrete Questions

  1. My suspicion is some other setting is conflicting with the first item of the first list somehow, but what could this be? The full class file is here.

  2. Is it possible to set the itemindent for every paragraph in the document outside of enumitem?

  3. I am near giving up on tracking down this bug... is there an alternative to enumitem that can provide similar list spacing customization?

3
  • 1
    Welcome to TeX:SE! Please provide ab example of small, complete document, which reproduce your problem.
    – Zarko
    Dec 15, 2022 at 5:19
  • 1
    Can you somehow retrieve the LaTeX code that is generated in the Heroku application (maybe it is stored in some temporary file that you have access to)? If yes then you can compile that locally and see of the problem still occurs, and then post it directly here (as an edit to your question) if it is small or shorten it first by removing unnecessary content and then post it here. To get your question answered it is important that the behavior is reproducible for us as potential answerers, otherwise it is very difficult to guess what might be the problem.
    – Marijn
    Dec 15, 2022 at 7:38
  • It could also be that your application for some reason uses an older version of enumitem or that the package is not installed on the server environment at all. You could try compiling with LuaLaTeX only (so not through latexmk) without additional command line options, that may expose this kind of installation problem directly or give you a log file with useful information.
    – Marijn
    Dec 15, 2022 at 9:24

1 Answer 1

2

The core of the problem is that the class uses \\ at the end of paragraphs (or that you use \\ at the end of paragraphs in the text ...).

It uses also ragged2e and this package redefines \\ to actually produce paragraphs, and uses a hook to insert a \OmitIndent at the next paragraph begin. This hook now spills over to the enumerate.

\documentclass{article}
\usepackage{enumitem}
\setlist[1]{leftmargin=0.25in, itemindent=14pt}

\RequirePackage{ragged2e}
\RaggedRight


\begin{document}    
abc\\

\begin{enumerate}
\item a
\item b
\item c
\end{enumerate}

abc\\
abc

\begin{enumerate}
\item a
\item b
\item c
\end{enumerate}
\end{document}

enter image description here

If you can't remove the faulty \\ you can avoid the problem by clearing the hook before the enumerate:

\AddToHook{env/enumerate/before}{\ClearHookNext{para/begin}}

But it would better if the class is corrected as this can affect other places too.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .