LaTeX forum ⇒ Generalfirst entry of enumerate rendered off-page

LaTeX specific issues not fitting into one of the other forums of this category.
timsifive
Posts: 4
Joined: Fri Mar 15, 2019 11:24 pm

first entry of enumerate rendered off-page

Postby timsifive » Fri Mar 15, 2019 11:39 pm

I have an issue that I completely don't understand, where the first line of an enumerate goes missing. It's probably not quite that straightforward, because the start of the subsubsection itself already looks too low on the page to me. You can see the problem in https://github.com/riscv/riscv-debug-sp ... elease.pdf at the bottom of (numbered) page 14. I took a screenshot that shows the problem which you can view at http://www.casualhacker.net/tmp/enumera ... issing.png.

The source is autogenerated. I've attached the relevant file. The entire project is available at https://github.com/riscv/riscv-debug-spec/tree/release. If I had to make a minimal case it would look as follows, but I don't know how to make the alignment happen in a way to show the problem outside of the document itself:
\usepackage{enumitem}
\newenvironment{steps}[1]
{
\vspace{1ex}
\noindent #1
\begin{enumerate}[nolistsep]
}
{
\end{enumerate}
\vspace{1ex}
}

\begin{center}
\begin{longtable}{|l|p{0.5\textwidth}|}
\hline
Field & Description\\
\hline
\endhead
\multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\endlastfoot
...
\end{longtable}
\end{center}

\subsubsection{Quick Access}
\begin{steps}{Perform the following sequence of operations:}
\item If the hart is halted, the command sets \Fcmderr to ``halt/resume'' and does not continue.
\item Halt the hart. If the hart halts for some other reason (e.g. breakpoint), the command
sets \Fcmderr to ``halt/resume'' and does not continue.
...
\end{steps}


Can somebody point me in the right direction to solve this problem?

Thank you,
Tim
Attachments
abstract_commands.tex
(12.67 KiB) Downloaded 2 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 9323
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Mar 16, 2019 11:50 am

Hi Tim,

welcome to the forum!

Perhaps post the .log file here, as attachment. A warning in that file could point to the issue. Or post a a compilable version of the document, as attachment, even if it's not small. Downloading from github and figuring out how to compile etc. took too much time for me for now so a test was not possible.

Stefan
Site admin

timsifive
Posts: 4
Joined: Fri Mar 15, 2019 11:24 pm

Postby timsifive » Mon Mar 18, 2019 9:39 pm

Thanks, Stefan!

I've made the whole thing one big .tex file and cut out most of the unnecessary bits.

I've attached the .tex file, .log, console log, and the final pdf. You can see the problem on the page break between the penultimate and last pages of the pdf, where item number 1 is missing from the list.

I'm a pretty basic LaTeX user. Usually it does something reasonable, but in this case I have no idea how to even begin to troubleshoot this problem.

Tim
Attachments
typescript.txt
(19.5 KiB) Downloaded 1 time
riscv-debug-latex-issue.pdf
(139.77 KiB) Downloaded 1 time
riscv-debug-latex-issue.log
(33.78 KiB) Downloaded 1 time
riscv-debug-latex-issue.tex
(40.79 KiB) Downloaded 3 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 9323
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Tue Mar 19, 2019 4:03 pm

Hi Tim!

It may be because of the nolistsep option. You have it here two times:

  1. % Keep spacing normal in enumerated instead of adding extra space between
  2. % items.
  3. \usepackage{enumitem}
  4. \setlist{nolistsep}
  5.  
  6. \newenvironment{steps}[1]
  7. {
  8. \vspace{1ex}
  9. \noindent #1
  10. \begin{enumerate}[nolistsep]
  11. }
  12. {
  13. \end{enumerate}
  14. \vspace{1ex}
  15. }


You could replace it by noitemsep.

Stefan
Site admin

timsifive
Posts: 4
Joined: Fri Mar 15, 2019 11:24 pm

Postby timsifive » Tue Mar 19, 2019 7:37 pm

In my file that \setlist{nolistsep} is commented out.

Replacing nolistsep with noitemsep does fix the problem, but I don't want that. I want no separation between lines in the steps environment, but of course I never ever want anything rendered off the end of the page. Is there some other way to achieve that while still allowing page breaks where they should be?

Another thing that looks funny to me is how low on the page the subsubsection{Quick Access} starts. It already appears to be below the usual drawable area of the page. Could there be something about center/longtable that's causing trouble?

Thank you,
Tim

timsifive
Posts: 4
Joined: Fri Mar 15, 2019 11:24 pm

Postby timsifive » Wed Mar 20, 2019 8:48 pm

I found the cause of my problem. There's a bug in longtable (first reported in 2003!) that causes it to run text off the end of a page when floats end up on the same page. Bug and patch that fixes it are at https://www.latex-project.org/cgi-bin/l ... tools/3512

User avatar
Stefan Kottwitz
Site Admin
Posts: 9323
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Mar 20, 2019 10:13 pm

I guess that was not so easy to find out. Thank you for posting the solution you found!

Stefan
Site admin


Return to “General”

Who is online

Users browsing this forum: No registered users and 4 guests