\verb 内容超出页面范围

\verb 内容超出页面范围

数据\verb正在流出页面。

\begin{itemize}
\item 
\verb |Now is the winter of our discontent Use the sample text below, or else you can replace it by typing over or pasting in your own block of text.|
\end{itemize}

输出: 在此处输入图片描述

有什么解决办法?

答案1

如果您喜欢不好的做法,请将文本拆分为几个\verb\allowbreakwhile分隔的命令的参数\sloppy

\documentclass{article}

\begin{document}
\begin{itemize}
\item \sloppy
\verb|The Eastern world, it is explodin' |\allowbreak
\verb|Violence flarin', bullets loadin' |\allowbreak
\verb|You're old enough to kill but not for votin' |\allowbreak
\verb|You don't believe in war, but what's that gun you're totin'? |\allowbreak
\verb|And even the Jordan river has bodies floatin' |\allowbreak
\verb|You don't believe we're on the eve of destruction |\allowbreak
\verb|No no, you don't believe we're on the eve of destruction |
\end{itemize}
\end{document}

在此处输入图片描述

答案2

使用verbatim环境。

% verbatimprob.tex
\documentclass{article}
\begin{document}
Some regular text.

\begin{verbatim}
  A verbatim line
Another line
And an even longer one.
\end{verbatim}

Followed by nornmal text.
\end{document}

在此处输入图片描述

相关内容