|
9 | 9 | % |
10 | 10 | % https://www.latex-project.org/lppl.txt |
11 | 11 | % |
12 | | -\def\ltlabblockdate{2026-01-26} |
13 | | -\def\ltlabblockversion{0.9m} |
| 12 | +\def\ltlabblockdate{2026-02-02} |
| 13 | +\def\ltlabblockversion{0.9n} |
14 | 14 |
|
15 | 15 | %<*driver> |
16 | 16 | \DocumentMetadata{tagging=on,pdfstandard=ua-2,lang=en} |
|
599 | 599 | % |
600 | 600 | % \TemplateKey{title}{tokenlist} |
601 | 601 | % {Heading for the environment unless overwritten on |
602 | | -% document level.}{Proof} |
| 602 | +% document level. The default value, i.e., |
| 603 | +% \cs{proofname} resolves to \enquote{Proof} |
| 604 | +% unless changed}{\cs{proofname}} |
603 | 605 | % \TemplateKey{punct}{tokenlist} |
604 | 606 | % {Punctuation following the heading.}{.} |
605 | 607 | % \TemplateKey{caption-placement}{choice} |
606 | 608 | % {Supported values |
607 | 609 | % \keyvalue{chained},\keyvalue{unchained}, and |
608 | 610 | % \keyvalue{standalone}}{unchained} |
| 611 | +% \TemplateKey{caption-unbreakable}{boolean} |
| 612 | +% {Can this caption have (implicit or explicit) line breaks?}{false} |
609 | 613 | % \TemplateKey{before-hspace}{skip} |
610 | 614 | % {Horizontal displacement of the heading.}{0pt} |
611 | 615 | % \TemplateKey{after-hspace}{skip} |
|
614 | 618 | % \TemplateKey{caption-decls}{tokenlist} |
615 | 619 | % {Declarations that are applied to the whole caption, |
616 | 620 | % e.g., some font settings.}{\meta{empty}} |
| 621 | +% \TemplateKey{title-decls}{tokenlist} |
| 622 | +% {Declarations that are applied only to the caption |
| 623 | +% title.}{\meta{empty}} |
| 624 | +% \TemplateKey{punct-decls}{tokenlist} |
| 625 | +% {Declarations that are applied only to the caption |
| 626 | +% punctuation.}{\meta{empty}} |
617 | 627 | % \TemplateKey{title-format}{function{1}} |
618 | 628 | % {Formatting applied to the \key{title} value.}{\#1} |
619 | 629 | % \TemplateKey{punct-format}{function{1}} |
|
649 | 659 | % {Supported values |
650 | 660 | % \keyvalue{chained},\keyvalue{unchained}, and |
651 | 661 | % \keyvalue{standalone}}{unchained} |
| 662 | +% \TemplateKey{caption-unbreakable}{boolean} |
| 663 | +% {Can this caption have (implicit or explicit) line breaks?}{false} |
652 | 664 | % \TemplateKey{before-hspace}{skip} |
653 | 665 | % {Horizontal displacement of the heading.}{0pt} |
654 | 666 | % \TemplateKey{after-hspace}{skip} |
|
657 | 669 | % \TemplateKey{order}{commalist} |
658 | 670 | % {Order of elements in the environment |
659 | 671 | % caption/heading. Supported values are \texttt{title}, |
660 | | -% \texttt{number}, \texttt{punct}, \texttt{space}, and \texttt{note}.}{title,space,number,space,note} |
661 | | -% \TemplateKey{caption-decls}{tokenlist} |
662 | | -% {Declarations that are applied to the whole caption, |
663 | | -% e.g., some font settings.}{\meta{empty}} |
| 672 | +% \texttt{number}, \texttt{punct}, \texttt{space}, and |
| 673 | +% \texttt{note}.}{title,space,number,space,note,punct} |
| 674 | +% \TemplateKey{title-decls}{tokenlist} |
| 675 | +% {Declarations that are applied only to the caption |
| 676 | +% title.}{\meta{empty}} |
| 677 | +% \TemplateKey{number-decls}{tokenlist} |
| 678 | +% {Declarations that are applied only to the caption |
| 679 | +% number.}{\meta{empty}} |
| 680 | +% \TemplateKey{punct-decls}{tokenlist} |
| 681 | +% {Declarations that are applied only to the caption |
| 682 | +% punctuation.}{\meta{empty}} |
| 683 | +% \TemplateKey{note-decls}{tokenlist} |
| 684 | +% {Declarations that are applied only to the caption |
| 685 | +% note.}{\meta{empty}} |
664 | 686 | % \TemplateKey{title-format}{function{1}} |
665 | 687 | % {Formatting applied to the \key{title} value.}{\#1} |
666 | 688 | % \TemplateKey{number-format}{function{1}} |
|
1897 | 1919 | % The main style used for many theorem-like environments, i.e., the |
1898 | 1920 | % one you get if no special \cs{theoremstyle} has been specified. |
1899 | 1921 | % |
| 1922 | +% \changes{v0.9n}{2026/02/01}{Change order of elements (tagging/1199)} |
| 1923 | +% \changes{v0.9n}{2026/02/01}{Add further decl keys (tagging/1199)} |
1900 | 1924 | % \begin{macrocode} |
1901 | 1925 | \DeclareInstance{thmstyle}{plain}{std} |
1902 | 1926 | { |
|
1906 | 1930 | ,punct = . |
1907 | 1931 | ,before-hspace = 0pt |
1908 | 1932 | ,after-hspace = 5pt plus 1pt minus 1pt |
1909 | | - ,order = {title, space, number, punct, space, note} |
| 1933 | + ,order = {title, space, number, space, note, punct} |
1910 | 1934 | ,caption-decls = \bfseries |
| 1935 | + ,title-decls = |
| 1936 | + ,number-decls = |
| 1937 | + ,punct-decls = |
| 1938 | + ,note-decls = |
1911 | 1939 | ,title-format = #1 |
1912 | 1940 | ,number-format = #1 |
1913 | 1941 | ,punct-format = #1 |
|
1924 | 1952 | \DeclareInstanceCopy{thmstyle}{remark}{plain} |
1925 | 1953 | \EditInstance{thmstyle}{remark} |
1926 | 1954 | { |
1927 | | - ,caption-decls = \itshape |
| 1955 | + ,title-decls = \itshape |
1928 | 1956 | ,body-decls = \normalfont |
1929 | 1957 | } |
1930 | 1958 | % \end{macrocode} |
|
2099 | 2127 | % proof because proofs are not numbered and the argument to a proof |
2100 | 2128 | % environment has a somewhat different semantic meaning than that |
2101 | 2129 | % of theorem-like environments. |
| 2130 | +% |
2102 | 2131 | % \begin{macrocode} |
2103 | 2132 | \DeclareInstance{captionedtext}{proof}{proof} |
2104 | 2133 | { |
2105 | | - ,title = Proof |
| 2134 | + ,title = \proofname % default value |
2106 | 2135 | ,punct = . |
2107 | 2136 | ,before-hspace = 0pt |
2108 | 2137 | ,after-hspace = 5pt plus 1pt minus 1pt |
|
3242 | 3271 | % any delegation and therefore shows several keys for customizing |
3243 | 3272 | % the layout (similar to those seen with \insttype{thmstyle} |
3244 | 3273 | % \instname{std}). |
| 3274 | +% \changes{v0.9n}{2026/02/01}{Add further decl keys (tagging/1199)} |
| 3275 | +% \changes{v0.9n}{2026/02/01}{Add caption-unbreakable key (tagging/1200)} |
| 3276 | +% \changes{v0.9n}{2026/02/02}{Use \cs{proofname} as value for title (tagging/1207)} |
3245 | 3277 | % \begin{macrocode} |
3246 | 3278 | \DeclareTemplateInterface{captionedtext}{proof}{4} |
3247 | 3279 | { |
3248 | | - ,title : tokenlist = Proof |
| 3280 | + ,title : tokenlist = \proofname |
3249 | 3281 | ,punct : tokenlist = . |
3250 | 3282 | ,caption-placement : choice {chained,unchained,standalone} = unchained |
| 3283 | + ,caption-unbreakable : boolean = false |
3251 | 3284 | ,before-hspace : skip = 0pt |
3252 | 3285 | ,after-hspace : skip = 5pt |
3253 | 3286 | ,caption-decls : tokenlist = |
| 3287 | + ,title-decls : tokenlist = |
| 3288 | + ,punct-decls : tokenlist = |
3254 | 3289 | ,title-format : function{1} = #1 |
3255 | 3290 | ,punct-format : function{1} = #1 |
3256 | 3291 | ,body-decls : tokenlist = |
3257 | 3292 | } |
3258 | 3293 | % \end{macrocode} |
3259 | 3294 | % \end{template} |
3260 | 3295 | % |
| 3296 | +% \begin{macro}{\proofname} |
| 3297 | +% The \pkg{amsthm} package supported redefinition of \cs{proofname} |
| 3298 | +% as a means to alter default caption for proofs. We continue to |
| 3299 | +% support this as long as the instance declaration doesn't |
| 3300 | +% overwrite it. |
| 3301 | +% \changes{v0.9n}{2026/02/02}{Macro \cs{proofname} added (tagging/1207)} |
| 3302 | +% \begin{macrocode} |
| 3303 | +\newcommand\proofname{Proof} |
| 3304 | +% \end{macrocode} |
| 3305 | +% \end{macro} |
3261 | 3306 | % |
3262 | 3307 | % |
3263 | 3308 | % |
3264 | 3309 | % |
3265 | 3310 | % \begin{template}{thmstyle std} |
3266 | 3311 | % |
| 3312 | +% \changes{v0.9n}{2026/02/01}{Add further decl keys (tagging/1199)} |
| 3313 | +% \changes{v0.9n}{2026/02/01}{Add caption-unbreakable key (tagging/1200)} |
3267 | 3314 | % \begin{macrocode} |
3268 | 3315 | \DeclareTemplateInterface{thmstyle}{std}{4} |
3269 | 3316 | { |
3270 | 3317 | ,numbered : boolean = true |
3271 | 3318 | ,space : tokenlist = \ % <- bad name? |
3272 | 3319 | ,punct : tokenlist = . |
3273 | 3320 | ,caption-placement : choice {chained,unchained,standalone} = unchained |
| 3321 | + ,caption-unbreakable : boolean = false |
3274 | 3322 | ,before-hspace : skip = 0pt |
3275 | 3323 | ,after-hspace : skip = 5pt |
3276 | 3324 | ,order : commalist = { title, space, number, punct, space, note } |
3277 | 3325 | ,caption-decls : tokenlist = |
| 3326 | + ,title-decls : tokenlist = |
| 3327 | + ,number-decls : tokenlist = |
| 3328 | + ,punct-decls : tokenlist = |
| 3329 | + ,note-decls : tokenlist = |
3278 | 3330 | ,title-format : function{1} = #1 |
3279 | 3331 | ,number-format : function{1} = #1 |
3280 | 3332 | ,punct-format : function{1} = #1 |
|
4167 | 4219 | % \begin{macrocode} |
4168 | 4220 | \legacy_if_gset_false:n { @inlabel } |
4169 | 4221 | \para_omit_indent: |
4170 | | - \box_use_drop:N \g_@@_labels_box |
| 4222 | + \bool_if:NTF \l_@@_caption_unbreakable_bool |
| 4223 | + \box_use_drop:N |
| 4224 | + \hbox_unpack_drop:N |
| 4225 | + \g_@@_labels_box |
4171 | 4226 | \__kernel_list_label_after:n { \PARALABEL } % <- change |
4172 | 4227 | % this name |
4173 | 4228 | \penalty \c_zero_int |
|
5084 | 5139 | % separation into two templates is that typically the same design |
5085 | 5140 | % is used for different theorem-like environments only differing in |
5086 | 5141 | % this fixed string. |
| 5142 | +% \changes{v0.9n}{2026/02/01}{Add further decl keys (tagging/1199)} |
5087 | 5143 | % \begin{macrocode} |
5088 | 5144 | \DeclareTemplateCode{thmstyle}{std}{4} |
5089 | 5145 | { |
|
5098 | 5154 | ,standalone = \bool_gset_true:N \g_@@_label_standalone_bool |
5099 | 5155 | \bool_gset_false:N \g_@@_label_unchained_bool |
5100 | 5156 | } |
| 5157 | + ,caption-unbreakable = \l_@@_caption_unbreakable_bool |
5101 | 5158 | ,before-hspace = \l_@@_caption_before_skip |
5102 | 5159 | ,after-hspace = \l_@@_caption_after_skip |
5103 | 5160 | ,order = \l_@@_order_clist |
5104 | 5161 | ,caption-decls = \l_@@_caption_decls_tl |
| 5162 | + ,title-decls = \l_@@_title_decls_tl |
| 5163 | + ,number-decls = \l_@@_number_decls_tl |
| 5164 | + ,punct-decls = \l_@@_punct_decls_tl |
| 5165 | + ,note-decls = \l_@@_note_decls_tl |
5105 | 5166 | ,title-format = \@@_title_format:n |
5106 | 5167 | ,number-format = \@@_number_format:n |
5107 | 5168 | ,punct-format = \@@_punct_format:n |
|
5282 | 5343 | \@@_insert_spaces: |
5283 | 5344 | % \end{macrocode} |
5284 | 5345 | % The title may have its own formatting: |
| 5346 | +% \changes{v0.9n}{2026/02/01}{Add decl key (tagging/1199)} |
5285 | 5347 | % \begin{macrocode} |
| 5348 | + \l_@@_title_decls_tl |
5286 | 5349 | \@@_title_format:n \l_@@_title_tl } |
5287 | 5350 | } |
5288 | 5351 | } |
|
5292 | 5355 | % |
5293 | 5356 | % \begin{macro}{\@@_do_note:} |
5294 | 5357 | % Formatting of a note (if present) uses the same structure. |
| 5358 | +% \changes{v0.9n}{2026/02/01}{Add decl key (tagging/1199)} |
5295 | 5359 | % \begin{macrocode} |
5296 | 5360 | \cs_new_protected:Npn \@@_do_note: { |
5297 | 5361 | \tl_if_novalue:oTF \l_@@_note_tl |
5298 | 5362 | { \@@_drop_spaces: } |
5299 | 5363 | { \tag_socket_use:nnn {mc} {} { |
5300 | 5364 | \@@_insert_spaces: |
| 5365 | + \l_@@_note_decls_tl |
5301 | 5366 | \@@_note_format:n \l_@@_note_tl } |
5302 | 5367 | } |
5303 | 5368 | } |
|
5308 | 5373 | % \begin{macro}{\@@_do_number:} |
5309 | 5374 | % The number (if present) has a similar formatting but it uses an |
5310 | 5375 | % \UseStructureName{block/theorem-like/label} structure: |
| 5376 | +% \changes{v0.9n}{2026/02/01}{Add decl key (tagging/1199)} |
5311 | 5377 | % \begin{macrocode} |
5312 | 5378 | \cs_new_protected:Npn \@@_do_number: { |
5313 | 5379 | \bool_if:NTF \l_@@_numbered_bool |
5314 | 5380 | { \tag_socket_use:nnn {struct-mc} {tag=\UseStructureName{block/theorem-like/label}} |
5315 | 5381 | { \@@_insert_spaces: |
| 5382 | + \l_@@_number_decls_tl |
5316 | 5383 | \@@_number_format:n { |
5317 | 5384 | \use:c{ the \l_@@_counter_tl } } |
5318 | 5385 | } |
|
5326 | 5393 | % \begin{macro}{\@@_do_punct:} |
5327 | 5394 | % The punctuation is handled slightly differently. It unconditionally drops any |
5328 | 5395 | % dangling spaces whether or not it is empty: |
| 5396 | +% \changes{v0.9n}{2026/02/01}{Add decl key (tagging/1199)} |
5329 | 5397 | % \begin{macrocode} |
5330 | 5398 | \cs_new_protected:Npn \@@_do_punct: { |
5331 | 5399 | \@@_drop_spaces: |
5332 | 5400 | \tl_if_empty:NF \l_@@_punct_tl |
5333 | 5401 | { \tag_socket_use:nnn {mc} {}{ |
| 5402 | + \l_@@_punct_decls_tl |
5334 | 5403 | \@@_punct_format:n \l_@@_punct_tl } |
5335 | 5404 | } |
5336 | 5405 | } |
|
5386 | 5455 | % |
5387 | 5456 | % \begin{template}{captionedtext proof} |
5388 | 5457 | % In case of the templates for proofs we do everything in a single template. |
| 5458 | +% \changes{v0.9n}{2026/02/01}{Add further decl keys (tagging/1199)} |
| 5459 | +% \changes{v0.9n}{2026/02/01}{Add caption-unbreakable key (tagging/1200)} |
5389 | 5460 | % \begin{macrocode} |
5390 | 5461 | \DeclareTemplateCode{captionedtext}{proof}{4} |
5391 | 5462 | { |
5392 | | - ,title = \l_@@_title_tl |
5393 | | - ,punct = \l_@@_punct_tl |
| 5463 | + ,title = \l_@@_title_tl |
| 5464 | + ,punct = \l_@@_punct_tl |
5394 | 5465 | ,caption-placement = { |
5395 | 5466 | chained = \bool_gset_false:N \g_@@_label_standalone_bool |
5396 | 5467 | \bool_gset_false:N \g_@@_label_unchained_bool |
|
5399 | 5470 | ,standalone = \bool_gset_true:N \g_@@_label_standalone_bool |
5400 | 5471 | \bool_gset_false:N \g_@@_label_unchained_bool |
5401 | 5472 | } |
5402 | | - ,before-hspace = \l_@@_caption_before_skip |
5403 | | - ,after-hspace = \l_@@_caption_after_skip |
5404 | | - ,caption-decls = \l_@@_caption_decls_tl |
5405 | | - ,title-format = \@@_title_format:n |
5406 | | - ,punct-format = \@@_punct_format:n |
5407 | | - ,body-decls = \l_@@_body_decls_tl |
| 5473 | + ,caption-unbreakable = \l_@@_caption_unbreakable_bool |
| 5474 | + ,before-hspace = \l_@@_caption_before_skip |
| 5475 | + ,after-hspace = \l_@@_caption_after_skip |
| 5476 | + ,caption-decls = \l_@@_caption_decls_tl |
| 5477 | + ,title-decls = \l_@@_title_decls_tl |
| 5478 | + ,punct-decls = \l_@@_punct_decls_tl |
| 5479 | + ,title-format = \@@_title_format:n |
| 5480 | + ,punct-format = \@@_punct_format:n |
| 5481 | + ,body-decls = \l_@@_body_decls_tl |
5408 | 5482 | } |
5409 | 5483 | { |
5410 | 5484 | % \end{macrocode} |
|
5448 | 5522 | % \end{macrocode} |
5449 | 5523 | % The remaining code is identical to the one in \insttype{thmstyle} |
5450 | 5524 | % \instname{std}; for documentation see there: |
| 5525 | +% \changes{v0.9n}{2026/02/01}{Allow caption to break by default (tagging/1200)} |
5451 | 5526 | % \begin{macrocode} |
5452 | 5527 | \bool_if:NTF \g_@@_label_standalone_bool |
5453 | 5528 | { |
5454 | 5529 | \bool_gset_true:N \g_@@_label_standalone_bool |
5455 | 5530 | \para_omit_indent: |
5456 | | - \box_use_drop:N \g_@@_labels_box |
| 5531 | + \bool_if:NTF \l_@@_caption_unbreakable_bool |
| 5532 | + \box_use_drop:N |
| 5533 | + \hbox_unpack_drop:N |
| 5534 | + \g_@@_labels_box |
5457 | 5535 | \par |
5458 | 5536 | } |
5459 | 5537 | { |
|
6679 | 6757 | \cs_set_protected:Npn \newtheoremstyle #1#2#3#4#5#6#7#8#9 { |
6680 | 6758 | % \end{macrocode} |
6681 | 6759 | % First we build a \insttype{thmstyle} instance: |
| 6760 | +% \changes{v0.9n}{2026/02/01}{Argument applied to the wrong keys (tagging/1202)} |
6682 | 6761 | % \begin{macrocode} |
6683 | 6762 | \DeclareInstance{thmstyle}{#1}{std}{ |
6684 | | - ,caption-decls = {#4} |
| 6763 | + ,caption-decls = {#6} |
6685 | 6764 | ,before-hspace:e = \tl_if_empty:nTF{#5}{0pt}{#5} |
6686 | | - ,body-decls = {#6} |
| 6765 | + ,body-decls = {#4} |
6687 | 6766 | ,punct = {#7} |
6688 | 6767 | % \end{macrocode} |
6689 | 6768 | % This setting doesn't cover all syntax possibilities. |
|
6773 | 6852 | % also not documented---see the \pkg{amsthm} package for |
6774 | 6853 | % documentation for now). |
6775 | 6854 | % |
| 6855 | +% \changes{v0.9n}{2026/02/01}{Stray definition of \cs{math@qedhere} removed (taggging/1203)} |
6776 | 6856 | % \begin{macrocode} |
6777 | 6857 | \ExplSyntaxOff |
6778 | 6858 | \def\math@qedhere{% |
|
6833 | 6913 | \expandafter\let\csname align*@qed\endcsname\align@qed |
6834 | 6914 | \expandafter\let\csname gather*@qed\endcsname\align@qed |
6835 | 6915 | % |
6836 | | - \def\math@qedhere{\quad\hbox{\qedsymbol}}% |
6837 | | - % |
6838 | 6916 | \DeclareRobustCommand{\qed}{% |
6839 | 6917 | \ifmmode \mathqed |
6840 | 6918 | \else |
|
0 commit comments