move helper methods out

This commit is contained in:
Kevin Harrington 2025-11-22 13:06:23 -05:00
parent 620971340b
commit cd3f2b89b8
2 changed files with 43 additions and 42 deletions

42
helper.tex Normal file
View file

@ -0,0 +1,42 @@
% --- Add corner image depending on odd/even page ---
\newcommand{\AddCornerImage}{%
\AddToShipoutPictureBG{%
\ifnum\value{page}>1 % Only add corners if page number > 1
% === Bottom Corner ===
\AtPageLowerLeft{%
\ifodd\value{page}
% Odd pages: bottom-right corner (normal), moved up and in 1mm
\put(\LenToUnit{\paperwidth-1.5cm-\mylen},\LenToUnit{\mylen}){%
\includegraphics[width=1.5cm]{CornerDetail.png}%
}%
\else
% Even pages: bottom-left corner (mirrored), moved up and in 1mm
\put(\LenToUnit{\mylen},\LenToUnit{\mylen}){%
\reflectbox{\includegraphics[width=1.5cm]{CornerDetail.png}}%
}%
\fi
}%
% === Top Corner ===
\AtPageUpperLeft{%
\ifodd\value{page}
% Odd pages: top-right corner (mirrored and flipped), moved down and in 1mm
\put(\LenToUnit{\paperwidth-1.5cm-\mylen},-\LenToUnit{\mylen}){%
\scalebox{1}[-1]{\includegraphics[width=1.5cm]{CornerDetail.png}}%
}%
\else
% Even pages: top-left corner (flipped), moved down and in 1mm
\put(\LenToUnit{\mylen},-\LenToUnit{\mylen}){%
\reflectbox{\scalebox{1}[-1]{\includegraphics[width=1.5cm]{CornerDetail.png}}}%
}%
\fi
}%
\fi % End of page number check
}%
}
\newcommand{\linedpage}{%
\noindent
\foreach \n in {1,...,10}{%
\rule{\textwidth}{0.4pt}\\[\baselineskip]
}
}