[latex3-commits] [git/LaTeX3-latex3-latex2e] master: add \nobreak to space hack for issue #81 (f0f93ca)

David Carlisle d.p.carlisle at gmail.com
Wed Oct 10 21:44:52 CEST 2018


Repository : https://github.com/latex3/latex2e
On branch  : master
Link       : https://github.com/latex3/latex2e/commit/f0f93ca895f11e5393f07b781895f23b65b26a6f

>---------------------------------------------------------------

commit f0f93ca895f11e5393f07b781895f23b65b26a6f
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Wed Oct 10 20:43:27 2018 +0100

    add \nobreak to space hack for issue #81


>---------------------------------------------------------------

f0f93ca895f11e5393f07b781895f23b65b26a6f
 base/changes.txt                |    4 ++++
 base/ltspace.dtx                |   35 ++++++++++++++++++++++++++++++-----
 base/testfiles/github-0081.lvt  |   29 +++++++++++++++++++++++++++++
 base/testfiles/github-0081.tlg  |   18 ++++++++++++++++++
 base/testfiles/github-0081b.lvt |   37 +++++++++++++++++++++++++++++++++++++
 base/testfiles/github-0081b.tlg |   18 ++++++++++++++++++
 6 files changed, 136 insertions(+), 5 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index c7b4fe6..c6591d2 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -4,6 +4,10 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2018-10-10  David Carlisle  <David.Carlisle at latex-project.org>
+
+	* ltspace.dtx: prevent space hacks adding breakpoints (githib 81)
+
 2018-10-05  David Carlisle  <David.Carlisle at latex-project.org>
 
 	* utf8ienc.dtx: Use hex in invalid byte error (suggested in  PR 82 from mirabilos)
diff --git a/base/ltspace.dtx b/base/ltspace.dtx
index c6020d0..6f212bb 100644
--- a/base/ltspace.dtx
+++ b/base/ltspace.dtx
@@ -32,7 +32,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltspace.dtx}
-             [2018/09/24 v1.3h LaTeX Kernel (spacing)]
+             [2018/10/10 v1.3i LaTeX Kernel (spacing)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltspace.dtx}
@@ -559,8 +559,8 @@
 % \changes{v1.3d}{2015/01/11}{Allow hyphenation (Donald Arseneau pr/3498) (latexrelease)}
 %    \begin{macrocode}
 %</2ekernel>
