views:

585

answers:

3

Hi there,

I've long had a dream of creating a "consistent comparison" operator to use in my homework (in LaTeX). That is, in some long derivation, we might want to know how $a$ compares to $b$, and although this is totally contrived, an example might read

\begin{align*}
    a &? b \\
    f(a) &? f(b) \\
    f(a) &= f(b) \text{by assumption} \\
    \implies a &= b
\end{align*}

That is, we start by saying, "this comparison should be consistent throughout the derivation", and then we later see that ? (the comparison operator) can be replaced with =. This notation is clearly crappy, and now that I'm doing more group work, it'd be nice to have something that's a bit more graphically intuitive.

I've got a pipe dream of a little circle with a question mark inside or on top of it. Trouble is, I have no idea how to do individual character sizing/alignment in LaTeX macros. So far, I've come up with

\def\mycomparator{\circ^{\!\!\!?}\,}
$a \mycomparator b$

(that is, a small circle with a superscript question mark, backshifted three places, then some right padding to get the left-hand side of the comparator properly placed)

While this functions, it's not exactly what I'm looking for and (even worse) is a talentless, disgusting hack.

How can I achieve this goal?

Thanks!

+3  A: 

According to The Comprehensive LaTeX Symbol List, you can use \textcircled{?} for this symbol.

Chip Uni
Great, thanks! Still, the symbol comes out pretty hillbilly with that command; in any case, more robust than what I had. If I don't see a better suggestion in the next day or so, I'll accept your answer.
kyle
+3  A: 

Try the following (not tested):

\newcommand{\mycomparator}{\stackrel{?}{\circ}}

Also look up \mathrel, it can be used to make arbitrary symbolds into a relation for correct math spacing.

Mathematically your idea is not so brilliant, as different relations obey different rules. For an example, multiply both sides of an inequation by a negative number.

Actually, standard practice would use an uppercase R for a general relation, i.e. \mathrel{R} for proper spacing. You can use subsequent letters or indices if you need more than one.

For a general transitive relation I'd use some nonstandard comparison symbol like \preceq or \prec, depending on whether it is reflexive or not.

\circ is normally used for a general binary operation, or for function composition.

starblue
Excellent, almost exactly what I'm looking for.I agree that it's a slightly shady tactic, but used appropriately it's quite a useful terminology (and certainly more intuitive than, "The binary relation k(a,b) will continue to hold as...", as would be logically correct). If you're careful to apply only positive affine transformations, there's no harm; in fact, by your statement, usage of < and > wouldn't be so sharp, either, as they don't hold under inversion. I submit that the notation is appropriately suggestive, in that equivalence of statements is used throughout derivations. Anywho...
kyle
I do enjoy a good \succ, \prec, etc. but sadly the domain of this issue (which I didn't express) won't allow it -- we're already using \succ_i to represent the underlying preference relation of various consumers. I do think that being consistent and using R is a good idea, but again -- more excuses -- in this case R is the aggregate endowment of the economy and \bar{R} is the upper bound on such. Silly economists and keeping variables consistent across proofs.
kyle
(and that's serious -- it chews up variables like no one's business) And although \circ *should* represent functional composition, in situations where there's no ambiguity I see no reason that adding a decorator to an existing operator would lead to confusion. If I were writing a textbook and not homework, there might be more consideration, but as-is there are enough references to \phi as a parameter and also as the PDF of the normal distribution (consistent across proofs \neq consistent within proofs) to make me want to pass on the pain.
kyle
+2  A: 

If you want a symbol that actually looks nice, then I'm guessing you will need to properly design something, with proper scaling, say working with the font representation of the question mark, and incorporating the circle.

Take a look at metapost or spiro.

Charles Stewart
In truth, that's probably the "right" answer; however, I'm really looking to constrain this to existing tools (on my computer).
kyle