-
Notifications
You must be signed in to change notification settings - Fork 569
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
Convert to HTML is fine, but Convert to PDF ignores Greek letters #1673
Comments
Try doing the |
Having unicode letters work in LaTeX differs depending on whether pdflatex or xelatex/lualatex is being used. The current template For xelatex/lualatex, having For pdflatex, the current template does include Pandoc's current template never uses ucs, and uses unicode-math if xelatex/lualatex is being used. I'll see if I can fix up the template to have this work, hopefully for both math and text. |
The current latex base template uses the ucs package with mathletters, but as it does not also set utf8x on inputenc, the ucs package does not work as intended, and Greek letters do not appear in math. As utf8x and ucs are somewhat outdated and problematic, this PR uses a few conditions to try to enable Greek letters in both math and text. For pdflatex, if the alphabeta package (part of greek-inputenc, and not necessarily installed) is present, this is used, as it better supports Greek math and text, including diacritics. It it is not, ucs with mathletters is used, which will allow math, and some text, though diacritics will cause an error. For xelatex and lualatex, this instead uses unicode-math, which handles math well but does not support pdflatex. While this arrangement does support text, note that by default, the fonts used are unlikely to include support for Greek text, and the glyphs will be omitted (both for text and for monospace text), particularly since Latin Modern does not support Greek text. I have an additional change which uses Computer Modern Unicode if available, but I'd like to keep these separate, as it's unclear to me that setting the font in this template would be a good idea. Mathpazo for pdflatex is removed for consistency with xelatex/lualatex output, and the position of the conditional is moved to avoid an order conflict with the ams packages; this more closely matches the position of unicode-math in pandoc's template.
I haven't looked at this in a while, but I'm fairly certain that we should be using |
I think that |
Somewhere, I have get to find where, the generated LaTeX uses latinmodern fonts. latin modern mono does not include Greek. From my xelatex logs:
I have not found out where I can change this. (I can manually edit the generated LaTeX file, but I want to build from a notebook to PDF |
This has been discussed many time here and on other forums, but I still don't know how to get Jupyter to print Greek letters when I convert the notebook to PDF. Interestingly, if converted to HTML, everything is fine.
When converted to PDF:
When converted to HTML:
I've tried using CLI pandoc and tweaking the settings (e.g., changing the font or using xelatex instead of pdflatex), but nothing seems to work. And since these Greek letters are part of my code, I can't just replace them with something that's known to Latex.
The text was updated successfully, but these errors were encountered: