[latex3-commits] [git/LaTeX3-latex3-latex2e] gh404: Fix blunder in \textnonbreakinghyphen (f28c3d9b)

Frank Mittelbach frank.mittelbach at latex-project.org
Sat Feb 20 10:27:01 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh404
Link       : https://github.com/latex3/latex2e/commit/f28c3d9be5a24b79bdecdebff9b43e8a42853abf

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

commit f28c3d9be5a24b79bdecdebff9b43e8a42853abf
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Sat Feb 20 10:27:01 2021 +0100

    Fix blunder in \textnonbreakinghyphen


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

f28c3d9be5a24b79bdecdebff9b43e8a42853abf
 base/ltoutenc.dtx | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/base/ltoutenc.dtx b/base/ltoutenc.dtx
index bd8ace65..73146428 100644
--- a/base/ltoutenc.dtx
+++ b/base/ltoutenc.dtx
@@ -1718,10 +1718,12 @@
 \DeclareTextSymbol{\textendash}{OT1}{123}
 %    \end{macrocode}
 %    
+%    The \verb=\nobreak\hskip\z@= is there to prevent a break after
+%    the hyphen but allow later breaks in the remainder of the word. 
 % \changes{v2.0u}{2021/02/19}{Add \cs{textnonbreakinghyphen}, \cs{textfiguredash}
 %      and \cs{texthorizontalbar} (gh/404)}
 %    \begin{macrocode}
-\DeclareTextCommand{\textnonbreakinghyphen}{OT1}{\mbox{-}\hskip\z@}
+\DeclareTextCommand{\textnonbreakinghyphen}{OT1}{\mbox{-}\nobreak\hskip\z@}
 \DeclareTextCommand{\textfiguredash}       {OT1}{\textendash}
 \DeclareTextCommand{\texthorizontalbar}    {OT1}{\textemdash}
 %    \end{macrocode}
@@ -2056,10 +2058,12 @@
 \DeclareTextSymbol{\textendash}{T1}{21}
 %    \end{macrocode}
 %
+%    The \verb=\nobreak\hskip\z@= is there to prevent a break after
+%    the hyphen but allow later breaks in the remainder of the word. 
 % \changes{v2.0u}{2021/02/19}{Add \cs{textnonbreakinghyphen}, \cs{textfiguredash}
 %      and \cs{texthorizontalbar} (gh/404)}
 %    \begin{macrocode}
-\DeclareTextCommand{\textnonbreakinghyphen}{T1}{\mbox{-}\hskip\z@}
+\DeclareTextCommand{\textnonbreakinghyphen}{T1}{\mbox{-}\nobreak\hskip\z@}
 \DeclareTextCommand{\textfiguredash}       {T1}{\textendash}
 \DeclareTextCommand{\texthorizontalbar}    {T1}{\textemdash}
 %    \end{macrocode}
@@ -3164,9 +3168,12 @@
 %    \texttt{"2015} (including the \LaTeX{} default fonts for Unicode
 %    engines) so we provide some approximations if the glyph is
 %    missing, like we do for \texttt{OT1} and \texttt{T1}.
+%
+%    The \verb=\nobreak\hskip\z@= is there to prevent a break after
+%    the hyphen but allow later breaks in the remainder of the word. 
 %    \begin{macrocode}
 \DeclareTextCommand{\textnonbreakinghyphen} \UnicodeEncodingName
-     {\iffontchar\font "2011 \char "2011 \else \mbox{-}\hskip\z@ \fi}
+     {\iffontchar\font "2011 \char "2011 \else \mbox{-}\nobreak\hskip\z@ \fi}
 \DeclareTextCommand{\textfiguredash}     \UnicodeEncodingName
      {\iffontchar\font "2012 \char "2012 \else \char "2013 \fi}
 \DeclareTextCommand{\texthorizontalbar}     \UnicodeEncodingName





More information about the latex3-commits mailing list.