ENH: Enable PDF book style build via LaTeX#193
Conversation
Thanks @AakashGfude 👍 -- this is because |
| TeX: | ||
| extensions: ["autobold.js"] | ||
| Macros: | ||
| "argmax" : "arg\\,max" |
There was a problem hiding this comment.
@AakashGfude I presume these aren't required for datascience
There was a problem hiding this comment.
they are already added in quantecon-book-theme for mathjax v3. https://github.com/QuantEcon/quantecon-book-theme/blob/master/quantecon_book_theme/layout.html#L10 .
Since, there is no variable in sphinx to add configuration for mathjax3 in config file. I think it should be introduced in sphinxv4 though.
There was a problem hiding this comment.
the new variable in sphinx version 4+ is mathjax3_config
There was a problem hiding this comment.
@AakashGfude I have opened a issue to track that inclusion
| $\log(\text{price})$ to be an exact linear function of | ||
| $\text{sqft_living}$. The error term captures the deviation of | ||
| $\log(\text{price})$ from a linear function of $\text{sqft_living}$. | ||
| $\text{sqft\_living}$. The error term captures the deviation of |
There was a problem hiding this comment.
@AakashGfude just for clarity for when I update the style guide we need to escape the _ right?
This change QuantEcon/quantecon-book-theme@ec8d8c8 will then enable the correct Tex to be processed by mathjax.
There was a problem hiding this comment.
Yes, if we want to write a literal underscore, then we will have to escape it like that. http://docs.mathjax.org/en/latest/input/tex/extensions/textmacros.html#quoted-special-characters . I was about to comment about mentioning textmacros in the style guide as well http://docs.mathjax.org/en/latest/input/tex/extensions/textmacros.html
There was a problem hiding this comment.
that would be great -- can you remind me or open an issue on: QuantEcon.manual
Actually this is taken care of for automatic minor version updates: |
|
quantecon-book-theme 0.2.8 is now released. |
|
@AakashGfude is there a package I need to add to support the image conversion? |
|
@AakashGfude do the image file references need support for or is this directory a flat collection if images? |
|
@AakashGfude I just ran this branch locally -- it seems to build the Actually my local lectures/_build/jupyter_execute adjust-toc ✔ 2m
▶ ls
applications index.py pandas python_fundamentals theme
index.ipynb introduction problem_sets scientific |
|
@AakashGfude I have opened #194 to update |
|
@mmcky , i think the path is different in server than in local? Is their an artifact we can download? |
|
@mmcky actually the path generated is wrong altogether, as the file it is trying to find, for example, is |
|
yeah -- that's right. It seems to be missing the |
@mmcky But also, locally it is |
How do they avoid conflicts -- is that |
|
@AakashGfude the https://github.com/QuantEcon/lecture-datascience.myst/actions/runs/1357596935 under artifacts |
|
@AakashGfude so the |
Hmm, will check what is 'cause' and what is 'effect' here |
@AakashGfude what confuses me is that the other repos are building on |
|
This PR has been halted from merging, because of HTML build failing. Which is caused by the server of Canadian government, geolocation service being currently down. https://www.nrcan.gc.ca/science-and-data/science-and-research/earth-sciences/geography/topographic-information/web-services/geolocation-service/17304 |
|
@AakashGfude hopefully this server issue is now resolved. So could you re-trigger the |
|
@mmcky I did run it again, and got the following error. Some nltk issue, |
Is this on your local? I saw the Roger that. @jbrightuniverse any ideas on how to resolve this |
|
according to those logs: it seems that a language set is missing? the logs claim executing that line at some point in the build would solve it; I'm not familiar with the codebase so I'm not sure if that already happens or if the set is expected to already be there. Also notable is the logs claim: |
This PR enables the book style PDF to be built via LaTeX.
Changes:
Upgrading to mathjax v3 to use textmacros was necessary, to escape
_inside\text{}as it is a special character. https://github.com/QuantEcon/lecture-datascience.myst/compare/pdf-changes?expand=1#diff-596037ac6201ed91873ef81f374bc604c6c1f0a4d56833e749433585288d7b1eR135NOTE that while using
_or any special characters inside\text{}we need to escape it. Like its done in this PR by using\_instead of_{align*}is an environment, which throws errors in latex, when its inside another environment like$$. Using{aligned}instead is the way to go.