128 lines
2.6 KiB
TeX
128 lines
2.6 KiB
TeX
\NeedsTeXFormat{LaTeX2e}
|
|
\ProvidesPackage{PrimeTeX/packages/Graphics}[2025-07-09]
|
|
|
|
\RequirePackage{PrimeTeX/packages/Layout}
|
|
|
|
% Graphics package for including images
|
|
\RequirePackage[final]{graphicx}
|
|
|
|
\RequirePackage{calc}
|
|
|
|
\RequirePackage{wrapfig2}
|
|
|
|
\NewDocumentCommand{\iconsize}{}{0.25in}
|
|
|
|
\NewDocumentCommand{\ig}{O{width=0.5in} m}{
|
|
\includegraphics[keepaspectratio,#1]{#2}
|
|
}
|
|
|
|
\NewDocumentCommand{\centerfig}{O{} m >{\TrimSpaces}m m}{
|
|
\begin{figure}[htpb]%
|
|
\Centering%
|
|
\includegraphics[keepaspectratio,#1]{#2}%
|
|
\caption{#4}%
|
|
\label{fig:#3}%
|
|
\end{figure}%
|
|
}
|
|
|
|
\NewDocumentCommand{\bigfig}{O{\bigfloatoverhang} m >{\TrimSpaces}m m}{%
|
|
\bigfloat[#1]{figure}{htpb}{%
|
|
\captionsetup{type=figure}%
|
|
\includegraphics[keepaspectratio,width=\textwidth]{#2}%
|
|
\Centering\captionof{figure}{#4}\par%
|
|
\label{fig:#3}%
|
|
}%
|
|
}
|
|
|
|
\NewDocumentCommand{\doublebigfig}{%
|
|
O{\bigfloatoverhang} m >{\TrimSpaces}m m m >{\TrimSpaces}m m%
|
|
}{%
|
|
\bigfloat[#1]{figure}{p}{%
|
|
\captionsetup{type=figure}%
|
|
\includegraphics[keepaspectratio,width=\textwidth]{#2}%
|
|
\Centering\captionof{figure}{#4}\par%
|
|
\label{fig:#3}
|
|
\bigskip
|
|
\captionsetup{type=figure}%
|
|
\includegraphics[keepaspectratio,width=\textwidth]{#5}%
|
|
\Centering\captionof{figure}{#7}\par%
|
|
\label{fig:#6}%
|
|
}%
|
|
}
|
|
|
|
\RequirePackage{tabularray}
|
|
|
|
\providelength[3pt]{\twinfigspace}
|
|
\providelength[
|
|
\textwidth / 2 + \bigfloatoverhang - \twinfigspace
|
|
]{\twinfigwidth}
|
|
|
|
\NewDocumentCommand{\twinfig}{%
|
|
O{\bigfloatoverhang} m >{\TrimSpaces}m m m >{\TrimSpaces}m m%
|
|
}{%
|
|
\bigfloat[#1]{table}{htpb}{%
|
|
\begin{tblr}{%
|
|
colspec = {%
|
|
*{2}{Q[c,m,wd=\twinfigwidth]}%
|
|
},%
|
|
vborder{1,Z} = {
|
|
leftspace = 0pt,%
|
|
rightspace = 0pt,%
|
|
},%
|
|
vborder{2} = {%
|
|
leftspace = \twinfigspace,%
|
|
rightspace = \twinfigspace,%
|
|
},%
|
|
}%
|
|
\vfill
|
|
\captionsetup{type=figure}%
|
|
\includegraphics[%
|
|
keepaspectratio,width=\twinfigwidth%
|
|
]{#2}%
|
|
\captionof{figure}{#4}%
|
|
\label{fig:#3}
|
|
\vfill%
|
|
&%
|
|
\vfill
|
|
\captionsetup{type=figure}%
|
|
\includegraphics[%
|
|
keepaspectratio,width=\twinfigwidth%
|
|
]{#5}%
|
|
\captionof{figure}{#7}%
|
|
\label{fig:#6}
|
|
\vfill%
|
|
\\%
|
|
\end{tblr}%
|
|
}%
|
|
}
|
|
|
|
\NewDocumentCommand{\wrapfig}{%
|
|
O{0in} m m m >{\TrimSpaces}m m%
|
|
}{%
|
|
% Syntax:
|
|
% \wrapfig[%
|
|
% horizontal_offset
|
|
% ]{
|
|
% graphic_file
|
|
% }{
|
|
% alignment [l,r,i,o]
|
|
% }{
|
|
% (width|height)=lengthvalue
|
|
% }{
|
|
% label
|
|
% }{
|
|
% caption
|
|
% }
|
|
%
|
|
\begin{wrapfigure}{#3}[#1]%
|
|
\captionsetup{type=figure}%
|
|
\capstart%
|
|
\includegraphics[%
|
|
keepaspectratio,%
|
|
#4%
|
|
]{#2}%
|
|
\Centering\captionof{figure}{#6}%
|
|
\label{fig:#5}%
|
|
\end{wrapfigure}%
|
|
}
|