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.

I am trying to find a way to define the % symbol as a binary operator that behaves essentially like the + symbol. I have heard of the command DeclareMathOperator, but I was under the impression that this was for operators like the logarithm and sine functions. What is an appropriate command? An an example, I would like the following to lines to have similar spacing.

\begin{equation*}
a % b % c
\end{equation*}
\begin{equation*}
a + b + c
\end{equation*}
share|improve this question

1 Answer 1

up vote 6 down vote accepted

If using macros to represent the new symbol is fine, then you have a couple of options:

enter image description here

\documentclass{article}
\newcommand{\percA}{\mathbin{\%}}
\newcommand{\percB}{\mathbin{\ooalign{$\hidewidth\%\hidewidth$\cr$\phantom{+}$}}}
\begin{document}
\[\begin{array}{|@{}c@{}|}
  a \percA b \percA c \\[\jot] % Option A
  a \percB b \percB c \\[\jot] % Option B
  a + b + c % Control
\end{array}\]
\end{document}

Option A \percA inserts \% as a binary math symbol using \mathbin{\%}. However, \% is slightly wider than +. That's where option B provides \percB which oversets a zero-width \% with a \phantom{+}.

For the inner working behind \ooalign, see \subseteq + \circ as a single symbol (“open subset”).

share|improve this answer
    
Why the Google short link? I don't remember exactly where, but I think short links are generally frowned upon on SE. –  doncherry Nov 13 '12 at 5:36
    
meta.stackexchange.com/q/29518/162565, meta.stackexchange.com/q/99136/162565, meta.stackexchange.com/q/64450/162565 -- not a clear ban of shortened URLs, but definitely a distinct dislike. –  doncherry Nov 13 '12 at 5:42
    
@doncherry: The motivation was purely out of self-interest to track badge progress, since Google's URL shortner provides a "CLICKS" tally. There's no other way to estimate progress on badges like Announcer, Booster or Publicist. Do you know whether a tool for tracking these badges exist, even through some Ninja search or the Data Explorer? –  Werner Nov 13 '12 at 6:00
    
No, none that I know of. While I don't think it's very likely, there might yet be one; I just recently learned that anonymous and low-rep user feedback is accessible via data.se .. even though it seems broken now, these queries used to work: data.stackexchange.com/tex/query/73917/…, data.stackexchange.com/tex/query/60668/feedback-on-my-posts –  doncherry Nov 13 '12 at 6:05
    
@doncherry: This seems to still be an open question on Meta.SO, dating back to 2010: View progress towards Announcer badge. Even then, one of the mods "suggest" a URL shortner. :-| –  Werner Nov 13 '12 at 6:26

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.