Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using \colon for alternative fonts #11

Closed
gromadan opened this issue Nov 12, 2020 · 1 comment
Closed

Using \colon for alternative fonts #11

gromadan opened this issue Nov 12, 2020 · 1 comment

Comments

@gromadan
Copy link

If you change the font using \fontfam, the macro \colon stops working. For instance,

\fontfam[heros]
\typosize[20/20]
A\colon B
\bye

Prints the colon in CM fonts at size 10pt. Curiously enough, if you do the following:

\fontfam[heros]
\typosize[20/20]
\mathchardef\colon="613A
A\colon B
\bye

then the result is correct. Although colon should be 603A and 613A stands usually for period. The same seems to happen with any other font family loaded by \fontfam.

@olsak
Copy link
Owner

olsak commented Nov 12, 2020

This is bug in OpTeX, thanks for reporting.
When \fontfam is used then (in almost all cases) the Unicode math font is loaded. Then the classical plain TeX setting is not true. New mathcodes for all math characters are loaded from unimath-codes.opm file. And \colon declaration is missing here. The mentioned file loads math codes for all control sequences declared in "a standard" unimath-table.opm but \colon is misssing here too. The unimath-codes.opm adds some exceptions above standard unimath-table.opm, so I'll add the exception for \colon here in a new commit.

You can use \mathcolon instead \colon now, because \mathcolon is declared. Or you can set \let\colon=\mathcolon after Unicode math font is loaded already.

Note that A\mathcolon B does no spaces outside math mode but it creates a little space after colon inside math mode. Second note: classical plain TeX ends by error when \colon is used outside math mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants