Skip to content

Commit

Permalink
Define and use \output macro in Sphinx/MathJax
Browse files Browse the repository at this point in the history
Update TODOs
  • Loading branch information
khaeru committed Mar 29, 2024
1 parent ce45b0c commit c14225f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ def local_inv(name: str, *parts: str) -> Optional[str]:

# See https://github.com/iiasa/message_ix/pull/721#pullrequestreview-1497907368:
# prefer to write \text{} explicitly
# TODO read at least some of these from message_ix.models
# TODO complete list
# TODO also add these to a LaTeX preamble
# TODO Populate these by reference to message_ix.models
# TODO Also add these to a LaTeX preamble for PDF output
text_macros = """ACT
STORAGE
STORAGE_CHARGE
Expand All @@ -202,6 +201,10 @@ def local_inv(name: str, *parts: str) -> Optional[str]:
macros={k.replace("_", ""): r"\text{" + k + "}" for k in text_macros.split()},
),
)
# Example only for #811
mathjax3_config["tex"]["macros"].update(
output=r"\text{output}_{c h h^D l m n^D n^L t y^A y^V}",
)

# -- Options for sphinx.ext.napoleon ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion doc/notation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This page explains the notation used in this mathematical formulation section of
& \forall \, c, h, \ l \notin L^{\text{RES}} \cup L^{\text{REN}} \cup L^{\text{STOR}}, n = n^D = n^O, y = y^A: \\&
\sum_{h m n^L t ; y^V \leq y}{\left(
\text{output}_{c h h^D l m n^D n^L t y^A y^V}
\output
\cdot \text{duration_time_rel}_{h^1=h^D;h^2=h}
\cdot \text{ACT}_{h m n^L t y^A y^V}
\right)} \\&
Expand Down

0 comments on commit c14225f

Please sign in to comment.