26

One often needs 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 and B are complicated to write, this doesn't look good. e.g. \mathcal{O}_{(V',0)}/\mathcal{O}_{(V,0)}

For some reason, 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.

26

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?

  • 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
16

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.

7

As already mentioned, there are two packages to solve this problem:

  • xfrac - typeset fractions in the form n/d generally
  • faktor - especially to typeset factor structures

Here is a comparison between the \sfrac{n}{d} and \faktor{n}{d} commands which also demonstrates how they behave in comparison to normal text: sfrac and faktor in comparison

\documentclass[12pt,preview, border={2pt,2pt,2pt,2pt}]{standalone}
\usepackage[english]{babel}    
\usepackage{xfrac}    
\usepackage{amsmath}
\usepackage[amsmath,thmmarks,standard]{ntheorem}
\usepackage{faktor}

\begin{document}
\begin{alignat*}{4}
\text{This } &\sfrac{\mathcal{O}_{(V',0)}}{\mathcal{O}_{(V,0)}} &\text{ and this } &\sfrac{\mathcal{S}^n}{\equiv_m} &\text{ and this } &\sfrac{A}{B} &&\text{ is \texttt{sfrac}.}\\
\text{This } &\faktor{\mathcal{O}_{(V',0)}}{\mathcal{O}_{(V,0)}} &\text{ and this } &\faktor{\mathcal{S}^n}{\equiv_m} &\text{ and this } &\faktor{A}{B} &&\text{ is \texttt{faktor}.}
\end{alignat*}
\end{document}
3

I would try with $^{a}/_{b}$, or, based in your example

$^{\mathcal{O}_{(V',0)}}/_{\mathcal{O}_{(V,0)}}$

Also it is possible to do $^{a}\Big/_{b}$.

2

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
  • 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
2

I like Eduardo's answer, but with properly sized numerators/denominators.

(Note the double set of braces in the definition for proper spacing. The outer pair will disappear on use, and without the second set, it will place the quotient smack up against whatever's to the left, trying to make it a superscript.)

\documentclass{article}
\usepackage{amsmath}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% For quotient groups / modding equiv relations
%%%% Use: \quot{A}{B} --> A/B
\newcommand*\quot[2]{{^{\textstyle #1}\big/_{\textstyle #2}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\begin{align*}
\text{Reference size: }A
     \quad ^{A}\big/_{B}
    &\quad \quot{A}{B}
     \quad ^{\textstyle A}\Big/_{\textstyle B}\\
\text{Reference size: }E
     \quad ^{E}\big/_{\sim}
    &\quad \quot{E}{\sim}
     \quad ^{\textstyle E}\Big/_{\textstyle \sim}
\end{align*}
\end{document}

enter image description here

0

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}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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