I am using $\overset{.}{-}$ for the primitive recursive function between natural numbers such that $m\overset{.}{-}n$ is m minus n if m>=n and otherwise 0. Is there a better and more canonical alternative for a mathematical text?
- 49,614
- 4,817
-
In general, your question is about a symbol. For this, always check How to look up a symbol or identify a math symbol or character? – Werner Mar 23 '17 at 16:33
4 Answers
Only a few math fonts provide the symbol and importing it from them might clash with the other symbols.
You can build it yourself:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\prc}{\mathbin{\mathpalette\prc@inner\relax}}
\newcommand{\prc@inner}[2]{%
\vbox{\offinterlineskip\m@th
\ialign{%
##\cr
\hidewidth\raisebox{-1.5\height}[0pt][0pt]{$#1.$}\hidewidth\cr
$#1-$\cr
}%
}%
}
\makeatother
\begin{document}
\[
x\prc y-\sum_{i=a\prc b}^{n}a_i
\]
\end{document}
As you see, it scales well in subscripts. Modify the 1.5 factor if the distance does not suit you.
A possible improvement, suggested by Barbara Beeton, is to compare the symbol with \div. The dot would be slightly smaller, but we can scale it.
\documentclass{article}
\usepackage{amsmath,graphicx}
\makeatletter
\newcommand{\prc}{\mathbin{\mathpalette\prc@inner\relax}}
\newcommand{\prc@inner}[2]{%
\vbox{\offinterlineskip\m@th
\halign{%
##\cr
\hidewidth
\raisebox{-1.45\height}[0pt][0pt]{\scalebox{1.2}{$#1.$}}%
\hidewidth\cr
$#1-$\cr
}%
}%
}
\makeatother
\begin{document}
\[
x\prc y-\sum_{i=a\prc b}^{n}a_i \quad {\prc}{\div}
\]
\end{document}
- 1,121,712
-
it would be reasonable to use the existing division sign as a model. set this next to a division sign and see if the height of the dots is comparable. – barbara beeton Mar 25 '17 at 02:35
-
-
very nice demonstration. dot is slightly smaller on the construct, but "good enough for government work". – barbara beeton Mar 25 '17 at 12:38
\documentclass{article}
\usepackage{MnSymbol}
\begin{document}
$x\dotminus y$
\end{document}
As Barbara points out in the comments, MnSymbol replaces all symbols, which has the advantage that the symbols will be similar in style. If you want to access just this single symbol, you have to extract the relevant parts of MnSymbol.sty.
\documentclass{article}
% http://tex.stackexchange.com/a/36088
\DeclareFontFamily{U}{MnSymbolC}{}
\DeclareFontShape{U}{MnSymbolC}{m}{n}{
<-6> MnSymbolC5
<6-7> MnSymbolC6
<7-8> MnSymbolC7
<8-9> MnSymbolC8
<9-10> MnSymbolC9
<10-12> MnSymbolC10
<12-> MnSymbolC12}{}
\DeclareSymbolFont{MnSyC}{U}{MnSymbolC}{m}{n}
\DeclareMathSymbol{\dotminus}{\mathbin}{MnSyC}{24}
\begin{document}
$x\dotminus y$
\end{document}
- 49,614
-
MnSymbolreplaces all symbols. if only one symbol is wanted, this gives an approach on how to do it: Importing a single symbol from a different font – barbara beeton Mar 24 '17 at 18:49 -
@barbarabeeton Thanks for pointing this out. I've added the code for picking just this single symbol from the font. I'm not sure that this is a good idea since it will not fit the other symbols; even a plain minus looks different. – gernot Mar 24 '17 at 23:40
-
1the problem with replacing all symbols is that they may not harmonize well with the text font being used. certainly the
MnSymbolfonts do not look good with computer modern; they were designed to complement something else, though i've forgotten what. the stix fonts are designed to go with times or a times clone. etc., etc. care is needed. – barbara beeton Mar 25 '17 at 02:32
A stack is an option. The vertical gap between the . and - is set with the argument that is currently {-1pt}.
\documentclass{article}
\usepackage{amsmath,stackengine}
\def\prf{\ensurestackMath{\mathbin{\stackengine{-1pt}{-}{.}{O}{c}{F}{F}{S}}}}
\begin{document}
$m \prf n$ is $m$ minus $n$ if $m\geq n$ and otherwise $0$.
\end{document}
- 237,551
\documentclass{article}
\usepackage{mathabx}
\begin{document}
$x\dotdiv y$
\end{document}
As Enrico points out in the comments, mathabx replaces all symbols, which has the advantage that the symbols will be similar in style. If you want to access just this single symbol, you have to extract the relevant parts of mathabx.sty.
\documentclass{article}
\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{
<5> <6> <7> <8> <9> <10> gen * mathb
<10.95> mathb10 <12> <14.4> <17.28> <20.74> <24.88> mathb12
}{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareMathSymbol{\dotdiv}{2}{mathb}{"01}
\begin{document}
$x\dotdiv y$
\end{document}
- 49,614
-
Unfortunately your sleek solution does not combine with my other packages. Try e.g. the Small WE below which does not compile
\documentclass[]{article} \usepackage{amsthm} \usepackage{amsmath} \usepackage{amssymb} \usepackage{mathabx} \begin{document} \dotdiv \end{document}
– Frode Alfson Bjørdal Mar 23 '17 at 16:42 -
@FrodeBjørdal Your small example compiles if you use
\dotdivin math mode, i.e.,$\dotdiv$. But this is the normal expected behaviour. – gernot Mar 23 '17 at 16:45 -
-
@Gernot You are right. So there was a conflict with some other package in my document as I was trying out your definition within the scope of dollar signs. – Frode Alfson Bjørdal Mar 23 '17 at 16:59
-
Note that
mathabxchanges all symbols, so it may not be good, particularly if the document uses math fonts different from Computer Modern (mathabxis not that different from CM, but quite distinctive anyhow). – egreg Mar 24 '17 at 23:42 -
@egreg Thanks for pointing this out. I've added the code for picking just this single symbol from the font. – gernot Mar 24 '17 at 23:53




