Say you have some command in a part of the code. I want to execute that command at a later point, so that it can be set at a later point. E.g. a header, and you want to set the margin after some other stuff have been processed. Maybe this example explains it better. In this version pbagemark and \evaluateAtMark is the magic commands I'm looking for.
\documentclass{article}
\begin{document}
% The below would set a mark at this position on the page
\pagemark\SomeMark%
{\Large\bfseries Header}\newline
Lot's of text here, and this stuff along the way on this page
would deside e.g the new margin for the header, and now it should go back
to insert it.
% Now evaluate the following code at the aforementioned point
\evaluateAtMark\SomeMark{\hspace*-4em {\Large\bfseries Some header}}
% Now I want the \someAction to be evaluated by \triggerSomeActionLater
\end{document}
This doesn't run of course. This is what I want the code to do:
When \evaluateAtMark\SomeMark is run, then at the point of the page where \pagemark\SomeMark is run, the code \hspace*-4em {\Large\bfseries Some header} should be evaluated. Is there any way to do this in a fairly general way?
Please feel free to add tags to this question. I have no idea what to even google (I've tried quite a few things, but nothing related showed up).
auxfile at the end so it is in scope at the start of the document. (and you mean\hspacenot\hskip) – David Carlisle Jun 24 '18 at 12:32.aux-file – Andreas Storvik Strauman Jun 24 '18 at 12:40aux-file. If you make an answer I'll remove mine :) – Andreas Storvik Strauman Jun 24 '18 at 13:23