
Admite xlop
cuando resultstyle
el estilo se establece en texto. Si no es así, ¿hay alguna manera de ocultar el resultado con el estilo establecido en texto?
\documentclass{article}
\usepackage{xcolor}
\usepackage{xlop}
\usepackage{pstricks}
\begin{document}
\opadd[style=text,resultstyle=\color{white}]{1}{2}
\end{document}
Respuesta1
La resultstyle
clave no tiene ningún efecto en el estilo del texto. Puedo ofrecerte un parche \op@textoperation
que hace el trabajo de una manera diferente:
\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}
Los X
's están ahí para mostrar que queda espacio para el resultado.