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.

One needs often a symbol to denote the quotient of two (algebraic) objects. (e.g. quotient by a subgroup, subring, submodule etc.). In simple cases people use A/B. But when both A,B are complicated to write, this doesn't look good. e.g. \mathcal{O}_{(V',0)}}/\mathcal{O}_{(V,0)}}

For some reasons people do not use just \frac{A}{B}. Is there some way to achieve the following:

$A$ raised a bit, then \Big/ then $B$ a bit lowered.

share|improve this question
add comment

4 Answers 4

up vote 12 down vote accepted

How about using \left, \right, and \raisebox?

\newcommand{\bigslant}[2]{{\raisebox{.2em}{$#1$}\left/\raisebox{-.2em}{$#2$}\right.}}

\begin{equation}
\bigslant{\mathcal{O}_{(V',0)}}{\mathcal{O}_{(V,0)}}
\end{equation}

which gives

alt text

The only problem is that I need to re-enter mathmode inside the \raiseboxes. Anyone know how to avoid that?

share|improve this answer
1  
Would it not be a better solution to make the slash a mid, as opposed to a left delimiter, as in: \left.\raisebox{.2em}{$#1$}\mid/\raisebox{-.2em}{$#2$}\right. Note that this requires the amsmath package. –  Nick Loughlin Jun 14 '11 at 18:32
    
Sorry, that \mid should have been \middle. –  Nick Loughlin Jun 14 '11 at 19:08
    
Yes, I agree, using middle is a better idea. –  Yossi Farjoun Jun 26 '11 at 6:11
    
The problem with this solution, is that the parameters are interpreted as inline command. E.g. if I write \bigslant{\bigcup_{n \in \mathbb N} S_n}{\sim} the indices are written aside the \bigcup symbol, instead of under it. Do you know how to avoid it? –  Giacomo d'Antonio Mar 19 '12 at 12:54
    
Nevermind, I found a solution. I use \bigcup\limits_{n \in \mathbb N}. –  Giacomo d'Antonio Mar 19 '12 at 13:02
add comment

I give a very small amelioration which takes care of the different math styles.

% Source : http://tex.stackexchange.com/questions/4624/a-symbol-for-the-quotient-of-two-objects

\documentclass[10pt,a4paper]{article}
    \usepackage[utf8x]{inputenc}
    \usepackage{ucs}
    \usepackage{amsmath}
    \usepackage{amsfonts}
    \usepackage{amssymb}

    \newcommand\quotient[2]{
        \mathchoice
            {% \displaystyle
                \text{\raise1ex\hbox{$#1$}\Big/\lower1ex\hbox{$#2$}}%
            }
            {% \textstyle
                #1\,/\,#2
            }
            {% \scriptstyle
                #1\,/\,#2
            }
            {% \scriptscriptstyle  
                #1\,/\,#2
            }
    }

    \newcommand{\setA}{{\cal O}_{(V',0)}}
    \newcommand{\setB}{{\cal O}_{(V,0)}}

\begin{document}

One formula in one text : $\frac{4}{5} = \quotient{\setA}{\setB}$
and one formula alone...
\[
    \frac{4}{5} = \quotient{\setA}{\setB}
\]


What about quotient of quotients ?
\[
    \quotient{\left( \quotient{\setA}{\setB} \right)}{\left( \quotient{\setA}{\setB} \right)}
\]
Better like this ?
\[
    \quotient{\textstyle \left( \quotient{\setA}{\setB} \right)}{\textstyle \left( \quotient{\setA}{\setB} \right)}
\]

\end{document}
share|improve this answer
add comment

Something like:

\documentclass{article}

\def\quotient#1#2{%
    \raise1ex\hbox{$#1$}\Big/\lower1ex\hbox{$#2$}%
}

\begin{document}
\[
\quotient{\mathcal{O}_{(V',0)}}{\mathcal{O}_{(V,0)}}
\]
\end{document}

Update, here is a real plain example:

\def\quotient#1#2{%
    \raise1ex\hbox{$#1$}\Big/\lower1ex\hbox{$#2$}%
}

$$
\quotient{{\cal O}_{(V',0)}}{{\cal O}_{(V,0)}}
$$
\bye
share|improve this answer
    
That is essentially the same as Yossi's answer, albeit more plainish. –  Khaled Hosny Oct 27 '10 at 14:29
1  
$$ ... $$, really? You should have \m@th inside the inline math in your \hboxes. –  TH. Oct 27 '10 at 14:29
    
When I wrote it first it was a plain TeX file, but since there is no \mathcal in plain I quickly converted the document to LaTeX just to try it. –  Khaled Hosny Oct 27 '10 at 14:31
    
In plain TeX you can use ${\cal O}_{(V',0)}$ –  Aditya Oct 28 '10 at 5:55
add comment

If you want to invoke the Someone Else's Problem principle, there's also the faktor package, which ostensibly was designed to do what you want, and which implements using the AMS symbol \diagup. But IMHO the slash is a bit small.

For in-line expressions, you can also consider the nicefrac package, which makes both the "denominator" and "numerator" small.

share|improve this answer
    
Also see tex.stackexchange.com/questions/3893/… –  Willie Wong Oct 27 '10 at 16:16
    
The current thing to use instead of nicefrac is apparently xfrac. –  Caramdir Oct 27 '10 at 20:44
    
@Caramdir: thanks for pointing that out. –  Willie Wong Oct 27 '10 at 22:47
1  
Thanks for mentioning my package. I'll have a look on what can be done against the too small slash. –  Paŭlo Ebermann Jul 31 '11 at 4:36
add comment

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.