Questions tagged [mathcode]
The mathcode tag has no usage guidance.
18
questions
10
votes
2
answers
564
views
How to change "." to \cdot automatically
By the David Carlisle's answer, Automatically use \cdot
We can input *, TeX turns * into \cdot command.
How can I change * by ".".
\documentclass{article}
\mathcode`\*="8000
{\catcode`\*...
4
votes
2
answers
198
views
Consequences of setting \mathcode of letters and symbols to "8000?
I know this is not something that you’re supposed to do. But for fun, I played around with the idea of changing the \mathcode of all letters to "8000 and defining them as commands. Each such ...
10
votes
2
answers
570
views
Giving arbitrary unicode characters, passed as arguments, a math-active definition?
I've been trying to write a LaTeX3 function to make arbitrary unicode characters math active and give them a definition. I'm using XeLaTeX. My solution inexplicably works for some examples but not for ...
4
votes
1
answer
145
views
Epigrafica font and mathastext incompatible for minus sign
I like the looks of the Optima font for my figure notations, which often include mathematical notations. I also prefer pdflatex. So I have found the Epigrafica font to be a nice Optima clone, which ...
3
votes
1
answer
153
views
Getting a list of active characters
There are some characters that are active in plain TeX (e.g. ~) and some packages like babel make additional characters active (e.g. "). Is there a way to get a list of all active characters from ...
2
votes
2
answers
542
views
bracket as ordinary symbol in math mode
I would like to to write in math mode using tt font and everything ok, but brackets. The next code
$ \mathtt{[x + y]} $
get
but i would like to get
.
It can be done by some additional commands
$ ...
12
votes
2
answers
697
views
Determining the math class of a non-keyboard symbol
What is the "right" way of determining the math class (e.g. ordinary/0, relation/3, closing/5, etc.) of a non-keyboard symbol?
Something like \oplus is easy enough to guess, but I wasn't immediately ...
9
votes
1
answer
6k
views
Does Wikipedia use Latex? [closed]
I was reading a math text on Wikipédia and I saw some setences that looked like Latex code that my phone could not recognize.If it's a Latex text,and I would like to know, why my computer can read it ...
34
votes
2
answers
3k
views
What is the differences between mathcode and catcode and how can I use mathcode?
The command \catcode is often used to change some internals. E.g. the command \makeatletter changes the catcode @. But what is \mathcode and how does it work?
catcodes are well explained here: Wiki ...
5
votes
2
answers
167
views
How to make active characters work differently in mathmode and text mode?
Still learning about active characters, catcodes, mathcodes, and such.
I know how to make *hello* produce bold in text mode and $x$ produce a bold $x$ in math mode. I also know how to make *{hello}...
1
vote
1
answer
110
views
How to make @ turn math symbols bold
I would like to change the meaning of @ in math mode to be such that it takes the object following it and makes it bold, e.g. $@x$ should produce a bold math x, $@\alpha$ should produce a bold alpha, ...
1
vote
1
answer
585
views
Comma as letter and semicolon as operator in math formulas
Inside document source2e.pdf there are the following two lines
\DeclareMathSymbol{,}{\mathpunct}{letters}{"3B}
\DeclareMathSymbol{;}{\mathpunct}{operators}{"3B}
which treats these two punctuation ...
5
votes
1
answer
216
views
Compilation error with \ifnum in ConTeXt
Why the following code gives me the following error?
Code:
\begingroup \catcode`\"=12
\gdef\newmcodes@{\mathcode`\'39\mathcode`\*42\mathcode`\."613A%
\ifnum\mathcode`\-=45 \else
\...
3
votes
1
answer
1k
views
fancyvrb error with math escapes and prime (')
I've recently noticed a few cases where fancyvrb math escapes fail. This works fine:
\documentclass{article}
\usepackage{fancyvrb}
\begin{document}
\begin{Verbatim}[commandchars=\\\{\},codes={\...
10
votes
4
answers
2k
views
How can I draw bars and stars faster?
I want to use the bars and stars method to list number of non-negative solutions of the equation x + y + z = 4. I tried with
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\...
3
votes
1
answer
343
views
Making f active in math mode
I am trying to correct a spacing issue in mathspec. I wish to add an extra space after the letter f in math mode, but only if it is not followed by a subscript. I don't want to do this manually every ...
14
votes
1
answer
797
views
How to change the mathematical symbol class of a unicode math symbol?
In unicode-math-table.tex the math class of many symbols is defined by lines like:
\UnicodeMathSymbol{"026AC}{\mdsmwhtcircle}{\mathord}{medium small white circle}%
Now if I want to use this ...
8
votes
2
answers
221
views
Make §...§ marker for textmode INSIDE math mode
I want to definde §...§ as markers for textmode inside math mode. This would be useful for example inside "cases" environments, to add text defining the cases; or for defining sets.
Instead of having ...