Text Formatting ⇒ How to indicate a LaTeX command in LaTeX
How to indicate a LaTeX command in LaTeX
Dear all,
I need to write a document about LaTex and I need to indicate some LaTex commands inside my LaTex document without having such commands compiled in the usual way but just printed as it is written.
Just to give an example, how can I write the command \clearpage without having it working as usual but just printed out as normal text?
I know that there is the \begin{verbatim} option, but it does not work for my case.
My attempt is $\backslash$clearpage ...but I am not very sure...
Thanks in advance
I need to write a document about LaTex and I need to indicate some LaTex commands inside my LaTex document without having such commands compiled in the usual way but just printed as it is written.
Just to give an example, how can I write the command \clearpage without having it working as usual but just printed out as normal text?
I know that there is the \begin{verbatim} option, but it does not work for my case.
My attempt is $\backslash$clearpage ...but I am not very sure...
Thanks in advance
Last edited by frodojedi on Sat Feb 19, 2011 3:43 am, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

How to indicate a LaTeX command in LaTeX
Why not?frodojedi wrote: I know that there is the \begin{verbatim} option, but it does not work for my case.
Or what about \verb|\clearpage| for the inline version?
Simply "\textbackslash clearpage" could be more natural approach along the same lines.My attempt is $\backslash$clearpage ...but I am not very sure...
But see also the listings package and similar.
Re: How to indicate a LaTeX command in LaTeX
Hi thanks for answering.
\verb|\clearpage| is what I was searching for!
\verb|\clearpage| is what I was searching for!
Re: How to indicate a LaTeX command in LaTeX
I get this error when putting \verb|\clearpage| inside the command \footnote{}
! LaTeX Error: \verb illegal in command argument.
Help!
! LaTeX Error: \verb illegal in command argument.
Help!
How to indicate a LaTeX command in LaTeX
See this thread for suggestions on dealing with that problem.
Re: How to indicate a LaTeX command in LaTeX
Thanks, it works!!
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to indicate a LaTeX command in LaTeX
Then please mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules (to be read before posting).frodojedi wrote:Thanks, it works!!
Best regards and welcome to the board
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
How to indicate a LaTeX command in LaTeX
Even simpler with the help of the fancyvrb package. Check this example:
Code: Select all
\documentclass{article}
\usepackage{fancyvrb}
\DefineShortVerb{\|}
\VerbatimFootnotes
\begin{document}
The commands |\clearpage|, |\newpage| and |\pagebreak| have similar
purposes\footnote{There also exists the |\cleardoublepage| command.},
although there are essential differences among them.
\end{document}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.