Is it possible to push or pop a length like parindent? I want to change it temporarily but reset it soon after.
I have a solution but looking for something a little nicer. I'll post it as an answer.
You can implement a stack without using LaTeX3 as well, by using a token list and some macros. That would work as follows:
It will print
|show 5 more comments|
Just say, in your preamble,
and, when you want to change the
Then you can restore the previous
This is even unnecessary if you use the environment structure:
so that the change to
A stack based solution is easily obtained with LaTeX3:
This will show in succession 15.0pt, 100.0pt, 50.0pt, 100.0pt, 15.0pt; the command
Here's a version with "standard LaTeX":
|show 2 more comments|
You can create a new macro length and add
When you are ready to restore
There is also a stack based solution but maybe less efficient.
With lualatex you can simply use a stack in lua with a tex macro wrapper. Should be pretty self-explanatory.
|show 6 more comments|
Here is another solution for pushing and popping dimensions. It allows many measures to be pushed or popped at once.
This solution is just a response to Roelof. I hope it is appropriate here. I replace