Add scaling options to BigFig.
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
% #2: Label, passed to @boxout argument #1.
|
||||
>{\TrimSpaces}m
|
||||
% #3: Caption.
|
||||
m
|
||||
O{}
|
||||
% #4: Body, passed to @boxout.
|
||||
+b
|
||||
}{%
|
||||
@@ -88,7 +88,7 @@
|
||||
% #2: Label, passed to Boxout argument #1.
|
||||
>{\TrimSpaces}m
|
||||
% #3: Caption, passed to Boxout argument #3.
|
||||
m
|
||||
O{}
|
||||
% #4: Body, passed to Boxout.
|
||||
+b
|
||||
}{
|
||||
@@ -102,7 +102,7 @@
|
||||
\begin{Boxout}[%
|
||||
innerspec:e = \l_Boxout_innerspec_tl,
|
||||
warning:e = \bool_to_str:N \l_Boxout_warning_bool,
|
||||
]{#2}{#3}
|
||||
]{#2}[#3]
|
||||
#4
|
||||
\end{Boxout}
|
||||
\end{BigFloat}
|
||||
@@ -134,7 +134,7 @@
|
||||
% #2: Label.
|
||||
>{\TrimSpaces}m
|
||||
% #3: Caption
|
||||
m
|
||||
O{}
|
||||
% #4: Body.
|
||||
+b
|
||||
}{%
|
||||
@@ -144,7 +144,7 @@
|
||||
\begin{Boxout}[
|
||||
innerspec:e = \l_Boxout_innerspec_tl,
|
||||
warning:e = \bool_to_str:N \l_Boxout_warning_bool,
|
||||
]{#2}{#3}%
|
||||
]{#2}[#3]%
|
||||
#4%
|
||||
\end{Boxout}%
|
||||
\end{minipage}%
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
% Primary Color: Blue
|
||||
% Secondary Colors: Yellow, Mint, Pink
|
||||
|
||||
% Lightness ≈ 33%
|
||||
\definecolorset{HTML}{Prime}{}{% _Relationship to Base Color_
|
||||
Gray, 4d505d;% #474c63 Saturation -> 9%
|
||||
Yellow, 917d19;% #917d19 Complementary
|
||||
@@ -90,7 +91,7 @@
|
||||
Orange, e48f63 % #e48f63
|
||||
}
|
||||
|
||||
% Lightness ≈ 64%
|
||||
% Lightness ≈ 80%
|
||||
\definecolorset{HTML}{PrimePastel}{}{%
|
||||
Gray, c6c8d0;% #c6c8d0
|
||||
Yellow, f0e4a6;% #f0e4a6
|
||||
@@ -179,8 +180,20 @@
|
||||
|
||||
\colorlet{boxedcoloroutline}{text}
|
||||
|
||||
\NewDocumentCommand{\boxedcolor}{O{\rule{0pt}{1ex}\rule{1ex}{0pt}} m m}{%
|
||||
\NewDocumentCommand{\boxedcolor}{
|
||||
% #1: Text inside box.
|
||||
o
|
||||
% #2: Box fill color.
|
||||
m
|
||||
% #3: Text Color.
|
||||
O{black}
|
||||
}{%
|
||||
\setlength{\fboxrule}{0.0pt}% Temporarily set \fboxrule and \fboxsep.
|
||||
\setlength{\fboxsep}{1.5pt}%
|
||||
\fcolorbox{boxedcoloroutline}{#2}{\color{#3}\strut{}#1}%
|
||||
\IfNoValueTF{#1}{%
|
||||
\def\boxedcolortext{\rule{0pt}{1ex}\rule{1ex}{0pt}}%
|
||||
}{%
|
||||
\def\boxedcolortext{\strut{}#1}%
|
||||
}%
|
||||
\fcolorbox{boxedcoloroutline}{#2}{\small\color{#3}\boxedcolortext}%
|
||||
}
|
||||
@@ -48,6 +48,7 @@
|
||||
\NewDocumentCommand{\BigFloatOffset}{}{\fp_use:N \c_BigFloat_offset_fp}
|
||||
|
||||
\clist_new:N \l_BigFloat_placement_clist
|
||||
\dim_new:N \l_BigFloat_workoverhang_dim
|
||||
|
||||
\keys_define:nn{BigFloat}{
|
||||
type .choices:nn = {figure,generic,table}{
|
||||
@@ -67,6 +68,9 @@
|
||||
offset .fp_set:N = \l_BigFloat_offset_fp,
|
||||
offset .default:e = {\c_BigFloat_offset_fp},
|
||||
offset .initial:e = {\c_BigFloat_offset_fp},
|
||||
|
||||
maxoverhang .dim_set:N = \l_BigFloat_maxoverhang_dim,
|
||||
maxoverhang .initial:n = {1in},
|
||||
}
|
||||
|
||||
\NewDocumentEnvironment{BigFloat}{
|
||||
@@ -79,16 +83,18 @@
|
||||
\clist_use_default:Nnnn \l_BigFloat_placement_str
|
||||
{\l_BigFloat_placement_clist}
|
||||
{\c_BigFloat_placement_clist}
|
||||
\dim_set:Nn \l_BigFloat_workoverhang_dim {
|
||||
\dim_min:nn {\l_BigFloat_overhang_dim} {\l_BigFloat_maxoverhang_dim}
|
||||
}
|
||||
\ExpEnvOption%
|
||||
\begin{\l_BigFloat_type_str}[\l_BigFloat_placement_str]% float environment
|
||||
\begin{SmartAdjustWidth}{%
|
||||
|
||||
\fp_to_dim:n {
|
||||
-\l_BigFloat_overhang_dim
|
||||
-\l_BigFloat_workoverhang_dim
|
||||
}%
|
||||
}{%
|
||||
\fp_to_dim:n {%
|
||||
-\l_BigFloat_overhang_dim
|
||||
-\l_BigFloat_workoverhang_dim
|
||||
* \l_BigFloat_offset_fp
|
||||
}%
|
||||
}%
|
||||
@@ -102,6 +108,7 @@
|
||||
\end{minipage}%
|
||||
\end{SmartAdjustWidth}%
|
||||
\end{\l_BigFloat_type_str}%
|
||||
\dim_set:Nn \l_BigFloat_overhang_dim {\c_BigFloat_overhang_dim}
|
||||
}{}
|
||||
|
||||
\clist_const:Nn \c_CenterFig_placement_clist {h, t, p, b}
|
||||
@@ -139,10 +146,23 @@
|
||||
\end{figure}%
|
||||
}
|
||||
|
||||
%\fp_const:Nn \c_BigFig_graphicdpi_fp {72.0}
|
||||
|
||||
\keys_define:nn{}{
|
||||
BigFig .inherit:n = BigFloat,
|
||||
}
|
||||
|
||||
\keys_define:nn{BigFig}{
|
||||
hres .fp_set:N = \l_BigFig_hres_fp,
|
||||
hres .initial:n = {0},
|
||||
|
||||
dpi .fp_set:N = \l_BigFig_dpi_fp,
|
||||
dpi .initial:n = {96},%{\c_BigFig_dpi_fp},
|
||||
|
||||
scale .fp_set:N = \l_BigFig_scale_fp,
|
||||
scale .initial:n = {1},
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\BigFig}{
|
||||
% Key=value options.
|
||||
O{}
|
||||
@@ -154,6 +174,20 @@
|
||||
m
|
||||
}{%
|
||||
\keys_set:nn{BigFig}{#1}
|
||||
\fp_compare:nNnF {\l_BigFig_hres_fp} = {0} {
|
||||
\dim_set:Nn \l_BigFloat_overhang_dim {
|
||||
\dim_eval:n{
|
||||
(\fp_to_dim:n{
|
||||
\l_BigFig_scale_fp
|
||||
* \l_BigFig_hres_fp
|
||||
/ \l_BigFig_dpi_fp
|
||||
* 72.27
|
||||
}
|
||||
- \linewidth)
|
||||
/ 3}
|
||||
}
|
||||
%\dim_show:N \l_BigFloat_overhang_dim
|
||||
}{}
|
||||
\begin{BigFloat}[
|
||||
type = figure,
|
||||
overhang = \l_BigFloat_overhang_dim,
|
||||
@@ -170,11 +204,9 @@
|
||||
\keys_define:nn{DoubleBigFig}{
|
||||
overhang .dim_set:N = \l_DoubleBigFig_overhang_dim,
|
||||
overhang .initial:e = {\c_BigFloat_overhang_dim},
|
||||
% overhang .default:e = {\c_BigFloat_overhang_dim},
|
||||
|
||||
offset .fp_set:N = \l_DoubleBigFig_offset_fp,
|
||||
offset .initial:e = {\c_BigFloat_offset_fp},
|
||||
% offset .default:e = {\c_BigFloat_offset_fp},
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\DoubleBigFig}{%
|
||||
|
||||
Reference in New Issue
Block a user