盒装逐字环境消失

盒装逐字环境消失

我想将包含逐字环境的框居中。下面的(几乎)MWE 是我尝试使用答案 中心对齐逐字环境

\documentclass{article}
\usepackage{verbatimbox}
\usepackage{amsmath}

\begin{document}
The table at \verb!http://www.census.gov/govs/state/10lottery.html!
lists the following data for the 2010 Texas lotteries:

\begin{center}
\begin{verbbox}
  Income               Apportionment of funds
(ticket sales      Prizes  Administration  Proceeds
  excluding                               available
  commissions)
  3,542,210       2,300,182   184,980     1,057,048
\end{verbbox}
\end{center}

Since
%
\begin{equation*}
\frac{2,300,182}{3,542,210} = 0.649363533 \approx 65\%
\end{equation*}
%
Texas returned 65 cents on the dollar in lottery payouts in 2010 --
three cents more than the national average.

\end{document}

在输出中,方框内的文字消失了:

在此处输入图片描述

答案1

您必须发出\theverbbox才能打印逐字文本。但是,verbbox环境不应该在 内center

我还添加了如何使用fancyvrb及其BVerbatim环境。我还使用了\urlURL。

\documentclass{article}
\usepackage{verbatimbox,fancyvrb,url}
\usepackage{amsmath}

\begin{document}

The table at \url{http://www.census.gov/govs/state/10lottery.html}
lists the following data for the 2010 Texas lotteries:
\begin{verbbox}
  Income               Apportionment of funds
(ticket sales      Prizes  Administration  Proceeds
  excluding                               available
  commissions)
  3,542,210       2,300,182   184,980     1,057,048
\end{verbbox}
\begin{center}
\theverbbox
\end{center}

Since
\begin{equation*}
\frac{2,300,182}{3,542,210} = 0.649363533 \approx 65\%
\end{equation*}
Texas returned 65 cents on the dollar in lottery payouts in 2010 --
three cents more than the national average.

\begin{center}
\begin{BVerbatim}
  Income               Apportionment of funds
(ticket sales      Prizes  Administration  Proceeds
  excluding                               available
  commissions)
  3,542,210       2,300,182   184,980     1,057,048
\end{BVerbatim}
\end{center}

\end{document}

在此处输入图片描述

相关内容