
答案1
這種方法絕不是自動化的,而是可以手動工作。它使用\boxxed
巨集將東西放入盒子中。然而,仍然需要手動幹預,如下所示:\mathop
並且\mathrel
必須手動引入盒裝運算符或關係,因為盒子會刪除其任何記憶。
\ThisStyle{...\SavedStyle...}
包的語法用於scalerel
在\scriptstyle
進入盒子後以適當的樣式保存參數。
好消息是字偶距得以保留。
\documentclass{article}
\usepackage{amsmath}
\fboxrule=.1pt
\fboxsep=-.1pt
\usepackage{scalerel}
\newcommand\boxxed[1]{{\ThisStyle{\fbox{$\SavedStyle#1$}}}}
\begin{document}
\( \mathop{\boxxed{\sum}}_\boxxed{i}^\boxxed{n} \boxxed{A}^\boxxed{2}\)
\( \sum_i^n A^2\)
\( \displaystyle\mathop{\boxxed{\sum}}_\boxxed{i}^\boxxed{n} \boxxed{A}^\boxxed{2}\)
\( \displaystyle\sum_i^n A^2\)
\end{document}