Text FormattingInline code in itemize environment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
sierra1bravo
Posts: 11
Joined: Sun Jan 04, 2009 7:28 am

Inline code in itemize environment

Post by sierra1bravo »

Dear all
I wish everyone a productive 2009!

I am a new user of the Beamer class, and I have a small problem. In a bulleted list (using \begin{itemize}) I would like to have some in-line code (actually some XML snippets). I tried

Code: Select all

\begin{itemize}
\item ...
\item For example, \verb#ACTION VIEW content://contacts/1# or \verb#ACTION\_DIAL tel:9447027274#
\end{itemize}
However, I get the error "Illegal parameter number in definition of \test.". What is the recommended way to quote code in-line?

thanks in advance


s1b

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Inline code in itemize environment

Post by localghost »

I'm not sure if this an issue of the code you provided here. It works fine with other document classes. The best way to clarify this would be to build a minimal working example (MWE) that reproduces the error. But there are some alternatives.

Since you don't want any LaTeX related commands to be typeset, you could use \texttt{...} instead of \verb|...|. A more comfortable solution is given with the listings package. It allows to typeset complete listings as well as some in-line code snippets.


Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Inline code in itemize environment

Post by josephwright »

You need to use the [fragile] modifier for frames when using anything verbatim.
--
Joseph Wright
Joseph Wright
Post Reply