may I propose to use the lstlisting environment for Latex files instead of verbatim. Lstlisting has much better support for Matlab than verbatim, concerning the formatting of Matlab commands.
Uwe Brauer
Subject: Publish to Latex: lstlisting instead of verbatim
"Matthew Simoneau" <matthew@mathworks.com> wrote in message <go1nup$rol$1@fred.mathworks.com>...
> I looked at using listing, but was worried about introducing another dependency.
looking at your email address I see that you are a working for mathworks.
Which dependecies are you afraid off?
Subject: Publish to Latex: lstlisting instead of verbatim
I'm not really a LaTeX expert, so I don't know I've got this right. My understanding is that this is a separate package that the user would have to install separately.
Subject: Publish to Latex: lstlisting instead of verbatim
"Matthew Simoneau" <matthew@mathworks.com> wrote in message <go9le2$43l$1@fred.mathworks.com>...
> I'm not really a LaTeX expert, so I don't know I've got this right. My understanding is that this is a separate package that the user would have to install separately.
Well some years ago, this was correct, but meanwhile the most popular latex distribution (texlive for the linux world and miktex) include lslistings.
To be on the save side it could be implemented optionally:
publish('foo.m','latex','lslistings')
or something like this
Uwe
Subject: Publish to Latex: lstlisting instead of verbatim
"Matthew Simoneau" <matthew@mathworks.com> wrote in message <gohbbd$rig$1@fred.mathworks.com>...
> Thanks for the info, Uwe. I'll put this back in the enhancement pile.
>
> Just so you know, you can copy toolbox/matlab/codetools/private/mxdom2latex.xsl, modify it to your liking, and specify it as a custom stylesheet.
Great! I do this, the only thing I am uncertain about is how to specify it as a custom stylesheet, but I would just make a backup copy of the old one and modify the mxdom2latex.xsl
Uwe
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.