diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3doc.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3doc.cls | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls index 3247d6f568c..f796c9937a9 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls +++ b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls @@ -57,6 +57,8 @@ \bool_new:N \g__codedoc_checkfunc_bool \bool_new:N \g__codedoc_checktest_bool \bool_new:N \g__codedoc_kernel_bool +\bool_new:N \g__codedoc_cs_break_bool +\bool_gset_true:N \g__codedoc_cs_break_bool \tl_new:N \l__codedoc_tmpa_tl \tl_new:N \l__codedoc_tmpb_tl \int_new:N \l__codedoc_tmpa_int @@ -416,6 +418,10 @@ { \bool_gset_false:N \g__codedoc_lmodern_bool } \DeclareOption { lm-default } { \bool_gset_true:N \g__codedoc_lmodern_bool } +\DeclareOption { cs-break-off } + { \bool_gset_false:N \g__codedoc_cs_break_bool } +\DeclareOption { cs-break-nohyphen } + { \PassOptionsToPackage{nohyphen}{underscore} } \DeclareOption* { \PassOptionsToClass { \CurrentOption } { article } } \ExecuteOptions { full, kernel, nocheck, nochecktest, lm-default } \PassOptionsToClass { a4paper } { article } @@ -446,9 +452,9 @@ pifont, textcomp, trace, - underscore, csquotes, fancyvrb, + underscore, verbatim } \raggedbottom @@ -686,18 +692,23 @@ \tl_replace_all:Nno \l__codedoc_cmd_tl { _ } \l__codedoc_tmpb_tl } \mode_if_math:T { \mbox } - { - \verbatim@font - \__codedoc_if_almost_str:VT \l__codedoc_cmd_tl - { - \tl_set:Nx \l__codedoc_cmd_tl { \tl_to_str:N \l__codedoc_cmd_tl } - \tl_replace_all:Non \l__codedoc_cmd_tl - { \token_to_str:N _ } { \_ } - } - \tl_replace_all:Nnn \l__codedoc_cmd_tl { ~ } { \@xobeysp } - \l__codedoc_cmd_tl - \@ - } + { + \verbatim@font + \__codedoc_if_almost_str:VT \l__codedoc_cmd_tl + { + \tl_set:Nx \l__codedoc_cmd_tl { \tl_to_str:N \l__codedoc_cmd_tl } + \bool_if:NT \g__codedoc_cs_break_bool + { + \regex_replace_all:nnN + {([^\\])_([^\_])} + {\1\c{BreakableUnderscore}\2} + \l__codedoc_cmd_tl + } + } + \tl_replace_all:Nnn \l__codedoc_cmd_tl { ~ } { \@xobeysp } + \l__codedoc_cmd_tl + \@ + } \bool_if:NF \l__codedoc_cmd_noindex_bool { \quark_if_no_value:NF \l__codedoc_cmd_index_tl |