如何在 PDF 文档中以及终端/控制台中打印命令及其输出

如何在 PDF 文档中以及终端/控制台中打印命令及其输出

我发现了一个大符号列表和来源这里。我想简单地这样做:将每个命令放在新行上,并在第一列中评估该命令,在第二列中打印该命令。像这样:

α \A
β \B
...

我只是编造了这些命令,但本质上就是这样。在命令旁边打印输出。

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\begin{document}

\A --- \begin{verbatim} A \end{verbatim}

\aa --- \begin{verbatim} aa \end{verbatim}

\AA --- \begin{verbatim} AA \end{verbatim}

\AAaleph --- \begin{verbatim} AAaleph \end{verbatim}

\AAayin --- \begin{verbatim} AAayin \end{verbatim}

\AAbeth --- \begin{verbatim} AAbeth \end{verbatim}

\AAcht --- \begin{verbatim} AAcht \end{verbatim}

\AAdaleth --- \begin{verbatim} AAdaleth \end{verbatim}

\AAhe --- \begin{verbatim} AAhe \end{verbatim}

\AAhelmet --- \begin{verbatim} AAhelmet \end{verbatim}

\AAheth --- \begin{verbatim} AAheth \end{verbatim}

\AAkaph --- \begin{verbatim} AAkaph \end{verbatim}

\AAlamed --- \begin{verbatim} AAlamed \end{verbatim}

\Aaleph --- \begin{verbatim} Aaleph \end{verbatim}

\AApe --- \begin{verbatim} AApe \end{verbatim}

\AAqoph --- \begin{verbatim} AAqoph \end{verbatim}

\AAresh --- \begin{verbatim} AAresh \end{verbatim}

\AAsade --- \begin{verbatim} AAsade \end{verbatim}

\Aayin --- \begin{verbatim} Aayin \end{verbatim}

\AAyod --- \begin{verbatim} AAyod \end{verbatim}

\AB --- \begin{verbatim} AB \end{verbatim}

\Abeth --- \begin{verbatim} Abeth \end{verbatim}

\ac --- \begin{verbatim} ac \end{verbatim}

\AC --- \begin{verbatim} AC \end{verbatim}
\end{document}

但它没有起作用。

了解在编译时将输出记录到控制台也很有趣,也许更好。想知道如何做到这一点。

答案1

我不确定我理解了这个问题,但是这使得

\alpha: \mathchar"10B
\beta: \mathchar"10C
\longrightarrow: \long macro:->\DOTSB \protect \relbar \protect \joinrel \right
arrow 

和输出

在此处输入图片描述

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}

\def\zz#1{\par
\typeout{\string#1: \meaning#1}%
\makebox[5cm][l]{\texttt{\string#1}}\mbox{$#1$}\par}

\begin{document}

\zz\alpha
\zz\beta
\zz\longrightarrow
\end{document}

相关内容