答案1
这是一个选项,但是您确定要采用这种格式吗?
\documentclass[a5paper]{article}
\usepackage{listings}
\lstset{
columns=flexible,
basicstyle=\small\ttfamily,
mathescape=true,
escapeinside=||
}
\begin{document}
\begin{lstlisting}
123
$\times$ 456
======
738 (this is $123 \times 6$)
615 (this is $123 \times 5$, shifted one position to the left)
+492 (this is $123 \times 4$, shifted two positions to the left)
========
56088
\end{lstlisting}
\end{document}