4

Assuming that we cannot change the implementation of \blackbox that is

\def\blackbox#1{{}#1}

What should we pass to \blackbox such that $\blackbox{<something we need to pass>}$ produces the same result as $-y$? In other words, how can I cancel the effect of {} defined in \blackbox?

\documentclass[preview,border=12pt,12pt,varwidth]{standalone}
\usepackage{amsmath}

\def\blackbox#1{{}#1}

\begin{document}
\noindent\huge
$-y$\\ % output that I want to achieve 
$\blackbox{-y}$ % how can I remove the effect of {} in \blackbox?
\end{document}

enter image description here

Real scenario

I want use \equ for representing $-3y=59$ but if I use \equ{}{-3y}{59} the output is not identical because of the prefix {} defined in \equ.

\documentclass[preview,border=12pt,12pt]{standalone}
\usepackage{mathtools,booktabs}

\newcommand\specifier{%
        r@{}r@{}l
        @{\quad}c@{\quad}
        r@{}r@{}l
        @{}c}

\newcommand\act[1]{\xrightarrow{\quad\mathclap{\times #1}\quad}}
\newcommand\ope[1]{~\smash{\raisebox{.8\normalbaselineskip}{$#1$}}}
\newcommand\equ[3]{{}#1 & {}#2 & {}=#3}

\begin{document}
$
    \begin{array}{\specifier}
     \equ{3x}{+3y}{7} & \act{1} & \equ{3x}{+3y}{7}            \\[\jot]
     \equ{3x}{}{22}   & \act{3} & \equ{3x}{}{66}   & \ope{-}  \\\cmidrule{5-7}
         &&           &         & \equ{}{-3y}{59}             \\[\jot]
         &&           &         & \equ{}{y}{-59/3}            \\
    \end{array}
$
\end{document}

enter image description here

5

Build a math atom:

$\blackbox{{-y}}$
3

Another possibility:

\def\gobble#1{}
$\expandafter\gobble\blackbox{-y}$
  • 1
    @MoneyOrientedProgrammer This answer does in fact more closely answer your question (as stated in the title) although Herbert's answer is better for the particular application. – David Carlisle May 19 '14 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.