5

[I reworded the question to make it less based on opinion and ask only for specific expertise.]

Using Sage one can write m//n for the integer division. I found Sage's notation very convenient to use and want to use this notation also with TeX. What is the best way to do so?

\documentclass{article}
\usepackage{amsmath}
\newcommand\+{/ \mkern-5mu /}
\begin{document}
\begin{align}
a_{n}&=2^{\left\lfloor n/2\right\rfloor}\left(\left\lfloor n/2\right\rfloor+1\right) n!
\\[6pt] 
a_{n}&=2^{n/\!/2}\left(n/\!/2+1\right) n!
\\[6pt]
a_{n}&=2^{n\+2}\left(n\+2+1\right) n!
\end{align}
\end{document}

enter image description here

4
  • Personally I prefer n\m, (I can't think which programming language I first came across this notation in, but it stuck) but surely it's a matter of using whatever notation is standard in your field.
    – Chris H
    Oct 14, 2013 at 10:16
  • I mean a notation which has the potential to become standard in mathematical writings. Note that // is a unicode character (U+20EB) and is already supported by the STIX fonts. Oct 14, 2013 at 10:46
  • 3
    I think this is an entirely opinion based question. I've seen the notation \lfloor n/2\rfloor to be replaced sometimes with the use of the div keyword (just like the mod keyword). I think \lfloor n/2\rfloor IS the common notation in mathematical writings.
    – masu
    Oct 14, 2013 at 11:20
  • 3
    Note that U+20EB is a combining character; the character you're referring to is U+2AFD DOUBLE SOLIDUS OPERATOR. In unicode-math it's \sslash
    – egreg
    Oct 14, 2013 at 14:34

1 Answer 1

1

I would go with the spacing between the slashes given by the spacing of a dot. This makes it quite well scalable:

enter image description here

\documentclass{article}
\usepackage{mathtools}
\newcommand\+{\mathbin{\mathrlap{/}\phantom{.}/}}
\newcommand\aLtErNaTiVe{\mathord{\mathrlap{/}\phantom{.}/}}
\begin{document}
\begin{align}
a_{n}&=2^{n\+2}(n\+2+1) n!
\\
a_{n}&=2^{n\aLtErNaTiVe 2}(n\aLtErNaTiVe 2+1) n!
\end{align}
\end{document}

I certainly prefer the "loose" spacing like any binary operator has. You can prefer the "tight" spacing like the slash has, but it seems not to be quite proper here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .