summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3coffins.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3coffins.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3coffins.dtx59
1 files changed, 33 insertions, 26 deletions
diff --git a/macros/latex/contrib/l3kernel/l3coffins.dtx b/macros/latex/contrib/l3kernel/l3coffins.dtx
index f4d6810d9a..220fe5564a 100644
--- a/macros/latex/contrib/l3kernel/l3coffins.dtx
+++ b/macros/latex/contrib/l3kernel/l3coffins.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-12-03}
+% \date{Released 2020-12-05}
%
% \maketitle
%
@@ -715,10 +715,13 @@
}
\cs_new_protected:Npx \@@_set_vertical_aux:
{
- \cs_if_exist:NT \linewidth
- { \dim_set_eq:NN \linewidth \tex_hsize:D }
- \cs_if_exist:NT \columnwidth
- { \dim_set_eq:NN \columnwidth \tex_hsize:D }
+ \bool_lazy_and:nnT
+ { \cs_if_exist_p:N \fmtname }
+ { \str_if_eq_p:Vn \fmtname { LaTeX2e } }
+ {
+ \dim_set_eq:NN \exp_not:N \linewidth \tex_hsize:D
+ \dim_set_eq:NN \exp_not:N \columnwidth \tex_hsize:D
+ }
}
% \end{macrocode}
% \end{macro}
@@ -2235,35 +2238,40 @@
% Stores the settings used to print coffin data: this keeps things
% flexible.
% \begin{macrocode}
-\tl_new:N \l_@@_display_font_tl
-\cs_if_exist:NTF \AtBeginDocument
- { \AtBeginDocument }
- { \use:n }
+\tl_new:N \l_@@_display_font_tl
+\bool_lazy_and:nnT
+ { \cs_if_exist_p:N \fmtname }
+ { \str_if_eq_p:Vn \fmtname { LaTeX2e } }
{
- \__kernel_tl_set:Nx \l_@@_display_font_tl
- {
- \cs_if_exist:NT \sffamily { \exp_not:N \sffamily }
- \cs_if_exist:NT \tiny { \exp_not:N \tiny }
- }
+ \tl_set:Nn \l_@@_display_font_tl
+ { \sffamily \tiny }
}
% \end{macrocode}
% \end{variable}
%
% \begin{macro}{\@@_color:n}
% Calls \tn{color}, and otherwise does nothing if \tn{color} is not defined.
+% As this is relatively rarely used, we have it self-define rather than delay
+% using a hook.
% \begin{macrocode}
-\cs_if_exist:NTF \AtBeginDocument
- { \AtBeginDocument }
- { \use:n }
+\cs_new_protected:Npn \@@_color:n #1 {#1}
+\bool_lazy_and:nnT
+ { \cs_if_exist_p:N \fmtname }
+ { \str_if_eq_p:Vn \fmtname { LaTeX2e } }
{
- \cs_new_protected:Npx \@@_color:n #1
+ \cs_gset_protected:Npn \@@_color:n
{
- \cs_if_exist:NTF \color_select:n
- { \color_select:n {#1} }
+ \cs_gset_protected:Npx \@@_color:n
{
- \cs_if_exist:NT \color
- { \exp_not:N \color {#1} }
+ \cs_if_exist:NTF \color_select:n
+ { \color_select:n }
+ {
+ \cs_if_exist:NTF \color
+ { \exp_not:N \color }
+ { \exp_not:N \use_none:n }
+ }
}
+ \@@_color:n
}
}
% \end{macrocode}
@@ -2272,11 +2280,10 @@
% \begin{macro}{\@@_rule:nn}
% Abstract out creation of rules here until there is a higher-level interface.
% \begin{macrocode}
-\cs_new_protected:Npx \@@_rule:nn #1#2
+\cs_new_protected:Npn \@@_rule:nn #1#2
{
- \cs_if_exist:NTF \rule
- { \exp_not:N \rule {#1} {#2} }
- { \hbox:n { \tex_vrule:D width #1 height #2 \scan_stop: } }
+ \mode_leave_vertical:
+ \hbox:n { \tex_vrule:D width #1 height #2 \scan_stop: }
}
% \end{macrocode}
% \end{macro}