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

Add latin-1 letters as math symbols #796

Merged
merged 2 commits into from
Aug 19, 2017
Merged

Add latin-1 letters as math symbols #796

merged 2 commits into from
Aug 19, 2017

Conversation

chrismessiah
Copy link
Contributor

Currently katex throws an EOF parse error when receiving an input of latin-1 letters that is not inside a \text{} clause. To prevent this the latin-1 letters are added as math-symbols as well.

skarmavbild 2017-08-16 kl 09 47 12

@khanbot
Copy link

khanbot commented Aug 16, 2017

CLA signature looks good 👍

@sophiebits
Copy link
Contributor

I can't tell, is that Computer Modern in your screenshot? Not sure if our fonts support these chars.

@chrismessiah
Copy link
Contributor Author

Good catch. Didn't notice that they were using different fonts. What is the procedure for adding such letters to the font?

skarmavbild 2017-08-16 kl 21 46 54

@kevinbarabash
Copy link
Member

Oh noes... we aren't using CM for latin-1 chars inside \text either. Having this work correctly will require #632 and the some additional work to actually render combining marks for each of the accent types. We'll also need to update how we calculate the height (ascent) and depth (descent) for the combined glyphs that we construct. There's a fair amount of work involved so it's probably best to split it up. I'm okay with this diff as is, but we should aim for rendering CM glyphs for latin-1 eventually.

@edemaine
Copy link
Member

Given that KaTeX already supports math-mode accents, we should be able to macro each Latin-1 Unicode character in math mode to the corresponding accent command (ideally with a loop over the characters and a call to some Unicode splitting).

To fix Latin-1 characters in text mode, we should first do #638 (text-mode accent functions). Then we can follow the above approach.

@kevinbarabash
Copy link
Member

@edemaine can a macro be defined for something without a leading \?

@kevinbarabash
Copy link
Member

kevinbarabash commented Aug 17, 2017

I've added a project to track work relating to latin-1 support.

Copy link
Member

@kevinbarabash kevinbarabash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Normally I'd ask for screenshots, but I don't think they add much value in this case since we don't have the right fonts yet.

@edemaine
Copy link
Member

@kevinbarabash No, macros currently need to start with \. But we could easily add support for single-character macros (in the spirit of TeX active characters). I'll give it a try...

@edemaine edemaine mentioned this pull request Aug 17, 2017
@edemaine
Copy link
Member

Moving discussion to #801

@kevinbarabash kevinbarabash merged commit 81037e5 into KaTeX:master Aug 19, 2017
@ronkok ronkok mentioned this pull request Jan 16, 2018
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

Successfully merging this pull request may close these issues.

5 participants