Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Build a math atom:

$\blackbox{{-y}}$
share|improve this answer

Another possibility:

\def\gobble#1{}
$\expandafter\gobble\blackbox{-y}$
share|improve this answer
    
+1 Thanks for adding more extra keystrokes. –  stalking is prohibited May 19 at 7:21
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 at 13:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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