QuantEcon / lecture-source-jl

Source files for "Lectures in Quantitative Economics" -- Julia version
https://julia.quantecon.org
BSD 3-Clause "New" or "Revised" License
131 stars 53 forks source link

Fix font/latex pipeline to support more unicode #842

Closed jlperla closed 4 years ago

jlperla commented 4 years ago

I noticed that whatever font is being used for the pdf building is not supporting some of the key unicode characters we have used. For example, is used in the McCall lecture extensively.

Typically this is fixed by moving to xelatex (if it isn't already there) or picking a font with better unicode coverage. @mmcky FYI. Especially if you are designing the pdf support for jupyterbook. Minted/etc. can only work within the fonts you give them in the latex pipeline.

jlperla commented 4 years ago

@mmcky In the latest pdf build, this glyph is still missing. See page 411 for example.

This is almost certainly a font choice issue. Note https://tex.stackexchange.com/questions/422039/best-unicode-font-to-work-with-minted-in-xelatex-lualatex might provide some ideas.

Am I correct in thinking you are using liberation mono? If so, then maybe something in the DejaVu family could be better? This happens in the latex preamble with \setmonofont{Consolas} etc.

My guess is that they will look "prettier" than the current mono-font, but if you are hesistant to play around with that then perhaps there are patches with \usepackage{newunicodechar} etc. as discussed in that stackexchange question. What I don't know if whether you can add in a new glyph rather than just a unicode symbol.

That said, all of this is lower priority than the other changes.

jlperla commented 4 years ago

Also, the \cdot used for inner products is missing as well. You will see this on page 150 of your current build. This font doesn't seem to have very good unicode coverage

mmcky commented 4 years ago

thanks for the specific examples @jlperla -- that's a big help.

@AakashGfude have we had issues with these characters before? The julia pdf is building in the same context as the python one so our previous issues with fonts shouldn't be the same right?.

jlperla commented 4 years ago

I am going to close this in the interests of focus. We can get through with the current setup.

But I would explore the font and unicode issues further in jupyterbook for sure.