TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am writing a script for LaTeX shallow parsing (assuming that there are no complicated definitions in the preamble). First of all I decided to check the document for in-line verbatims and comments, because they make TeX meta characters inactive. I have managed to parse document into three different types: inlineVerbatim, inlineComment and Other. However I am still wondering, are there any other in-line commands, that make any of the metacharacters {}\#^_$&%~ inactive or force to have different syntax meaning? Also it would be a big help if someone told me about enviroments with the same properties besides verbatim,comment and listling.

share|improve this question

closed as unclear what you're asking by Joseph Wright Aug 7 '13 at 11:23

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

What is the ultimate goal of your script? If you can explain a bit more, that might help. One thing you may want to scan for is \string. – G. Poore Feb 14 '13 at 18:26
in the base latex format there are \verb verbatim verbatim* and to some extent \index. But you also mention comment and listing which are from contributed packages. If you include arbitrary packages the list is endless, the commands of fancyvrb for example – David Carlisle Feb 14 '13 at 18:26
I am working with other people TeX files, so I am trying to write simple script that tries to parse document with most commonly used LaTeX commands and packages. My first goal would be to create dvi file, delete all comments, generate another dvi and compare source code. If they are identical, continue working with clean source. Another goal would be ability to check some patterns in different environments. I understand that full analysis is impossible, because TeX is quite complicated language. In advance knowing some packages and commands that changes usual syntax would be helpful. – user21710 Feb 15 '13 at 7:50

Browse other questions tagged or ask your own question.