Not long after I completed the [Gopher Maze]({{< relref "/personal/2019-06-20-gopher-maze-game.md" >}}) that I've written about previously, my friend [@shmouflon](https://twitter.com/shmouflon) and I embarked on another [Gopher](https://en.wikipedia.org/wiki/Gopher_(protocol)) project; writing a [Choose Your Own Adventure](https://www.cyoa.com/)-style short story told through Gopher directory pages. We [completed the project](http://interns.scorpinc.solutions:70/) later in the year during August and were content to have ridden that wave of creativity for a while. However we were struck by an idea: what if we could use other oft-forgotten or much-maligned technology to create something new from this? And then it hit us: [LaTeX](https://www.latex-project.org/)! But how would we use LaTeX? The story is to short to be bound into a book, so what use would this intricate and unwieldy typesetting software have for us? A mother-fricking [zine](https://en.wikipedia.org/wiki/Zine). I got to work immediately writing the `.tex` files that would be necessary, having experimented a bit before when writing the [whitepaper for the HexaCult](https://web.archive.org/web/20201125144601/https://hexago.nl/blog/2019-09-09-hexago-nl-whitepaper/). However, one thing we wanted was a way to link to pages and sections that might not immediately follow, without having to manually adjust the page and reference numbers every time we compiled and checked it. To solve this I developed a custom command: ``` \newcommand{\advref}[2]{\textit{#1 - page \pageref{#2}, section \ref{#2}}\\} ``` This creates a command called `\advref` that takes two parameters, a text string that you want to use as the direction, and the label for a section. You can use it like so: ``` \advref{Time to leave}{time-to-leave} ``` This allowed us to put these after a section with the directions or choices you had and you'd end up with text like the following: > *Time to leave - page 1, section 5* It would automatically determine and fill the page numbers, but only on the **second run of the processor**. Unfortunately a major limitation of LaTeX is it's not idempotent, you can be forced to run a single command twice to get it to generate the final PDF with the correct references in text. For those familiar with LaTeX referencing, top level references like the ones previously mentioned only refer to chapters (paragraphs and sub-sections and the like use a decimal point notation, such as 2.3.4.5). So to get the links working, the first line of each section is actually surrounded by a `\chapter{}` tag which is then immediately followed by a `\label{}` tag and then any other text for that section. ``` \chapter{You arrive at the address a little before 8am. There was no Street View when you checked online, and you're confused to be standing across from what looks like a residential apartment building. It's definitely the right address.} \label{time-to-leave} ``` Of course, it's not easy to simply create a folded zine from a LaTeX document, but thankfully the internet helped out majorly with [polchora-org/8up-zine on GitHub](https://github.com/polychora-org/8up-zine) providing a handy template that can be used once you've formatted everything. This allowed us to make an 8-page zine, and with 2 sheets of A4 we'd get 16 pages to use, which meant a lot of aligning on the next and final compilation steps, which had `includepdf{}` tags that looked like: ``` \includepdf[pages={15,16,13,2,7,8,5,10,11,12,9,6,3,4,1,14}, booklet, landscape, delta=0 0.5in]{interns} ... \includepdf[pages={2,1,4,3,6,5,8,7},nup=2x2]{interns-print-step1} ``` After a lot of effort and formatting we got the franken-zine setup working in LaTeX and even printing in A4. Unfortunately it tends to require a good quality printer with a high DPI unlike some cheap home printers which don't have a high enough resolution and get a bit blurry with the tiny text. We should begin printing in greater quantities soon and then distributing them to any lovely interested people, demons, lichs, and potential-interns who want to experience A Day In The Life Of A [ScorpInc](http://scorpinc.solutions/) Intern.