I would like to programmatically capture a subset of a latex document, something like:
doc = new Doc("foo.tex")
node = doc.getNode("bar")
print node.text
where node "bar" would be delimited by some tags, put for example in comments:
%% <bar>
This the \textbf{node content}
%% </bar>
How to do this?
awkone-liner that removes everything outside of the tags. But whether this is adequate depends on the environment in which you want to use it. Using LaTeX to extract the fragments is certainly an overkill since you need a TeX installation for that. But let's see whether someone comes up with a TeX solution to the problem; I wouldn't hold my breath, though. – gernot Dec 08 '16 at 12:44