Verbatim inside math mode

5,223 views
Skip to first unread message

Victor

unread,
Sep 28, 2009, 1:57:49 AM9/28/09
to LaTeX Users Group
Hi

How can I typeset verbatim inside math mode? For example, I want to
have a fraction \[\frac{a}{b}\] but with a, b in verbatim mode.

Thanks.

Ariovaldo V Garcia

unread,
Sep 28, 2009, 8:01:38 AM9/28/09
to latexus...@googlegroups.com
Hi
I'm affraid that what you want is not possible. Anyway, there is a
package - alltt - that permits you to write math equations inside a
verbatim environment.


Regards

Ariovaldo

Bruno Lopes

unread,
Sep 28, 2009, 12:54:02 PM9/28/09
to latexus...@googlegroups.com
Maybe you can try something like:

$\textnormal{\verb+TTT+}$


Bruno.

2009/9/28 Ariovaldo V Garcia <garc...@gmail.com>



--
Bruno Lopes Vieira

Linux User #324250
Curriculum Vitae: http://lattes.cnpq.br/7793315334001237
--
"Never express yourself more clearly than you are able to think."
(Niels Bohr)

Victor

unread,
Sep 28, 2009, 9:20:17 PM9/28/09
to LaTeX Users Group
Thanks. But it doesn't work here. Maybe it's impossible. Thanks
anyway.

On Sep 29, 12:54 am, Bruno Lopes <blopesvie...@gmail.com> wrote:
> Maybe you can try something like:
>
> $\textnormal{\verb+TTT+}$
>
> Bruno.
>
> 2009/9/28 Ariovaldo V Garcia <garcia...@gmail.com>
>
>
>
>
>
>
>
> > Hi
> > I'm affraid that what you want is not possible. Anyway, there is a
> > package - alltt -  that permits you to write math equations inside a
> > verbatim  environment.
>
> > Regards
>
> > Ariovaldo
>
> > On Mon, Sep 28, 2009 at 2:57 AM, Victor <vaci...@gmail.com> wrote:
>
> > > Hi
>
> > > How can I typeset verbatim inside math mode? For example, I want to
> > > have a fraction \[\frac{a}{b}\] but with a, b in verbatim mode.
>
> > > Thanks.
>
> --
> Bruno Lopes Vieira
>
> Linux User #324250
> Curriculum Vitae:http://lattes.cnpq.br/7793315334001237
> --
> "Never express yourself more clearly than you are able to think."
> (Niels Bohr)- Hide quoted text -
>
> - Show quoted text -

Krishnan

unread,
Sep 29, 2009, 8:30:34 PM9/29/09
to LaTeX Users Group


On Sep 28, 10:57 am, Victor <vaci...@gmail.com> wrote:

> How can I typeset verbatim inside math mode? For example, I want to
> have a fraction \[\frac{a}{b}\] but with a, b in verbatim mode.

Please try

\usepackage{fancyvrb}

\SaveVerb{nr}=a=
\SaveVerb{dr}=b=


\[\frac{\UseVerb{nr}}{\UseVerb{dr}}\]
Reply all
Reply to author
Forward
0 new messages