mirror of
https://github.com/How-To-Build-a-Commons/HowToBuildACommonsWorkbooks.git
synced 2026-04-19 16:51:04 +00:00
42 lines
1.3 KiB
TeX
42 lines
1.3 KiB
TeX
|
|
% --- 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]
|
||
|
|
}
|
||
|
|
}
|