I have a .tex document(external.tex, for example) whose content is like this:
...
...
%*#<start>
some code
%*#<end>
...
...
%*#<start>
some other code
%*#<end>
...
...
I want to input all the parts wrapped between a pair of %*#<start ... %*#<end> of this file to my main doc. How can I do it?
\documentclass{article}
\inputmultiparts{external.tex}
\begin{document}
% using code from "external.tex"
\end{document}
catchfilebetweentagspackage can only treat(find) the first pair of dilimiter tags it finds. In my example, there maybe many such tags which all need to be input to the main document. – lyl Jun 15 '22 at 04:15\verbatim@addtolinewithverbatimpackage. – muzimuzhi Z Jun 15 '22 at 04:51external.texchange often? where does it come from? which operating system do you use? is it just for you or also for other people?) it may be easier to process the file with grep or awk or perl etc., either fully separated from the LaTeX compilation or with a system call from within your document. – Marijn Jun 15 '22 at 12:17external.texchanges often. It collects many macros that are for me in myWindowssystem. – lyl Jun 16 '22 at 00:24tags. It would cost a lot if there are many differenttagsin the file. I wonder if there is method to extract all parts between pairs of tags with same name. – lyl Jun 16 '22 at 02:10