Text Formatting ⇒ How to indicate a LaTeX command in LaTeX
How to indicate a LaTeX command in LaTeX
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
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
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
\verb|\clearpage| is what I was searching for!
Re: How to indicate a LaTeX command in LaTeX
! LaTeX Error: \verb illegal in command argument.
Help!
How to indicate a LaTeX command in LaTeX
Re: How to indicate a LaTeX command in LaTeX
- 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
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
How to indicate a LaTeX command in LaTeX
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}