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

Set unicode supporting fonts in tex template #264

Merged
merged 7 commits into from
Aug 5, 2020
Merged

Conversation

jvntf
Copy link
Contributor

@jvntf jvntf commented Jul 28, 2020

Adds support for unicode characters inside and outside of LaTeX math mode by setting main font and math font to one that includes a large unicode alphabet. Emojis are not supported, but we can support them with something like this.
Perhaps this solution is crude?

Re @guidorice comment, this will work w/r/t to PDF output even though KaTeX shows a client side error (probably catchable).

@jvntf jvntf requested a review from danielfdsilva July 28, 2020 20:04
Copy link
Collaborator

@danielfdsilva danielfdsilva left a comment

Choose a reason for hiding this comment

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

I don't think we need to support emojies. It seems unlikely that an ATBD will use them. We're probably better off stripping them out.

Not sure how to test this. Can you provide some steps?

startserver.sh Outdated Show resolved Hide resolved
Co-authored-by: Daniel da Silva <[email protected]>
@jvntf
Copy link
Contributor Author

jvntf commented Jul 29, 2020

@danielfdsilva I have tested as suggested here

In a text section add unicode symbols such as 𝛾Γ
Add a latex section with \gamma \Gamma and they should both render the same content.

Based on what I've read, there is no catchall for this. i.e. our support for unicode symbols is limited by the font chosen. Perhaps we can choose fonts based on what unicode symbols are input? I can look into this, but it is certainly more complicated than choosing a font with pretty good coverage.

@danielfdsilva
Copy link
Collaborator

This is working as expected.
I'd say we choose a font that has a sufficient unicode support and document that:

  • The font that was chosen, listing (or maybe linking to) the supported unicode characters.
  • What happens when a missing character is used

@jvntf Do you agree? Can you add this so this is complete?

@jvntf
Copy link
Contributor Author

jvntf commented Jul 31, 2020

I agree, but first want to clarify intended behavior. Are we supporting unicode in text mode, math mode, or both? I suggest to only support unicode in text mode and let LaTeX handle rendering math symbols in math mode (default functionality, LaTeX macros are a safer bet in math mode).

best list i've seen of unicode math symbols supported by Latin Modern Math

@danielfdsilva
Copy link
Collaborator

@jvntf your suggestion sounds good. Go ahead.
If users have a different need, we'll adapt in the future

@jvntf jvntf requested a review from danielfdsilva August 5, 2020 16:22
@danielfdsilva
Copy link
Collaborator

@jvntf This looks good, but can we have the documentation in the README is a user facing format.
It would be good to be explicit about what is supported and what happens in case an invalid character is used.

@jvntf jvntf merged commit 8bc79d8 into develop Aug 5, 2020
@jvntf jvntf deleted the fix/176-support-unicode branch August 5, 2020 17:19
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.

2 participants