Heegu-sama / Homm3BG

Repository for rewriting the rule book.
119 stars 24 forks source link

Printable version should have an option to remove backgrounds #546

Closed tomaas-zeman closed 3 months ago

tomaas-zeman commented 4 months ago

It would be great if there was a printable version without any background to save precious ink and speed up printing.

Something like

diff --git a/metadata.tex b/metadata.tex
index 92124f2..28d4a9b 100644
--- a/metadata.tex
+++ b/metadata.tex
@@ -232,7 +232,7 @@

 % Background
 \AddToHook{shipout/background}{%
-  \put (0in,-\paperheight){\includegraphics[width=\paperwidth,height=\paperheight]{\layout/tausta.png}}%
+  \iftoggle{printable}{}{\put (0in,-\paperheight){\includegraphics[width=\paperwidth,height=\paperheight]{\layout/tausta.png}}}%
   \put (0in,-\paperheight){\includegraphics[width=\paperwidth,height=0.05\paperheight]{\layout/bottom.png}}%
 }
diff --git a/sections/back_cover.tex b/sections/back_cover.tex
index 4f8ced3..5e06ab4 100644
--- a/sections/back_cover.tex
+++ b/sections/back_cover.tex
@@ -1,10 +1,13 @@
 % !TeX spellcheck = en_US
 \pagestyle{empty}
-\begin{tikzpicture}[remember picture, overlay, inner sep=10pt]
-  \node(cover)[anchor=center] at (current page.center) {
-    \includegraphics[height=\paperheight, keepaspectratio]{\layout/back.jpg}
-  };
-\end{tikzpicture}
+\iftoggle{printable}{}{
+  \begin{tikzpicture}[remember picture, overlay, inner sep=10pt]
+    \node(cover)[anchor=center] at (current page.center) {
+      \includegraphics[height=\paperheight, keepaspectratio]{\layout/back.jpg}
+    };
+  \end{tikzpicture}
+}
+

 \hommtable{21}{
   \pagetarget{Difficulty Table}{}
diff --git a/sections/notes.tex b/sections/notes.tex
index 82184ae..9d448d2 100644
--- a/sections/notes.tex
+++ b/sections/notes.tex
@@ -2,6 +2,6 @@
 \addsection{Notes}{\spells/cure.png}

 \AddToHookNext{shipout/background}{%
-  \put (0in,-\paperheight){\includegraphics[width=\paperwidth,height=\paperheight]{\layout/castle_background.jpg}}%
+  \iftoggle{printable}{}{\put (0in,-\paperheight){\includegraphics[width=\paperwidth,height=\paperheight]{\layout/castle_background.jpg}}}%
   \put (0in,-\paperheight){\includegraphics[width=\paperwidth,height=0.05\paperheight]{\layout/bottom.png}}%
 }
diff --git a/sections/title_page.tex b/sections/title_page.tex
index 35dc8c0..7004cc8 100644
--- a/sections/title_page.tex
+++ b/sections/title_page.tex
@@ -1,9 +1,9 @@
 % !TeX spellcheck = en_US
 \thispagestyle{empty}
 \begin{tikzpicture}[remember picture, overlay, inner sep=10pt]
-  \node(cover)[anchor=center] at (current page.center) {
+  \iftoggle{printable}{}{\node(cover)[anchor=center] at (current page.center) {
     \includegraphics[height=\paperheight, keepaspectratio]{\layout/cover.jpg}
-  };
+  };}
   \node(title)[minimum width = \paperwidth, anchor=center, yshift=-10em] at (current page.north) {
     \includegraphics[width=0.6\paperwidth]{\layout/cover_title.png}
   };
qwrtln commented 3 months ago

I encourage you to make a PR with this. It should be a separate "economic" printable version. It should be properly explained in the readme.

tomaas-zeman commented 3 months ago

OK. Let me see what I can do