- Refine Boxouts.
- General refactoring.
This commit is contained in:
@@ -9,34 +9,58 @@
|
||||
\providelength{\boxoutpadding}[1em]
|
||||
\providelength{\boxoutrule}[1pt]
|
||||
|
||||
\colorlet{boxoutbgcolor}{PrimePaleBlue}
|
||||
\colorlet{boxoutfgcolor}{PrimeBlue}
|
||||
\colorlet{BoxoutBGColor}{PrimePaleBlue}
|
||||
\colorlet{BoxoutFGColor}{PrimeBlue}
|
||||
|
||||
\definecolor{WarningBoxBGColor}{RGB}{255, 221, 118}
|
||||
\definecolor{WarningBoxFGColor}{RGB}{255, 150, 0}
|
||||
|
||||
\NewTblrEnviron{tblrBoxout}
|
||||
\SetTblrInner[tblrBoxout]{
|
||||
%colspec = {X[1,l,h]},
|
||||
cells = {boxoutbgcolor},
|
||||
hlines = {0pt},
|
||||
hline{1,Z} = {\boxoutrule,boxoutfgcolor},
|
||||
row{1} = {font={\bfseries\sbfamily}},
|
||||
cells = {BoxoutBGColor},
|
||||
hborder{1} = {belowspace=\boxoutpadding},
|
||||
hborder{Z} = {abovespace=\boxoutpadding},
|
||||
hlines = {0pt,BoxoutBGColor},
|
||||
hline{1,Z} = {\boxoutrule,BoxoutFGColor},
|
||||
%row{1} = {font={\bfseries\sbfamily}},
|
||||
vborder{1} = {rightspace=\boxoutpadding},
|
||||
vborder{Z} = {leftspace=\boxoutpadding},
|
||||
vlines = {0pt},
|
||||
vline{1,Z} = {\boxoutrule,boxoutfgcolor},
|
||||
vlines = {0pt,BoxoutBGColor},
|
||||
vline{1,Z} = {\boxoutrule,BoxoutFGColor},
|
||||
}
|
||||
|
||||
\NewDocumentEnvironment{@boxout}{
|
||||
m m +b
|
||||
}{
|
||||
\label{box:#2}%
|
||||
\begin{tblrBoxout}{#1}%
|
||||
#3%
|
||||
\end{tblrBoxout}%
|
||||
}{}
|
||||
|
||||
\NewDocumentEnvironment{Boxout}{
|
||||
O{colspec={X[l,h]}}
|
||||
>{\TrimSpaces}m
|
||||
+m
|
||||
o
|
||||
+b
|
||||
}{%
|
||||
\label{box:#2}%
|
||||
\captionlistentry[figure]{#3}%
|
||||
\begin{tblrBoxout}{#1}%
|
||||
{\Centering{}#3}\\%
|
||||
#4\\%
|
||||
\end{tblrBoxout}%
|
||||
\ifthenelse{\equal{#4}{w}\OR\equal{#4}{W}}{%
|
||||
\colorlet{BoxoutBGColor}{WarningBoxBGColor}%
|
||||
\colorlet{BoxoutFGColor}{WarningBoxFGColor}%
|
||||
}{}%
|
||||
\IfBlankTF{#3}{%
|
||||
\begin{@boxout}{#1}{#2}{}%
|
||||
\setlength{\parskip}{\medskipamount}%
|
||||
#5\\%
|
||||
\end{@boxout}%
|
||||
}{%
|
||||
\begin{@boxout}{#1}{#2}%
|
||||
{\Centering\sbfamily\bfseries #3}\\%
|
||||
\setlength{\parskip}{\medskipamount}%
|
||||
#5\\%
|
||||
\end{@boxout}%
|
||||
}%
|
||||
}{}
|
||||
|
||||
\NewDocumentEnvironment{BigBoxout}{
|
||||
@@ -46,12 +70,13 @@
|
||||
O{X[l,h]}
|
||||
>{\TrimSpaces}m
|
||||
+m
|
||||
o
|
||||
+b
|
||||
}{
|
||||
\begin{figure}[#2]%
|
||||
\begin{adjustwidth}{-#1 * \real{#3}}{-#1 / \real{#3}}%
|
||||
\begin{Boxout}[#4]{#5}{#6}%
|
||||
#7%
|
||||
\begin{adjustwidth}{-#1}{-#1 * \real{#3}}%
|
||||
\begin{Boxout}[#4]{#5}{#6}[#7]%
|
||||
#8%
|
||||
\end{Boxout}%
|
||||
\end{adjustwidth}%
|
||||
\end{figure}%
|
||||
@@ -67,12 +92,13 @@
|
||||
O{X[l,h]}
|
||||
>{\TrimSpaces}m
|
||||
+m
|
||||
o
|
||||
+b
|
||||
}{%
|
||||
\begin{wrapfigure}{#1}[#2]%
|
||||
\begin{minipage}{#3}%
|
||||
\begin{Boxout}[#4]{#5}{#6}%
|
||||
#7%
|
||||
\begin{Boxout}[#4]{#5}{#6}[#7]%
|
||||
#8%
|
||||
\end{Boxout}%
|
||||
\end{minipage}%
|
||||
\end{wrapfigure}%
|
||||
|
||||
@@ -18,23 +18,22 @@
|
||||
\pagecolor[rgb]{0.2,0.2,0.2}
|
||||
\color[rgb]{0.9,0.9,0.9}
|
||||
|
||||
\definecolor{PrimeBlue}{RGB}{149, 164, 237}
|
||||
\definecolor{PrimePaleBlue}{RGB}{35, 39, 56}
|
||||
|
||||
\definecolor{pageColor}{rgb}{0.2,0.2,0.2}
|
||||
\definecolor{textColor}{rgb}{0.9,0.9,0.9}
|
||||
\definecolor{paleGray}{rgb}{0.3,0.3,0.3}
|
||||
|
||||
\definecolor{PrimeBlue}{RGB}{149, 164, 237}
|
||||
\definecolor{PrimePaleBlue}{RGB}{35, 39, 56}
|
||||
}{
|
||||
\definecolor{PrimeBlue}{RGB}{25,45,145}
|
||||
\definecolor{PrimePaleBlue}{RGB}{233,236,251}
|
||||
|
||||
\colorlet{pageColor}{white}
|
||||
\colorlet{textColor}{black}
|
||||
\colorlet{paleGray}{gray!10}
|
||||
|
||||
\definecolor{PrimeBlue}{RGB}{25,45,145}
|
||||
\definecolor{PrimePaleBlue}{RGB}{233,236,251}
|
||||
}
|
||||
|
||||
\definecolor{WarningBoxBGColor}{RGB}{255, 221, 118}
|
||||
\definecolor{WarningBoxFGColor}{RGB}{255, 150, 0}
|
||||
\colorlet{layoutColor}{PrimePaleBlue}
|
||||
|
||||
\RequirePackage{PrimeTeX/packages/Layout}
|
||||
|
||||
@@ -45,16 +44,3 @@
|
||||
\setlength{\fboxsep}{1pt}%
|
||||
\fcolorbox{boxedcoloroutline}{#2}{\color{#3}\strut{}#1}}%
|
||||
}
|
||||
|
||||
\providelength{\warningboxwidth}[
|
||||
\textwidth - \fboxsep * 2 - \fboxrule * 2 - 5.56pt % Magic number to make it fit.
|
||||
]
|
||||
|
||||
\NewDocumentCommand{\warningbox}{O{\warningboxwidth} +m}{%
|
||||
\fcolorbox{WarningBoxFGColor}{WarningBoxBGColor}{%
|
||||
\begin{minipage}{#1}%
|
||||
%\rule{\textwidth}{1pt}\zws% For debugging.
|
||||
#2%
|
||||
\end{minipage}%
|
||||
}%
|
||||
}
|
||||
@@ -2,20 +2,30 @@
|
||||
\ProvidesPackage{PrimeTeX/packages/DocProperties}[2025-07-09]
|
||||
|
||||
% Custom document properties.
|
||||
\DeclareRobustCommand*{\customer}[1]{\gdef\@customer{#1}}
|
||||
\DeclareRobustCommand*{\customerFull}[1]{\gdef\@customerFull{#1}}
|
||||
\DeclareRobustCommand*{\projectNumber}[1]{\gdef\@projectNumber{#1}}
|
||||
\DeclareRobustCommand*{\projectDesc}[1]{\gdef\@projectDesc{#1}}
|
||||
\DeclareRobustCommand*{\version}[1]{\gdef\@version{#1}}
|
||||
\DeclareRobustCommand*{\customer}[1]{\gdef\@customer{#1}}
|
||||
\DeclareRobustCommand*{\customerFull}[1]{\gdef\@customerFull{#1}}
|
||||
\DeclareRobustCommand*{\projectNumber}[1]{\gdef\@projectNumber{#1}}
|
||||
\DeclareRobustCommand*{\projectDesc}[1]{\gdef\@projectDesc{#1}}
|
||||
\DeclareRobustCommand*{\version}[1]{\gdef\@version{#1}}
|
||||
|
||||
% Macros to insert document properties.
|
||||
\NewDocumentCommand{\sTitle}{}{\makeatletter{\@title}}
|
||||
\NewDocumentCommand{\sAuthor}{}{\makeatletter{\@author}}
|
||||
\NewDocumentCommand{\sDate}{}{\makeatletter{\@date}}
|
||||
\NewDocumentCommand{\sCustomer}{}{\makeatletter{\@customer}}
|
||||
\NewDocumentCommand{\sCustomerFull}{}{\makeatletter{\@customerFull}}
|
||||
\NewDocumentCommand{\sProjectNumber}{}{\makeatletter{\@projectNumber}}
|
||||
\NewDocumentCommand{\sProjectDesc}{}{\makeatletter{\@projectDesc}}
|
||||
\NewDocumentCommand{\sProjectTitle}{}{\makeatletter{Project \@projectNumber : \@projectDesc}}
|
||||
\NewDocumentCommand{\sVersion}{}{\makeatletter{\@version}}
|
||||
%#endregion
|
||||
\NewDocumentCommand{\sTitle}{}{\makeatletter{\@title}}
|
||||
\NewDocumentCommand{\sAuthor}{}{\makeatletter{\@author}}
|
||||
\NewDocumentCommand{\sDate}{}{\makeatletter{\@date}}
|
||||
\NewDocumentCommand{\sCustomer}{}{\makeatletter{\@customer}}
|
||||
\NewDocumentCommand{\sCustomerFull}{}{\makeatletter{\@customerFull}}
|
||||
\NewDocumentCommand{\sProjectNumber}{}{\makeatletter{\@projectNumber}}
|
||||
\NewDocumentCommand{\sProjectDesc}{}{\makeatletter{\@projectDesc}}
|
||||
\NewDocumentCommand{\sProjectTitle}{}{\makeatletter{Project \@projectNumber : \@projectDesc}}
|
||||
\NewDocumentCommand{\sVersion}{}{\makeatletter{\@version}}
|
||||
|
||||
\let\oldAuthor\author
|
||||
\let\oldTitle\title
|
||||
\renewcommand{\author}[1]{%
|
||||
\oldAuthor{#1}%
|
||||
\hypersetup{pdfauthor=#1}%
|
||||
}
|
||||
\renewcommand{\title}[1]{%
|
||||
\oldTitle{#1}%
|
||||
\hypersetup{pdftitle=#1}%
|
||||
}
|
||||
@@ -54,8 +54,10 @@
|
||||
\NewDocumentCommand{\slab}{m}{{\sbfamily{}#1}}
|
||||
\NewDocumentCommand{\code}{m}{\mono{\small{}#1}}
|
||||
|
||||
\NewDocumentCommand{\objref}{m}{{\sans{\strong{#1}}}}
|
||||
|
||||
\RequirePackage{amssymb}
|
||||
|
||||
\RequirePackage[os=win]{menukeys}
|
||||
|
||||
\renewmenumacro{\directory}[,]{hyphenatepaths}
|
||||
|
||||
\RenewDocumentCommand{\ctrlname}{}{$\wedge$}
|
||||
@@ -24,12 +24,25 @@
|
||||
\end{figure}%
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\bigfig}{O{\bigfloatoverhang} m >{\TrimSpaces}m m}{%
|
||||
\BigFloat[#1]{figure}{%
|
||||
\NewDocumentCommand{\bigfig}{
|
||||
% BigFloat overhang.
|
||||
O{\bigfloatoverhang}
|
||||
% Float positioning.
|
||||
O{htpb}
|
||||
% BigFloat offset ratio.
|
||||
O{\bigfloatoffsetratio}
|
||||
% Graphic file.
|
||||
m
|
||||
% Label.
|
||||
>{\TrimSpaces}m
|
||||
% Caption.
|
||||
m
|
||||
}{%
|
||||
\BigFloat[#1][#2][#3]{figure}{%
|
||||
\captionsetup{type=figure}%
|
||||
\includegraphics[keepaspectratio,width=\linewidth]{#2}%
|
||||
\Centering\captionof{figure}{#4}%\par
|
||||
\label{fig:#3}%
|
||||
\includegraphics[keepaspectratio,width=\linewidth]{#4}%
|
||||
\Centering\captionof{figure}{#6}%\par
|
||||
\label{fig:#5}%
|
||||
}%
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
|
||||
\RequirePackage{PrimeTeX/packages/Layout}
|
||||
|
||||
\providelength{\insideheaderoffset}[
|
||||
\bigfloatoverhang * \real{\bigfloatoffsetratio}
|
||||
]
|
||||
\providelength{\insideheaderoffset}[\bigfloatoverhang]
|
||||
\providelength{\outsideheaderoffset}[
|
||||
\bigfloatoverhang / \real{\bigfloatoffsetratio}
|
||||
\bigfloatoverhang * \real{\bigfloatoffsetratio}
|
||||
]
|
||||
|
||||
% Header & Footer Options
|
||||
|
||||
@@ -3,11 +3,6 @@
|
||||
|
||||
% Suppress warning about \showhyphens being changed.
|
||||
\let\CheckCommand\providecommand
|
||||
% Suppress "Underfull \hbox" infos.
|
||||
\hbadness=10000
|
||||
% Suppress small overfull infos.
|
||||
\hfuzz = 0.0pt
|
||||
\vfuzz = 0.0pt
|
||||
|
||||
\NewDocumentCommand{\providelength}{m O{0pt}}{%
|
||||
\ifdeflength{#1}{% It is already defined!
|
||||
@@ -33,10 +28,21 @@
|
||||
footskip = 0.5in, % 36pt,
|
||||
]{geometry}
|
||||
|
||||
\renewcommand{\Gm@vrule}{\color{layoutColor}\vrule width 0.2pt height\textheight depth\z@}
|
||||
\renewcommand{\Gm@hrule}{\color{layoutColor}\hrule height 0.2pt depth\z@ width\textwidth}
|
||||
\renewcommand{\Gm@hruled}{\color{layoutColor}\hrule height\z@ depth0.2pt width\textwidth}
|
||||
|
||||
% Suppress "Underfull \hbox" infos.
|
||||
\hbadness=10000
|
||||
|
||||
\ifthenelse{\boolean{isDraft}}{
|
||||
% \geometry{showcrop}
|
||||
\geometry{showframe}
|
||||
}{}
|
||||
\hfuzz = 2.0pt
|
||||
}{
|
||||
% Suppress small overfull infos.
|
||||
\hfuzz = 6.0pt
|
||||
\vfuzz = 0.0pt
|
||||
}
|
||||
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
% \geometry{}
|
||||
@@ -79,15 +85,13 @@
|
||||
% Line-breaking dot
|
||||
\NewDocumentCommand{\bdot}{}{.\zws}
|
||||
|
||||
\newcommand{\bigfloatoffsetratio}{0.667}
|
||||
\newcommand{\bigfloatoffsetratio}{2}
|
||||
|
||||
% Maximum width adjustment to fit 2 16x9 screensots on one page.
|
||||
\providelength{\bigfloatoverhang}[0.81in]
|
||||
\providelength{\bigfloatoverhang}[0.54in]
|
||||
|
||||
\providecommand{\adjwidthtype}{}
|
||||
|
||||
\makeatletter
|
||||
|
||||
\NewDocumentCommand{\BigFloat}{
|
||||
% Overhang: the distance that the BigFloat extends into the margins.
|
||||
O{\bigfloatoverhang}
|
||||
@@ -96,35 +100,36 @@
|
||||
% Offset: the distance to offset the center of the BigFloat from the center
|
||||
% of the text block.
|
||||
O{\bigfloatoffsetratio}
|
||||
% Float type: figure or table.t
|
||||
% Float type: figure or table.
|
||||
m
|
||||
% Content: what appears in the BigFloat.
|
||||
+m
|
||||
}{%
|
||||
\ifthenelse{\boolean{isElectronic}}{%
|
||||
\@bfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth}%
|
||||
\@bigfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth}%
|
||||
}{%
|
||||
\@bfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth*}%
|
||||
\@bigfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth*}%
|
||||
}%
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\@bfloat}{
|
||||
\NewDocumentCommand{\@bigfloat}{
|
||||
% First 5 arguments are same as \BigFloat.
|
||||
m m m m +m
|
||||
% Argument 6 is the adjustwidth type [adjustwidth for one-sided document,
|
||||
% adjustwidth* for two-sided].
|
||||
% Argument 6 is the adjustwidth type:
|
||||
% adjustwidth for one-sided document; adjustwidth* for two-sided.
|
||||
m
|
||||
}{
|
||||
\begin{#4}[#2]% figure/table
|
||||
\begin{#6}{-#1 * \real{#3}}{-#1 / \real{#3}}% adjustwidth(*)
|
||||
\begin{minipage}{#1 * 2 + \textwidth}%
|
||||
\begin{#6}{-#1}{-#1 * \real{#3}}% adjustwidth(*)
|
||||
\begin{minipage}{#1 * (#3 + 1) + \textwidth}%
|
||||
\ifthenelse{\boolean{isDraft}}{%
|
||||
\rule{\textwidth}{1pt}\zws%
|
||||
}{}%
|
||||
{\color{layoutColor}\rule{\textwidth}{1pt}\zws}%
|
||||
#5%
|
||||
%{\color{layoutColor}\rule{\textwidth}{1pt}}%
|
||||
}{%
|
||||
#5%
|
||||
}%
|
||||
\end{minipage}%
|
||||
\end{#6}%
|
||||
\end{#4}%
|
||||
}
|
||||
|
||||
\makeatother
|
||||
@@ -9,14 +9,15 @@
|
||||
\ifthenelse{\boolean{isElectronic}}{
|
||||
\hypersetup{
|
||||
final,
|
||||
colorlinks=true,
|
||||
allcolors=PrimeBlue,
|
||||
colorlinks = true,
|
||||
allcolors = PrimeBlue,
|
||||
pdfpagemode = UseOutlines,
|
||||
}
|
||||
}{
|
||||
\hypersetup{
|
||||
final,
|
||||
colorlinks=true,
|
||||
allcolors=textColor
|
||||
colorlinks = true,
|
||||
allcolors = textColor,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user