-%<latexrelease>\IncludeInRelease{2015/10/01}%
-%<latexrelease>                 {\@esphack}{hyphenation after space hack}%
+%<latexrelease>\IncludeInRelease{2018/10/10}%
+%<latexrelease>                 {\@esphack}{hyphenation and nobreak after space hack}%
 %<*2ekernel|latexrelease>
 \def\@esphack{%
   \relax
@@ -576,11 +576,36 @@
       \fi
       \ignorespaces
     \fi
+%    \end{macrocode}
+% \changes{v1.3i}{2018/10/10}
+%         {Don't introduce breakpoints if @nobreak is true and after sections}
+%    \begin{macrocode}
+  \else
+    \ifvmode
+      \if at nobreak\nobreak\else\if at noskipsec\nobreak\fi\fi
+    \fi
+%    \end{macrocode}
+%
+%    \begin{macrocode}
   \fi}%
 %</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{2015/10/01}%
+%<latexrelease>                 {\@esphack}{hyphenation and nobreak after space hack}%
+%<latexrelease>\def\@esphack{%
+%<latexrelease>  \relax
+%<latexrelease>  \ifhmode
+%<latexrelease>    \spacefactor\@savsf
+%<latexrelease>    \ifdim\@savsk>\z@
+%<latexrelease>      \ifdim\lastskip=\z@ 
+%<latexrelease>        \nobreak \hskip\z at skip
+%<latexrelease>      \fi
+%<latexrelease>      \ignorespaces
+%<latexrelease>    \fi
+%<latexrelease>  \fi}%
+%<latexrelease>\EndIncludeInRelease
 %<latexrelease>\IncludeInRelease{2015/01/01}%
-%<latexrelease>                 {\@esphack}{hyphenation after space hack}%
+%<latexrelease>                 {\@esphack}{hyphenation and nobreak after space hack}%
 %<latexrelease>\def\@esphack{%
 %<latexrelease>  \relax
 %<latexrelease>  \ifhmode
@@ -592,7 +617,7 @@
 %<latexrelease>  \fi}%
 %<latexrelease>\EndIncludeInRelease
 %<latexrelease>\IncludeInRelease{0000/00/00}%
-%<latexrelease>                 {\@esphack}{hyphenation after space hack}%
+%<latexrelease>                 {\@esphack}{hyphenation and nobreak after space hack}%
 %<latexrelease>\def\@esphack{%
 %<latexrelease>  \relax
 %<latexrelease>  \ifhmode
diff --git a/base/testfiles/github-0081.lvt b/base/testfiles/github-0081.lvt
new file mode 100644
index 0000000..ed564a3
--- /dev/null
+++ b/base/testfiles/github-0081.lvt
@@ -0,0 +1,29 @@
+\documentclass{article}
+
+\input{test2e}
+
+\begin{document}
+\section{Intro}
+
+aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa
+
+aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa
+
+aa\\aa\\aa\\aa\\aa\\aa\\aa\\aa\\aa\\aa\\aa
+
+aaa\\aaa\label{l1}
+
+\subsubsection{Test\label{l2}}
+\paragraph{Subsec\label{l3}}\label{subsec}
+zz\label{l4}\\zz
+
+\START
+\sbox0{\pageref{l1}-\pageref{l2}-\pageref{l3}-\pageref{l4}}
+
+% the page break should not be after a heading so not after  l2 or l3
+\showbox0
+
+\OMIT
+\clearpage
+\TIMO
+\end{document}
diff --git a/base/testfiles/github-0081.tlg b/base/testfiles/github-0081.tlg
new file mode 100644
index 0000000..a38dbb6
--- /dev/null
+++ b/base/testfiles/github-0081.tlg
@@ -0,0 +1,18 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+> \box...=
+\hbox(6.44444+0.0)x30.00005
+.\OT1/cmr/m/n/10 1
+.\hbox(0.0+0.0)x0.0
+.\OT1/cmr/m/n/10 -
+.\OT1/cmr/m/n/10 2
+.\hbox(0.0+0.0)x0.0
+.\OT1/cmr/m/n/10 -
+.\OT1/cmr/m/n/10 2
+.\hbox(0.0+0.0)x0.0
+.\OT1/cmr/m/n/10 -
+.\OT1/cmr/m/n/10 2
+.\hbox(0.0+0.0)x0.0
+! OK.
+l. ...\showbox0
+(github-0081.aux)
diff --git a/base/testfiles/github-0081b.lvt b/base/testfiles/github-0081b.lvt
new file mode 100644
index 0000000..88a7ee3
--- /dev/null
+++ b/base/testfiles/github-0081b.lvt
@@ -0,0 +1,37 @@
+\RequirePackage[2018/04/01]{latexrelease}
+\renewcommand\encodingdefault{OT1}% minimise diffs
+\fontencoding{\encodingdefault}
+\renewcommand\familydefault{cmr}% minimise diffs
+\fontfamily{\familydefault}
+
+\documentclass{article}
+
+\input{test2e}
+
+\begin{document}
+
+\section{Intro}
+
+aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa
+
+aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa\\aaa
+
+aa\\aa\\aa\\aa\\aa\\aa\\aa\\aa\\aa\\aa\\aa
+
+aaa\\aaa\label{l1}
+
+\subsubsection{Test\label{l2}}
+\paragraph{Subsec\label{l3}}\label{subsec}
+zz\label{l4}\\zz
+
+\START
+\sbox0{\pageref{l1}-\pageref{l2}-\pageref{l3}-\pageref{l4}}
+
+% the page break should not be after a heading so not after  l2 or l3
+% older releases break after l2
+\showbox0
+
+\OMIT
+\clearpage
+\TIMO
+\end{document}
diff --git a/base/testfiles/github-0081b.tlg b/base/testfiles/github-0081b.tlg
new file mode 100644
index 0000000..f41d993
--- /dev/null
+++ b/base/testfiles/github-0081b.tlg
@@ -0,0 +1,18 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+> \box...=
+\hbox(6.44444+0.0)x30.00005
+.\OT1/cmr/m/n/10 1
+.\hbox(0.0+0.0)x0.0
+.\OT1/cmr/m/n/10 -
+.\OT1/cmr/m/n/10 1
+.\hbox(0.0+0.0)x0.0
+.\OT1/cmr/m/n/10 -
+.\OT1/cmr/m/n/10 2
+.\hbox(0.0+0.0)x0.0
+.\OT1/cmr/m/n/10 -
+.\OT1/cmr/m/n/10 2
+.\hbox(0.0+0.0)x0.0
+! OK.
+l. ...\showbox0
+(github-0081b.aux)





More information about the latex3-commits mailing list