Text Environment (Part Four) - Quoting Commands and Environments

Text Environment (Part Four) - Quoting Commands and Environments #

Author: Erhua

Keywords: Quoting

In this section, we will discuss quoting, which can be done using commands or environments.

Commands:

\verb is used to represent quoted text in the text
\verb<label>content<label>, the content between two labels will be displayed exactly as it is, the label can be any identical symbol
\verb* can be used to display visible spaces
\documentclass[]{article}
\usepackage{ctex}
\begin{document}
\Large{\verb- &%^%^%^&%$% -}
\end{document}

Environments:

If there is too much text to be quoted, an environment must be used.

\begin{verbatim}%verbatim* can also display spaces
\end{verbatim}

The fancyvrb package provides a series of extensions for the verbatim environment, which can modify various content. You can refer to the package documentation by Zandt.