# I redefined \- but it does not work in captions

I defined \+ and \- macros for conveniently entering notation. Surprisingly, I noticed that in table and figure captions \- does not work while \+ works. (The same problem appears also in the content of figures if they're made with TikZ.) Is there any explanation for this strange behavior? Perhaps, this is related to the fact that \- is normally used for hyphenation. But why should that matter after I redefined it?

Here is a minimal working example:

\documentclass{article}

\usepackage{amssymb}
\newcommand{\+}{\boxplus}
\renewcommand{\-}{\boxminus}

\begin{document}
Plus $\+$ and minus $\-$ work here.
\begin{figure}
\caption{Why does $\-$ not work in a caption while $\+$ works?}
\end{figure}
\begin{table}
\caption{Why does $\-$ not work in a caption while $\+$ works?}
\end{table}
\end{document}


• Don't do such bad stuff with \-
– user31729
Jul 30, 2015 at 20:20

The macro \caption executes \@parboxrestore, that in turn executes
\let\-\@dischyph

which means that, in a caption, \- gets again its original LaTeX meaning of \discretionary{-}{}{}. Indeed, if you look in the .aux file, you see
Why does $\discretionary {-}{}{}$ not work in a caption while $\boxplus$ works?