Try to use l3keys.
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
\ProvidesFile{commonincludes.def}[2025-09-02 v1.0]
|
||||||
|
|
||||||
\RequirePackage{PrimeTeX/packages/Boxout}
|
\RequirePackage{PrimeTeX/packages/Boxout}
|
||||||
|
|
||||||
\RequirePackage{PrimeTeX/packages/Caption}
|
\RequirePackage{PrimeTeX/packages/Caption}
|
||||||
|
|||||||
42
geometry.def
42
geometry.def
@@ -1,42 +0,0 @@
|
|||||||
\ifthenelse{\boolean{isElectronic}}{
|
|
||||||
\newgeometry{
|
|
||||||
inner = 0.75in,
|
|
||||||
top = 66pt, % 11/12in
|
|
||||||
marginratio = 2:3,
|
|
||||||
}
|
|
||||||
\savegeometry{smallMargin}
|
|
||||||
\newgeometry{
|
|
||||||
inner = 24pt, % 1/3in
|
|
||||||
top = 0.25in,
|
|
||||||
marginratio = 2:3,
|
|
||||||
}
|
|
||||||
\savegeometry{tinyMargin}
|
|
||||||
}{
|
|
||||||
\newgeometry{
|
|
||||||
twoside = true,
|
|
||||||
inner = 0.75in,
|
|
||||||
top = 66pt, % 11/12in
|
|
||||||
marginratio = 2:3,
|
|
||||||
}
|
|
||||||
\savegeometry{smallMargin}
|
|
||||||
\newgeometry{
|
|
||||||
twoside = true,
|
|
||||||
inner = 24pt, % 1/3in
|
|
||||||
top = 0.25in,
|
|
||||||
marginratio = 2:3,
|
|
||||||
}
|
|
||||||
\savegeometry{tinyMargin}
|
|
||||||
}
|
|
||||||
\restoregeometry
|
|
||||||
|
|
||||||
\NewDocumentEnvironment{SmallMargin}{O{0.0in} O{-0.25in}}{
|
|
||||||
\clearpage
|
|
||||||
\loadgeometry{smallMargin}
|
|
||||||
\setlength{\insideheaderoffset}{#1}
|
|
||||||
\setlength{\outsideheaderoffset}{#2}
|
|
||||||
\pagestyle{fancy}
|
|
||||||
}{
|
|
||||||
\clearpage
|
|
||||||
\pagestyle{fancy}
|
|
||||||
\restoregeometry
|
|
||||||
}
|
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
\RequirePackage{PrimeTeX/packages/Tables}
|
\RequirePackage{PrimeTeX/packages/Tables}
|
||||||
\RequirePackage{calc}
|
\RequirePackage{calc}
|
||||||
|
|
||||||
\providelength{\boxoutpadding}[1em]
|
\ProvideLength{\boxoutpadding}[1em]
|
||||||
\providelength{\boxoutrule}[1pt]
|
\ProvideLength{\boxoutrule}[1pt]
|
||||||
|
|
||||||
\NewTblrEnviron{tblrBoxout}
|
\NewTblrEnviron{tblrBoxout}
|
||||||
\SetTblrInner[tblrBoxout]{
|
\SetTblrInner[tblrBoxout]{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
% Define a justification style that is ragged on the side toward the outside of
|
% Define a justification style that is ragged on the side toward the outside of
|
||||||
% the page. I. e. RaggedRight on
|
% the page. I. e. RaggedRight on
|
||||||
\RequirePackage{changepage}
|
\RequirePackage{changepage}
|
||||||
%\RequirePackage{ifthen}
|
|
||||||
\DeclareCaptionJustification{RaggedOutside}{%
|
\DeclareCaptionJustification{RaggedOutside}{%
|
||||||
\ifthenelse{\boolean{isElectronic}}{%
|
\ifthenelse{\boolean{isElectronic}}{%
|
||||||
\RaggedRight%
|
\RaggedRight%
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
\RequirePackage{xcolor}
|
\RequirePackage{xcolor}
|
||||||
|
|
||||||
\definecolorset{HTML}{Prime}{}{%
|
\definecolorset{HTML}{Prime}{}{%
|
||||||
Gray, 474c63;% #474c63 Blue, saturation -> 17%
|
Gray, 4d505d;% #4d505d Blue, saturation -> 10%
|
||||||
Red, 91192d;% #91192d Tetradic
|
Red, 91192d;% #91192d Tetradic
|
||||||
Orange, 914119;% #914119 Split complementary
|
Orange, 914119;% #914119 Split complementary
|
||||||
Yellow, 917d19;% #917d19 Complementary
|
Yellow, 917d19;% #917d19 Complementary
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
% Lightness ≈ 18%
|
% Lightness ≈ 18%
|
||||||
\definecolorset{HTML}{PrimeDark}{}{%
|
\definecolorset{HTML}{PrimeDark}{}{%
|
||||||
Gray, 262836;% #262836
|
Gray, 292b32;% #292b32
|
||||||
Red, 4e0d18;% #4e0d18
|
Red, 4e0d18;% #4e0d18
|
||||||
Orange, 4e230d;% #4e230d
|
Orange, 4e230d;% #4e230d
|
||||||
Yellow, 4e430d;% #4e430d
|
Yellow, 4e430d;% #4e430d
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
% Lightness ≈ 49%
|
% Lightness ≈ 49%
|
||||||
\definecolorset{HTML}{PrimeBright}{}{%
|
\definecolorset{HTML}{PrimeBright}{}{%
|
||||||
Gray, 686f91;% #686f91
|
Gray, 727587;% #727587
|
||||||
Red, d42542;% #d42542
|
Red, d42542;% #d42542
|
||||||
Orange, d46025;% #d46025
|
Orange, d46025;% #d46025
|
||||||
Yellow, d4b725;% #d4b725
|
Yellow, d4b725;% #d4b725
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
% Lightness ≈ 64%
|
% Lightness ≈ 64%
|
||||||
\definecolorset{HTML}{PrimeLight}{}{%
|
\definecolorset{HTML}{PrimeLight}{}{%
|
||||||
Gray, 9499b3;% #9499b3
|
Gray, 9b9eac;% #9b9eac
|
||||||
Red, e46378;% #e46378
|
Red, e46378;% #e46378
|
||||||
Orange, e48f63;% #e48f63
|
Orange, e48f63;% #e48f63
|
||||||
Yellow, e4d063;% #e4d063
|
Yellow, e4d063;% #e4d063
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
% Lightness ≈ 64%
|
% Lightness ≈ 64%
|
||||||
\definecolorset{HTML}{PrimePastel}{}{%
|
\definecolorset{HTML}{PrimePastel}{}{%
|
||||||
Gray, c2c5d4;% #c2c5d4
|
Gray, c6c8d0;% #c6c8d0
|
||||||
Red, f0a6b2;% #f0a6b2
|
Red, f0a6b2;% #f0a6b2
|
||||||
Orange, f0bfa6;% #f0bfa6
|
Orange, f0bfa6;% #f0bfa6
|
||||||
Yellow, f0e4a6;% #f0e4a6
|
Yellow, f0e4a6;% #f0e4a6
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
% Lightness ≈ 95%
|
% Lightness ≈ 95%
|
||||||
\definecolorset{HTML}{PrimePale}{}{%
|
\definecolorset{HTML}{PrimePale}{}{%
|
||||||
Gray, eff0f5;% #eff0f5
|
Gray, f0f1f4;% #eff0f5
|
||||||
Red, fbe9ec;% #fbe9ec
|
Red, fbe9ec;% #fbe9ec
|
||||||
Orange, fbefe9;% #fbefe9
|
Orange, fbefe9;% #fbefe9
|
||||||
Yellow, fbf8e9;% #fbf8e9
|
Yellow, fbf8e9;% #fbf8e9
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
\RequirePackage{wrapfig2}
|
\RequirePackage{wrapfig2}
|
||||||
|
|
||||||
\providelength{\iconsize}[0.25in]
|
\ProvideLength{\iconsize}[0.25in]
|
||||||
|
|
||||||
\providelength{\@InlineGraphicHeight}[12pt]
|
\ProvideLength{\@InlineGraphicHeight}[12pt]
|
||||||
\providelength{\@InlineGraphicOffset}[-2pt]
|
\ProvideLength{\@InlineGraphicOffset}[-2pt]
|
||||||
|
|
||||||
\NewDocumentCommand{\InlineGraphic}{
|
\NewDocumentCommand{\InlineGraphic}{
|
||||||
O{\@InlineGraphicHeight}
|
O{\@InlineGraphicHeight}
|
||||||
@@ -89,34 +89,95 @@
|
|||||||
|
|
||||||
\RequirePackage{tabularray}
|
\RequirePackage{tabularray}
|
||||||
|
|
||||||
\providelength{\twinfigspace}[3pt]
|
\ProvideLength{\twinfigspace}[3pt]
|
||||||
\providelength{\twinfigwidth}[
|
\ProvideLength{\twinfigwidth}[
|
||||||
\textwidth / 2 + \bigfloatoverhang - \twinfigspace
|
\textwidth / 2 + \bigfloatoverhang * 3 / 2 - \twinfigspace
|
||||||
]
|
]
|
||||||
|
|
||||||
|
\ExplSyntaxOn
|
||||||
|
|
||||||
|
\dim_new:N \l_twinfig_overhang
|
||||||
|
\dim_new:N \l_twinfig_width
|
||||||
|
\dim_new:N \l_twinfig_space
|
||||||
|
\fp_new:N \l_twinfig_offset
|
||||||
|
\str_new:N \l_twinfig_placement
|
||||||
|
\str_new:N \l_twinfig_valign
|
||||||
|
|
||||||
|
\keys_define:nn{twinfig}{
|
||||||
|
overhang .dim_set:N = \l_twinfig_overhang,
|
||||||
|
overhang .initial:e = \bigfloatoverhang,
|
||||||
|
}
|
||||||
|
\keys_define:nn{twinfig}{
|
||||||
|
placement .str_set:N = \l_twinfig_placement,
|
||||||
|
placement .initial:n = {htpb},%\bigfloatplacement,
|
||||||
|
}
|
||||||
|
\keys_define:nn{twinfig}{
|
||||||
|
offset .fp_set:N = \l_twinfig_offset,
|
||||||
|
offset .initial:n = {2.0},%\bigfloatoffsetratio,
|
||||||
|
}
|
||||||
|
\keys_define:nn{twinfig}{
|
||||||
|
valign .str_set:N = \l_twinfig_valign,
|
||||||
|
valign .initial:n = {m},
|
||||||
|
}
|
||||||
|
\keys_define:nn{twinfig}{
|
||||||
|
width .dim_set:N = \l_twinfig_width,
|
||||||
|
width .initial:n = {3.14in},%\twinfigwidth,
|
||||||
|
}
|
||||||
|
\keys_define:nn{twinfig}{
|
||||||
|
space .dim_set:N = \l_twinfig_space,
|
||||||
|
space .initial:n = {3pt},%\twinfigspace,
|
||||||
|
}
|
||||||
|
\keys_log:nn{twinfig}{overhang}
|
||||||
|
\keys_log:nn{twinfig}{placement}
|
||||||
|
\keys_log:nn{twinfig}{offset}
|
||||||
|
\keys_log:nn{twinfig}{valign}
|
||||||
|
\keys_log:nn{twinfig}{width}
|
||||||
|
\keys_log:nn{twinfig}{space}
|
||||||
|
|
||||||
|
\typeout{\the\l_twinfig_overhang}
|
||||||
|
\typeout{\l_twinfig_placement}
|
||||||
|
\typeout{\fp_use:N \l_twinfig_offset}
|
||||||
|
\typeout{\l_twinfig_valign}
|
||||||
|
\typeout{\the\l_twinfig_width}
|
||||||
|
\typeout{\the\l_twinfig_space}
|
||||||
|
|
||||||
|
\ProcessKeyOptions[twinfig]
|
||||||
|
|
||||||
\NewDocumentCommand{\twinfig}{%
|
\NewDocumentCommand{\twinfig}{%
|
||||||
% Big Float overhang.
|
% #1: Big Float overhang.
|
||||||
O{\bigfloatoverhang}
|
%O{\bigfloatoverhang}
|
||||||
% Float placement.
|
% #2: Float placement.
|
||||||
O{htpb}
|
%O{htpb}
|
||||||
% BigFloat offset ratio.
|
% #3: BigFloat offset ratio.
|
||||||
O{\bigfloatoffsetratio}
|
%O{\bigfloatoffsetratio}
|
||||||
% First graphic file.
|
% #1: Key=value options.
|
||||||
|
O{}
|
||||||
|
% #2: First graphic file.
|
||||||
m
|
m
|
||||||
% First label.
|
% #3: First label.
|
||||||
>{\TrimSpaces}m
|
>{\TrimSpaces}m
|
||||||
% First caption.
|
% #4: First caption.
|
||||||
>{\TrimSpaces}m
|
>{\TrimSpaces}m
|
||||||
% Second graphic file.
|
% #5: Second graphic file.
|
||||||
m
|
m
|
||||||
% Second label.
|
% #6: Second label.
|
||||||
>{\TrimSpaces}m
|
>{\TrimSpaces}m
|
||||||
% Second caption.
|
% #7: Second caption.
|
||||||
>{\TrimSpaces}m
|
>{\TrimSpaces}m
|
||||||
|
% #8: Image vertical alignment.
|
||||||
|
%O{m}
|
||||||
}{%
|
}{%
|
||||||
\begin{BigFloat}[figure][#1][#2][#3]%
|
\keys_set:nn{twinfig}{#1}%
|
||||||
|
|
||||||
|
\typeout{\the\l_twinfig_overhang}
|
||||||
|
\typeout{\l_twinfig_placement}
|
||||||
|
\typeout{\fp_use:N \l_twinfig_offset}
|
||||||
|
\typeout{\l_twinfig_valign}
|
||||||
|
\typeout{\the\l_twinfig_width}
|
||||||
|
\typeout{\the\l_twinfig_space}
|
||||||
|
\begin{BigFloat}[figure][\l_twinfig_overhang][\l_twinfig_placement][\l_twinfig_offset]%
|
||||||
\begin{tblr}{%
|
\begin{tblr}{%
|
||||||
colspec = {*{2}{Q[c,m,wd=\twinfigwidth]}},%
|
colspec = {*{2}{Q[c,\l_twinfig_valign,wd=\l_twinfig_width]}},%
|
||||||
hlines = {0pt},
|
hlines = {0pt},
|
||||||
%vlines,% For debugging. Comment out when done.
|
%vlines,% For debugging. Comment out when done.
|
||||||
hborder{1,Z} = {%
|
hborder{1,Z} = {%
|
||||||
@@ -128,26 +189,26 @@
|
|||||||
rightspace = 0pt,%
|
rightspace = 0pt,%
|
||||||
},%
|
},%
|
||||||
vborder{2} = {%
|
vborder{2} = {%
|
||||||
leftspace = \twinfigspace,%
|
leftspace = \l_twinfig_space,%
|
||||||
rightspace = \twinfigspace,%
|
rightspace = \l_twinfig_space,%
|
||||||
},%
|
},%
|
||||||
}%
|
}%
|
||||||
\vfill
|
\vfill
|
||||||
\captionsetup{type=figure}%
|
\captionsetup{type=figure}%
|
||||||
\includegraphics[%
|
\includegraphics[%
|
||||||
keepaspectratio,width=\twinfigwidth%
|
keepaspectratio,width=\l_twinfig_width%
|
||||||
]{#4}%
|
]{#2}%
|
||||||
\captionof{figure}{#6}%
|
\captionof{figure}{#4}%
|
||||||
\label{fig:#5}
|
\label{fig:#3}
|
||||||
\vfill%
|
\vfill%
|
||||||
&%
|
&%
|
||||||
\vfill
|
\vfill
|
||||||
\captionsetup{type=figure}%
|
\captionsetup{type=figure}%
|
||||||
\includegraphics[%
|
\includegraphics[%
|
||||||
keepaspectratio,width=\twinfigwidth%
|
keepaspectratio,width=\l_twinfig_width%
|
||||||
]{#7}%
|
]{#5}%
|
||||||
\captionof{figure}{#9}%
|
\captionof{figure}{#7}%
|
||||||
\label{fig:#8}
|
\label{fig:#6}
|
||||||
\vfill%
|
\vfill%
|
||||||
\\%
|
\\%
|
||||||
\end{tblr}%
|
\end{tblr}%
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
\RequirePackage{PrimeTeX/packages/Layout}
|
\RequirePackage{PrimeTeX/packages/Layout}
|
||||||
|
|
||||||
\providelength{\insideheaderoffset}[\bigfloatoverhang]
|
\ProvideLength{\insideheaderoffset}[\bigfloatoverhang]
|
||||||
\providelength{\outsideheaderoffset}[
|
\ProvideLength{\outsideheaderoffset}[
|
||||||
\bigfloatoverhang * \real{\bigfloatoffsetratio}
|
\bigfloatoverhang * \real{\bigfloatoffsetratio}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,7 @@
|
|||||||
% Suppress warning about \showhyphens being changed.
|
% Suppress warning about \showhyphens being changed.
|
||||||
\let\CheckCommand\providecommand
|
\let\CheckCommand\providecommand
|
||||||
|
|
||||||
\RequirePackage{ifthen}
|
\NewDocumentCommand{\ProvideLength}{m O{0pt}}{%
|
||||||
|
|
||||||
\NewDocumentCommand{\providelength}{m O{0pt}}{%
|
|
||||||
\ifdeflength{#1}{% It is already defined!
|
\ifdeflength{#1}{% It is already defined!
|
||||||
}{% Not defined, so define it!
|
}{% Not defined, so define it!
|
||||||
\newlength{#1}%
|
\newlength{#1}%
|
||||||
@@ -60,8 +58,8 @@
|
|||||||
\RequirePackage{calc}
|
\RequirePackage{calc}
|
||||||
\RequirePackage[strict]{changepage}
|
\RequirePackage[strict]{changepage}
|
||||||
|
|
||||||
\providelength{\marparwidth}[\marginparsep + \marginparwidth]
|
\ProvideLength{\marparwidth}[\marginparsep + \marginparwidth]
|
||||||
\providelength{\contentwidth}[\textwidth + \marparwidth]
|
\ProvideLength{\contentwidth}[\textwidth + \marparwidth]
|
||||||
|
|
||||||
\RequirePackage[
|
\RequirePackage[
|
||||||
debug,
|
debug,
|
||||||
@@ -114,10 +112,11 @@
|
|||||||
}%
|
}%
|
||||||
}{}
|
}{}
|
||||||
|
|
||||||
\newcommand{\bigfloatoffsetratio}{2}
|
\newcommand{\bigfloatoffsetratio}{2.0}
|
||||||
|
|
||||||
% Maximum width adjustment to fit 2 16x9 screensots on one page.
|
% Maximum width adjustment to fit 2 16x9 screensots on one page.
|
||||||
\providelength{\bigfloatoverhang}[0.54in]
|
\ProvideLength{\bigfloatoverhang}[0.54in]
|
||||||
|
\newcommand{\bigfloatplacement}{htpb}
|
||||||
|
|
||||||
\floatstyle{plain}
|
\floatstyle{plain}
|
||||||
\newfloat{generic}{htpb}{lgf}
|
\newfloat{generic}{htpb}{lgf}
|
||||||
@@ -128,9 +127,9 @@
|
|||||||
% #2: Overhang: the distance that the BigFloat extends into the margins.
|
% #2: Overhang: the distance that the BigFloat extends into the margins.
|
||||||
O{\bigfloatoverhang}
|
O{\bigfloatoverhang}
|
||||||
% #3: Float position: where the float may appear on the page.
|
% #3: Float position: where the float may appear on the page.
|
||||||
O{htpb}
|
O{\bigfloatplacement}
|
||||||
% #4: Offset: the distance to offset the center of the BigFloat from the center
|
% #4: Offset: the ratio between the overhangs on the inside and outside of
|
||||||
% of the text block.
|
% BigFloat.
|
||||||
O{\bigfloatoffsetratio}
|
O{\bigfloatoffsetratio}
|
||||||
% #5: Body: what appears in the BigFloat.
|
% #5: Body: what appears in the BigFloat.
|
||||||
+b
|
+b
|
||||||
@@ -149,3 +148,48 @@
|
|||||||
\end{SmartAdjustWidth}%
|
\end{SmartAdjustWidth}%
|
||||||
\end{#1}%
|
\end{#1}%
|
||||||
}{}
|
}{}
|
||||||
|
|
||||||
|
\AtBeginDocument{
|
||||||
|
\ifthenelse{\boolean{isElectronic}}{
|
||||||
|
\newgeometry{
|
||||||
|
inner = 0.75in,
|
||||||
|
top = 66pt, % 11/12in
|
||||||
|
marginratio = 2:3,
|
||||||
|
}
|
||||||
|
\savegeometry{smallMargin}
|
||||||
|
\newgeometry{
|
||||||
|
inner = 24pt, % 1/3in
|
||||||
|
top = 0.25in,
|
||||||
|
marginratio = 2:3,
|
||||||
|
}
|
||||||
|
\savegeometry{tinyMargin}
|
||||||
|
}{
|
||||||
|
\newgeometry{
|
||||||
|
twoside = true,
|
||||||
|
inner = 0.75in,
|
||||||
|
top = 66pt, % 11/12in
|
||||||
|
marginratio = 2:3,
|
||||||
|
}
|
||||||
|
\savegeometry{smallMargin}
|
||||||
|
\newgeometry{
|
||||||
|
twoside = true,
|
||||||
|
inner = 24pt, % 1/3in
|
||||||
|
top = 0.25in,
|
||||||
|
marginratio = 2:3,
|
||||||
|
}
|
||||||
|
\savegeometry{tinyMargin}
|
||||||
|
}
|
||||||
|
\restoregeometry
|
||||||
|
|
||||||
|
\NewDocumentEnvironment{SmallMargin}{O{0.0in} O{-0.25in}}{
|
||||||
|
\clearpage
|
||||||
|
\loadgeometry{smallMargin}
|
||||||
|
\setlength{\insideheaderoffset}{#1}
|
||||||
|
\setlength{\outsideheaderoffset}{#2}
|
||||||
|
\pagestyle{fancy}
|
||||||
|
}{
|
||||||
|
\clearpage
|
||||||
|
\pagestyle{fancy}
|
||||||
|
\restoregeometry
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user