Text FormattingShowing verbatim code

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Showing verbatim code

Post by coachbennett1981 »

This is bugging me, so simple, yet I don't know how to do it. I am working on a presentation and I want to show LaTeX code in the document without actually creating what I am typing. For example,

To show a displayed fraction we use the \frac command. How do I show just what I type \frac. and not have to put \frac{a}{b}.


Arghh.
Nick

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Showing verbatim code

Post by Stefan Kottwitz »

Hi Nick,

you could use the \verb command for simple small code examples, or the listings or the showexpl package which offer many features for typesetting code.

Stefan
LaTeX.org admin
Post Reply