Am 31.08.2010 18:35, schrieb Torquil Macdonald Sørensen:

My goal was to import a LaTeX file into LyX, but LyX was not able to
understand all the \newcommands in the document, and therefore I wanted
to preprocess the LaTeX file first.

What do you mean with LyX doesn't understand? LyX should import them as TeX-code and when you view it as PDF, you should see a PDF. If this is not the case and you get LaTeX-errors instead, you found a bug in LyX's TeX import program. If so, can you please provide a _small_ TeX testfile to be able to test?

I used a python package called plasTeX for this. It is able to parse
LaTeX files and will automatically expand the user-defined \newcommands
that are used throughout the document.

What is done by "expanding"? I mean one only uses \newcommand once and then use the defined command several times. Therefore you can safely put all \newcommands either at the beginning of the document, or better, at the end of the document preamble.

regards Uwe

Reply via email to