-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tcolorbox 5.1.1 is incompatible with lineno package #183
Comments
A simplified example. It seems the culprits are \documentclass{article}
\usepackage{lineno,tcolorbox}
\tcbuselibrary{breakable}
\linenumbers
\begin{document}
before text
\par\nointerlineskip % simulate `before skip balanced`
\begin{tcolorbox}[breakable, nobeforeafter]
content
\end{tcolorbox}
after text
\end{document} Update: A further simplified example which is only relevant to \documentclass{article}
\usepackage{lineno}
\linenumbers
\begin{document}
before text
% excerpted from `before skip balanced`
\par\nointerlineskip
% excerpted from \tcb@prepare@break@operation
\noindent% applies parskip
\vskip\lineskip
content
after text
\end{document} Expected: three lines on first page |
A random and incomplete1 patch to \documentclass{article}
\usepackage{lineno, tcolorbox}
\tcbuselibrary{breakable}
\makeatletter
\def\@LN@depthbox{%
% \@tempdima is set to \prevdepth before
\ifdim\@tempdima>-1000pt\relax
\dp\@tempboxa=\@tempdima
\fi
\nointerlineskip
\ifdim\@tempdima>-1000pt\relax
\kern-\@tempdima
% \else % is this needed?
% \kern-\dp\@tempboxa
\fi
\box\@tempboxa}
\makeatother
\linenumbers
\begin{document}
before text
\par\nointerlineskip
\noindent
\vskip\lineskip
content
middle text
\begin{tcolorbox}[breakable]
content
\end{tcolorbox}
after text
\end{document} Footnotes
|
@muzimuzhi Thanks to your analysis this seems to be a |
I reported this at latex-lineno/lineno#3, but I am not sure if Karl Wette is able to do the repairs to |
Karl Wette has been a/the new maintainer of |
guarding against
but I have not looked very hard into the lineno so I may be wrong. But I think tcolorbox needs looking at as well. If I see, for example, this:
then |
Thank you for hinting me to that. I looked into it and I think it is applied only where it cannot not hurt (end of a page with no further content on that page). But I will keep that possible source of problems in mind. |
With https://github.com/T-F-S/tcolorbox/releases/tag/v6.0.0 the |
The problem persists for breakable \documentclass{article}
\usepackage{lineno}
\usepackage{tcolorbox}
\tcbuselibrary{breakable}
\linenumbers
\begin{document}
text before
\begin{tcolorbox}[breakable]
content
\end{tcolorbox}
text after
\end{document} That's because the same pattern is found as shown in the second example in #183 (comment). Applying Frank's patch in #183 (comment) solves the problem, hence it would be resolved by a new |
Should be fixed with |
The recent change (fixing #182) breaks if linenumbers are used. Re-enabling autoparskip fixes that, in other words the balanced parskip somehow interferes with lineno and everything breaks if there is a tcolorbox and linenumbers are active. This is a pity because up to now lineno and tcolorbox worked well together (and I made good use of that during copy-editing of TLC).
Here is an example from TLC cut down to show the problem:
All is fine as long as one sets autoparskip. If commented out the first page ends at line 11, the second overprints. (in case of the Companion sources it was worse and looped producing empty pages after pages)
The text was updated successfully, but these errors were encountered: