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)
\i, % REPLACE THIS LINE WITH SOMETHING THAT SQUANDERS A SHORT AMOUNT OF TIME
Then, as long as you get your user to
\input the file:
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.
\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
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.