
xlop
當resultstyle
樣式設定為文字時支援。如果沒有,有辦法隱藏樣式設定為文字的結果。
\documentclass{article}
\usepackage{xcolor}
\usepackage{xlop}
\usepackage{pstricks}
\begin{document}
\opadd[style=text,resultstyle=\color{white}]{1}{2}
\end{document}
答案1
此resultstyle
鍵對文字樣式沒有影響。我可以為您提供一個補丁,\op@textoperation
以不同的方式完成這項工作:
\documentclass{article}
\usepackage{xlop}
\usepackage{regexpatch}
\newif\ifshowresult
\newcommand{\showornot}[1]{%
\ifshowresult#1\else\phantom{#1}\fi
}
\makeatletter
\xpatchcmd*{\op@textoperation}{\Op@@r}{\showornot{\Op@@r}}{}{}
\makeatother
\begin{document}
X\opadd[style=text]{1}{2}X
\showresulttrue
X\opadd[style=text]{1}{2}X
\end{document}
的位置X
表示為結果留出了空間。