[latex3-commits] [git/LaTeX3-latex3-latex3] master: l3doc adjust \cs{} linebreaking (fd8c535)

Will Robertson will at wspr.io
Wed Sep 12 02:41:09 CEST 2018


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

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

commit fd8c5353a78506b656e05a0d67a52ab1425f7726
Author: Will Robertson <will at wspr.io>
Date:   Wed Sep 12 10:11:09 2018 +0930

    l3doc adjust \cs{} linebreaking
    
    \_ allows hyphenation but inserts a hyphen. this update keeps the linebreak and omits the hyphen.
    
    closes #479


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

fd8c5353a78506b656e05a0d67a52ab1425f7726
 l3kernel/l3doc.dtx |   31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index b1f0a63..78a3ead 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -1933,19 +1933,26 @@ and all files in that bundle must be distributed together.
         \@@_replace_at_at:N \l_@@_cmd_tl
         \tl_replace_all:Nno \l_@@_cmd_tl { _ } \l_@@_tmpb_tl
       }
+%    \end{macrocode}
+% \paragraph{Typesetting}
+% Note the replacement for the underscore is to permit linebreaks (while also omitting the hyphen).
+%    \begin{macrocode}
     \mode_if_math:T { \mbox }
-    {
-      \verbatim at font
-      \@@_if_almost_str:VT \l_@@_cmd_tl
-        {
-          \tl_set:Nx \l_@@_cmd_tl { \tl_to_str:N \l_@@_cmd_tl }
-          \tl_replace_all:Non \l_@@_cmd_tl
-            { \token_to_str:N _ } { \_ }
-        }
-      \tl_replace_all:Nnn \l_@@_cmd_tl { ~ } { \@xobeysp }
-      \l_@@_cmd_tl
-      \@
-    }
+      {
+        \verbatim at font
+        \@@_if_almost_str:VT \l_@@_cmd_tl
+          {
+            \tl_set:Nx \l_@@_cmd_tl { \tl_to_str:N \l_@@_cmd_tl }
+            \tl_replace_all:Non \l_@@_cmd_tl
+              { \token_to_str:N _ } { \textunderscore\discretionary{}{}{} }
+          }
+        \tl_replace_all:Nnn \l_@@_cmd_tl { ~ } { \@xobeysp }
+        \l_@@_cmd_tl
+        \@
+      }
+%    \end{macrocode}
+% \paragraph{Indexing}
+%    \begin{macrocode}
     \bool_if:NF \l_@@_cmd_noindex_bool
       {
         \quark_if_no_value:NF \l_@@_cmd_index_tl





More information about the latex3-commits mailing list