我怎样才能只将一个单词‘逐字’化?

我怎样才能只将一个单词‘逐字’化?

如何在 LaTeX 中仅将一个单词变为“逐字”?

例如:

\usepackage{verbatim}
\begin{document}
The\begin{verbatim} TableForm[]\end{verbatim} shown below is a trig table which....

我唯一想要“逐字”的是 TableForm[]。但当我这样做时 begin{verbatim} TableForm[] \end{verbatim},我删除了其余的单词

我希望我的最终输出看起来像这样:

在此处输入图片描述

这是我目前所拥有的:

\documentclass[12pt]{book}
\usepackage{verbatim}
\usepackage{amsmath, amssymb,graphicz,wasysym}

\begin{document}
\begin{verbatim}
\item{The \texttt{TableForm[]} shown below is a trig table which shows sine, cosine, and tangent values for integer angles from $0^{\circ}$ through $90^{\circ}$ in steps of $3^{\circ}$. Like we said in class, we could save \verb|TableForm[]|  as a PDF and import it like we've done a few times.}
\bigskip
\end{verbatim}

答案1

当额外的verbatim环境\item被删除时,您的代码可以正常工作:

\documentclass[12pt]{book}

\begin{document}
The \texttt{TableForm[]} shown below is a trig table which shows sine, cosine,
and tangent values for integer angles from $0^{\circ}$ through $90^{\circ}$ in
steps of $3^{\circ}$. Like we said in class, we could save \verb|TableForm[]|
as a PDF and import it like we've done a few times.
\end{document}

在此处输入图片描述

\begin{verbatim} ... \end{verbatim}...按照代码中给出的文字逐字输出文本,因此其中的所有 LaTeX 命令都将被忽略。仅当您要排版较长的源代码列表或类似内容时才应使用此环境。

相关内容