unicode-math
unicode-math copied to clipboard
Subscripts treated as normal letters in command names
Description
Writing \mooᵥ results in an "Undefined control sequence" error. How easy would it be to stop command names when sub/superscripts characters are encountered?
Check/indicate
- [X] Relevant for XeTeX
- [X] Relevant for LuaTeX
- [X] Issue tracker has been searched for similar issues?
- [ ] Links to <tex.stackexchange.com> discussion if appropriate
Minimal example demonstrating the issue
\documentclass{article}
\usepackage{unicode-math}
\setmathfont{texgyrepagella-math.otf}
\begin{document}
\[
\mooᵥ
\]
\end{document}
Further details
They are letters.
If you mean to use ᵥ (U+1D65 LATIN SUBSCRIPT SMALL LETTER V) in place of _{v}
, don't. If you insist, then
\usepackage{newunicodechar}
\newunicodechar{ᵥ}{\ifmmode_{v}\elseᵥ\fi}
but don't hope that, after similar definitions for the other subscripts characters, something like
$xᵥₐ$
works.
Ok... thanks for your answer. Would you please mind explaining why hoping to use ᵥ instead of _{v} is wrong? It does make latex code much more readable.
On Thu, 27 Sep 2018 at 12:09, thirs [email protected] wrote:
Ok... thanks for your answer. Would you please mind explaining why hoping to use ᵥ instead of _{v} is wrong? It does make latex code much more readable.
If you make it an active character expanding to
_{v}
as then it is OK, but if you just set it directly as a subscript character then the positioning will be inconsistent with all other subscripts and always be positioned at a fixed position below the baseline:The position of_{v}
varies depending on the depth of the base and also on the size of any superscript that is on the same base.
The Unicode sub and superscript characters are really designed for simple text usage and not to fit in with a math layout
David
Thanks David. How about adding these active characters as an option?
@davidcarlisle / @eg9 — unicode-math (perhaps foolishly) already interprets these unicode chars as if the user intended to write a maths subscript (like how '
works in traditional LaTeX). If I was to re-write the package I'd probably drop this feature, but it seems popular (-ish).
The only problem here is that ᵥ
is catcode 11. So no need for newunicodechar
etc:
\documentclass{article}
\usepackage{unicode-math}
\def\moo{m}
\catcode`\ᵥ=12
\begin{document}
\[ \mooᵥᵥ \]
\end{document}
I'll consider a package option to do this automatically.