Text Formatting\verb in title (\chapter)?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
amoz
Posts: 14
Joined: Mon Mar 16, 2009 1:42 pm

\verb in title (\chapter)?

Post by amoz »

Hi all,

I wonder how I can put one word in verbatim in the title of a book chapter.

I would like to use something like

Code: Select all

\chapter{Inventory of \verb#r.le# Routines}
Thanks for helping me out!

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

\verb in title (\chapter)?

Post by localghost »

Neither the \verb command nor the verbatim environment can be used as arguments to other commands. But you can try typewriter style.

Code: Select all

\chapter{Inventory of \texttt{r.le} Routines}

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
amoz
Posts: 14
Joined: Mon Mar 16, 2009 1:42 pm

Re: \verb in title (\chapter)?

Post by amoz »

This is the work-around I was looking for! Thanks a lot.
Post Reply