Hello all,
I'm making a beamer presentation. How can I display LaTeX code inside a presentation? And inside a LaTeX document?
Text Formatting ⇒ beamer | Display verbatim LaTeX Code
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
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
Thorsten
fragile
option. For more information refer to the user guide.Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 90
- Joined: Sun Jun 24, 2012 8:48 pm
beamer | Display verbatim LaTeX Code
I am trying but no success. Image I need to make a new frame with this:
How can I write / display that code ?
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}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
beamer | Display verbatim LaTeX Code
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.How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10