我想做任务 - 添加到未知数字的列。
如何制作一切使其在盒子和数字的中心对齐?
数字位于数字下方,数字下方的方框,方框下方的数字?
\def\msquare{\mathord{\scalerel*{\Box}{gX}}}
\begin{multline*}
\begin{array}{r}
+
\begin{array}{r}
\msquare64\msquare\msquare\msquare\\
661977\\
\end{array}\\
\hline
\begin{array}{r}
1\msquare\msquare631\msquare
\end{array}\\
\end{array}
\end{multline*}
这可以使用数组完成。由于您的值只是正方形或数字,因此最好使用表格环境,其中可以更精细地控制列间间距。要做到这一点,更简单的是重新定义tabcolsep
长度,但是像数组这样的包可以提供其他方法来控制它。
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\begin{document}
% \def\msquare{\mathord{\scalerel*{\Box}{gX}}} % redifined, because I do know what \Box does.
\def\msquare{\raisebox{1mm}{\framebox[2mm][r]{}}}
\setlength{\tabcolsep}{0.5pt}
\begin{multline*}
\begin{array}{r}
+
\begin{tabular}{ccccccc}
&\msquare&6&4&\msquare&\msquare&\msquare\\
&6&6&1&9&7&7\\
\hline
1&\msquare&\msquare&6&3&1&\msquare
\end{tabular}\\
\end{array}
\end{multline*}
\end{document}
为避免在所有文档中重新定义tabcolsep
,请将此代码括在大括号中。