2

Does xlop support resultstyle when style is set to text. If it does not is there a way to hide the result with style set to text.

\documentclass{article}
\usepackage{xcolor}
\usepackage{xlop}
\usepackage{pstricks}
\begin{document}


\opadd[style=text,resultstyle=\color{white}]{1}{2}


\end{document}​

1 Answer 1

1

The resultstyle key has no effect in text style. I can offer you a patch to \op@textoperation that does the job in a different way:

\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}​

The X's are there to show that the space for the result is left.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .