0

Is it possible to define such two macros \start_recording: and \stop_recording:, so that everything between them can be saved (possibly verbatimly) to \the_recording_tl, and when applying \the_recording_tl one can obtain again those contents in the document?

This is almost the same demand as in this question. But I am expecting something clever with expl3, which is merely mentioned there.


The motivation of this question is that I would like to save the content of some environments (for example the abstract and proofs) and show them later. In an old package, I did this by using fancyvrb's VerbatimOut environment to write them to auxiliary files and read them in later (see, e.g. this answer). However, this approach seems to be quite messy and it has the side effect that contents on the same line with \start_recording: will sometimes lead to errors or lost of data.

Jinwen
  • 8,518
  • 1
    Take a look at the scontents package: it does (if I understood) exactly what you want – Phelype Oleinik Feb 07 '22 at 00:17
  • Personally I feel like expl3 is great for programming logic. For a lot of catcode trickery, using traditional LaTeX interfaces is probably more convenient. I don't see why the xparse solution doesn't work for now. – Alan Xiang Feb 07 '22 at 05:13
  • @PhelypeOleinik Thank you, I just realized that there is such a wonderful package! – Jinwen Feb 07 '22 at 05:41
  • 1
    @AlanXiang I get it. By the way, thank you so much for your expl3 guide, it really helps a lot for a beginner. – Jinwen Feb 07 '22 at 05:44

0 Answers0