Question: adjusting latex output

Is is possible to tell the latex output what to do if it finds a symbol?

Suppose I have the following expression:

O3^2 + k_O3NO

The normal latex output just takes it as it is and also translates k_O3NO to k_O3NO with the underscore.

I however want it to read (latex notation in math mode)

\left[ \text{O}_3 \right]^2 + k_{\text{O}_3\text{NO}}

So is that possible without changing everything manually?

 

edit: Just as a remark, the output at the moment for this expression reads

{{\it O3}}^{2}+{\it k\_O3NO}

and is kinda awful if compiled in latex...

Is it also possible for maple to latex realizing where a line-break is necessary?

Please Wait...