- Debugging.

- Move all \RequirePackages to commonincludes.def.
This commit is contained in:
2025-09-12 16:15:29 -05:00
parent 0e68ac723d
commit 029916b8d6
19 changed files with 209 additions and 243 deletions

View File

@@ -3,21 +3,6 @@
Custom Caption commands.
}
% \RequirePackage[
% hypcap=true,
% ]{caption}
% \captionsetup{
% justification = Centering,
% font = {
% small,
% color=caption,
% },
% }
% Define a justification style that is ragged on the side toward the outside of
% the page. I. e. RaggedRight on
%\RequirePackage{changepage}
\NewDocumentCommand{\RaggedOutside}{}{
\ifthenelse{\boolean{isElectronic}}{%
\RaggedRight%
@@ -31,7 +16,7 @@
}%
}
\cs_new:Nn \__MyCaption_format_default: {\centering\small\color{caption}}
\cs_new_protected:Nn \__MyCaption_format_default: {\Centering\small\color{caption}}
\keys_define:nn {MyCaption} {
before .bool_set:N = \l_MyCaption_before_bool,
@@ -40,9 +25,10 @@
figure .code:n = {\str_set:Nn \l_MyCaption_type_str {figure}},
format .cs_set_protected:Np = \__MyCaption_format:,
format .initial:n = {},%{\__MyCaption_format_default:},
format .initial:n = {},
format .default:n = {},
skip .tl_set:N = \l_MyCaption_skip_tl,
skip .dim_set:N = \l_MyCaption_skip_dim,
skip .initial:n = {\medskipamount},
table .code:n = {
@@ -66,8 +52,11 @@
>{\TrimSpaces}m
% #3: Caption
m
% #4: Body
+b
}{
\group_begin:
\keys_set:nn {MyCaption} {format}
\keys_set:nn {MyCaption} {#1}
\str_case:en {\l_MyCaption_type_str} {
{figure} {
@@ -76,7 +65,9 @@
\str_set:Ne \l_MyCaption_number_str {
\arabic{chapter}.\arabic{figure}
}
\addcontentsline{lof}{figure}{\protect\numberline{\l_MyCaption_number_str}\protect\ignorespaces~#3}
\addcontentsline{lof}{figure}{
\protect\numberline{\l_MyCaption_number_str}\protect\ignorespaces~#3
}
}
{table} {
\refstepcounter{table}
@@ -84,24 +75,28 @@
\str_set:Ne \l_MyCaption_number_str {
\arabic{chapter}.\arabic{table}
}
\addcontentsline{lot}{table}{\protect\numberline{\l_MyCaption_number_str}\protect\ignorespaces~#3}
\addcontentsline{lot}{table}{
\protect\numberline{\l_MyCaption_number_str}\protect\ignorespaces~#3
}
}
}
\bool_if:NT \l_MyCaption_before_bool {
\__MyCaption_insert_caption:nn {#2} {#3}
}
}{
\bool_if:NF \l_MyCaption_before_bool {
\__MyCaption_insert_caption:nn {#2} {#3}
\label{#2}
#4
}
\setlength{\parskip}{\l_MyCaption_skip_dim}
\par
\__MyCaption_format_default: \__MyCaption_format:
\l_MyCaption_label_str{}~\l_MyCaption_number_str :~#3
\par
\bool_if:NT \l_MyCaption_before_bool {
\label{#2}
#4
}
\group_end:
}
}{}
\cs_new:Nn \__MyCaption_insert_caption:nn {
\setlength{\parskip}{\l_MyCaption_skip_tl}\par
\__MyCaption_format_default: \__MyCaption_format:
\l_MyCaption_label_str{}~\l_MyCaption_number_str :~#2
\label{#1}
\par
\cs_new:Nn \__MyCaption_insert_caption:n {
\protect\__MyCaption_format_default: \protect\__MyCaption_format:
\l_MyCaption_label_str{}~\l_MyCaption_number_str :~#1
}