-
Notifications
You must be signed in to change notification settings - Fork 154
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
Improve depiction of Latex in GAMS-created docs #721
Conversation
Codecov Report
@@ Coverage Diff @@
## main #721 +/- ##
=====================================
Coverage 94.4% 94.4%
=====================================
Files 43 43
Lines 3448 3448
=====================================
Hits 3257 3257
Misses 191 191 |
4908600
to
f1ca77b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for thoroughly going through this, @glatterf42.
Approved, with one minor request:
- Update release notes.
I think it's worth advertising this, as IMHO it's a significant improvement in readability. It could be like:
- Improve readability of LaTeX equations in docs (:pull:`721`).
Some other notes for posterity:
- We had a discussion in Slack about the merits of using
\text{…}
explicitly (e.g.\text{beyond_horizon_factor}
versus expanding this code in the Sphinx configLines 141 to 157 in 3cd004a
# TODO read at least some of these from message_ix.models # TODO complete list # TODO also add these to a LaTeX preamble text_macros = """ACT STORAGE STORAGE_CHARGE duration_time_rel input map_time_commodity_storage storage_initial storage_self_discharge""" mathjax3_config = dict( tex=dict( macros={k.replace("_", ""): r"\text{" + k + "}" for k in text_macros.split()}, ), ) \beyondhorizonfactor
). We decided for the former for now a variety of reasons. - Building PDF version of the docs from LaTeX fails locally #722 is related but (IMHO properly) kept separate and not scheduled for now.
f1ca77b
to
801747d
Compare
Put all Latex-math-env strings w/ len(str) >= 2 in \text{}
Update TODO list in conf.py
801747d
to
587cc00
Compare
This PR puts all strings with more than two characters in
\text{}
, which should help the depiction of long formulae in particular. Note that some single characters have seen the same fate, especially inmacro_core.gms
, because it would have appeared inconsistent to have some parameters in a table be in\text{}
and not others if they represent the same thing thematically.How to review
PR checklist
Continuous integration checks all ✅Except for
macos-latest-py3.7
per Track/work around actions/setup-python#682 ixmp#484.Add or expand tests;coverage checks both ✅