Text Formattingbeamer | Display verbatim LaTeX Code

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

beamer | Display verbatim LaTeX Code

Post by paulosousa »

Hello all,

I'm making a beamer presentation. How can I display LaTeX code inside a presentation? And inside a LaTeX document?

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

beamer | Display verbatim LaTeX Code

Post by localghost »

In general you can use either listings or minted. Possible solutions can be found by a Forum Search. In the beamer class the concerned frames will need the fragile option. For more information refer to the user guide.


Thorsten
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

beamer | Display verbatim LaTeX Code

Post by paulosousa »

I am trying but no success. Image I need to make a new frame with this:

Code: Select all

\begin{frame}[fragile]
\frametitle{Create a document}
Every time you need to start a new document you need to put \documentclass[options]{class} 
\end{frame}
How can I write / display that code ?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

beamer | Display verbatim LaTeX Code

Post by localghost »

Take a look at the \verb command. For longer pieces of code use the {verbatim} environment. If you want to have even short code snippets with syntax highlighting, the packages I suggested earlier are the way to go. If that doesn't help, provide a minimal example.
Post Reply