How to make the next compilation longer?

You must, as in the method of computer viruses, get the user to initially participate willingly in the plot. In the case of a virus, that is done by getting the user to click on something, in the hopes that it is something beneficial. In the case of LaTeX, it will mean getting the user to include a file (or style) that he has been told is beneficial

To be quite honest, even though I wrote the code based on a prior answer of mine, Extracting the structure of a LaTex document, including comments, I don't quite understand here how the Delay counter is working (it increases by 5 with each compilation, probably a result of multiple passes in \@starttoc??). But it works.

Here is innocuous.tex which ties into the \@starttoc logic (EDITED to reduce non-essential code and to longer requires an invocation of \tableofcontents to operate)

\usepackage{pgffor}
\newcounter{Delay}
\newcommand\delay[1]{%
  \setcounter{Delay}{#1}%
  \foreach\i in{1,...,#1}{%
    \i, % REPLACE THIS LINE WITH SOMETHING THAT SQUANDERS A SHORT AMOUNT OF TIME
  }%
  \stepcounter{Delay}%
}
\makeatletter
\AtBeginDocument{\@starttoc{xyz}}
\makeatother
\AtEndDocument{\addtocontents{xyz}{\protect \delay{\theDelay}}}

Then, as long as you get your user to \input the file:

\documentclass{article}
\input{innocuous}
\begin{document}
Testing
\end{document}

every time it is compiled it increases the number times it goes through the loop invoked by \delay. Here, I just print out the loop index to demonstrate, but you would want to replace that one line with something [non-printing] that eats up a small (but not infinitesimal) amount of time.

The \delay loop count for each successive compilation is 5i-2 where i is the number of compilations. The method operates by creating a .xyz file containing the line

\delay{69}

where, upon each compilation, the index is grown. When the `code is compiled, it will execute 69 delay loops and then grow the index by 5.


Document:

\documentclass{article}

\usepackage{infinitywait}

\begin{document}

Hello world

\end{document}

Package infinitywait.sty:

\ProvidesPackage{infinitywait}
  [2017/09/29 v0.9 how to occupy the wait for Infinity War release (JFB)]
\def\infinitywait@N{1000000}
\AtEndDocument{%
   \immediate\write\@mainaux{%
    \gdef\string\infinitywait@N{\the\numexpr2*\infinitywait@N}}%
   \count@ \infinitywait@N\relax
   \loop
    \advance\count@\m@ne
   \ifnum\count@>\z@
   \repeat
}
\endinput

Better infinitywait.sty. Better clean out aux file of previous one before switch to this one...

\ProvidesPackage{infinitywait}
  [2017/09/29 v0.99 how to occupy the wait for Infinity War release (JFB)]
\def\infinitywait@N{1000}
\AtEndDocument{%
   \immediate\write\@mainaux{%
    \gdef\string\infinitywait@N{\the\numexpr1000+\infinitywait@N}%
   }%
   \count@ \infinitywait@N\relax
   \loop
    {\count@\infinitywait@N\relax
     \loop
     \advance\count@\m@ne
     \ifnum\count@>\z@
     \repeat}%
    \advance\count@\m@ne
   \ifnum\count@>\z@
   \repeat
}
\endinput

Tags:

Macros

Fun