# Passthrough TeX input [closed]

I need to convert a document that was written in TeX to some other format.

The other format supports a TeX style mathmode, so I would like to turn every mathmode formula into verbatim.

I tried turning each formula into a verbatim environment, but this does not work, as an end statement has to be visible at the same time as an begin statement is encountered.

How can I achieve something like that?

pandoc et al are not an option. There is too much customization in the TeX processor used for those documents to work.

A small example:

I would like the input

$$\left\{ \min_{3, 5} \right\}$$


To be output as exactly that, without having to modify the .tex files.

More explanation of what I'm doing here:

I have a huge style file, which defines a domain specific language for documentation, and a custom (somewhat conforming) latex interpreter that is used to output HTML code. I want to transfer the current LaTeX documents into a new document format. For that I'm modifying the style-files to adapt some constructs to the new format. The mathmode constructs are especially troubling and always get modified in ways I cannot really comprehend. Thus, I'm asking if there is a standard way to turn every latex formula into its verbatim equivalent.

-

## closed as not a real question by Joseph Wright♦Jul 8 '12 at 11:59

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

Can you be more explicit - perhaps a short MWE, showing what the input TeX looks like and what the output should be, in its new format? A script (python or perl or awk) may be your best bet. –  Ethan Bolker Jun 15 '12 at 12:34
Does this really have something to do with TeX? You wouldn't use TeX for the conversion, would you? –  egreg Jun 15 '12 at 12:47
I don't understand. You have explained to us that you want the mathmode stuff to not be modified. Fine. But unless we know how the other stuff is being modified, it isn't clear what mathmode needs protecting from. –  Seamus Jun 15 '12 at 13:00
I don't understand. :( –  egreg Jun 15 '12 at 13:00
it's not clear to me how this stuff would be written in your original document. if i wanted <verbatim> stuff to go to a file, i would use the verbatimwrite env from moreverb (or some similar verbatim pkg), but that prevents your document from showing the stuff in the first place. so i guess i'm yet another person wanting clarification of your process. sigh... –  wasteofspace Jun 15 '12 at 15:22