This is a follow-up question to this one: How can I get a "divide by" symbol with \usepackage{physics}? In the referenced question the OP asked how to \undef a redefined \div. I want to reinvent the wheel, and see the exact "source code" what is used to render \div in the first place. But where do I find it?

Here is a MNWE:

What is the \emph{exact} ``source code'' of
\ttfamily\textbackslash div\normalfont, and
where do I find it? Whatever it is, it renders
this: $\div$. I want to use it as a 
starting-point to \ttfamily\textbackslash
def \normalfont my own variant 
\ttfamily\textbackslash mydiv\normalfont.

Bonus question: how do I write \ttfamily \textbackslash (the MNWE above gives me a warning about "font shapes not available").

  • 2
    Try \show\div
    – Joseph Wright
    Jun 8, 2016 at 10:07
  • 2
    At least for you MNWE, you can get the ttfamily backslash with \verb|\def| Jun 8, 2016 at 10:20

2 Answers 2


Assuming TeX Live on a Unix system with bash, open a terminal window and type

texdef -t latex div

and return. You'll get the following info:

> texdef -t latex div



that's not really so much interesting, perhaps, for the non cognoscenti. The same information would be issued by doing \show\div in an interactive session or by typing


in a document and typesetting it.

However, being \div a core math symbol, the real definition can be found in fontmath.ltx; type

grep '\\div\b' $(kpsewhich fontmath.ltx)

and the terminal will print


which is indeed the definition the LaTeX kernel does of \div.

You find all the core math symbols definitions by doing something like

less $(kpsewhich fontmath.ltx)
  • all the math symbol definitions? no, only the "basic" ones that came with the original tex. there are a lot more in, e.g., amsfonts and amssymb and other "add-on" symbol packages. Jun 8, 2016 at 14:45
  • @barbarabeeton I added ”core“; it's generally complicated to find the definitions for other symbols. The ”comprehensive list“ helps in finding the package involved, but then it may make rather cryptic definitions.
    – egreg
    Jun 8, 2016 at 14:54
  • thanks for update. i agree with everything else. (and having had to track down lots of symbol definitions, because they're not necessarily the same with different fonts, i definitely sympathize with anyone else who has to do it.) Jun 8, 2016 at 14:58
  • @barbarabeeton The best is MnSymbol, where the slot numbers are implicit and you have to count lines.
    – egreg
    Jun 8, 2016 at 15:08
  • mathabx is only a little above that; with three fonts, it takes a little digging to figure out which one is relevant. but you're right about MnSymbol. Jun 8, 2016 at 15:10

The OP states that "I want to reinvent the wheel..."

I would note that, to make your own personal version of \div, one does not necessarily have to know the exact formulation of the original. In particular, the code


will allow a new \div to be defined in terms of the original. Furthermore, in the case of \div, as Joseph noted in a comment, \show\div reveals the definition as \mathchar"2204 indicating there is no "code" per se for the division sign, but rather it merely points to a glyph slot of the font intself (slot 4 of the math symbol font).

Here is the new \textbackslash div:
$A \div B$

enter image description here

If one did not wish to redefine the original, but only to define \mydiv in terms of the original, then this:

Here is \textbackslash mydiv:
$A \mydiv B$

You must log in to answer this question.

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