Skip to content

Commit 79181c2

Browse files
committed
Enhance handling of comments in .tex files for MathJax in Sphinx docs.
1 parent 0f948ee commit 79181c2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

docs/sphinx/source/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1919

2020
project = 'MIPS'
21-
copyright = '2009-2024, Power Systems Engineering Research Center (PSERC)'
21+
copyright = '2009-2025, Power Systems Engineering Research Center (PSERC)'
2222
author = 'Ray D. Zimmerman, Hongye Wang'
2323

2424
# The full version, including alpha/beta/rc tags
@@ -71,6 +71,7 @@
7171
# matlab_auto_link = "basic"
7272
matlab_auto_link = "all"
7373
matlab_show_property_default_value = True
74+
matlab_show_property_specs = True
7475
# autoclass_content = 'both' # 'class', 'init', 'both'
7576
autodoc_member_order = 'bysource' # 'alphabetical', 'groupwise', 'bysource'
7677
napoleon_use_param = False
@@ -111,7 +112,7 @@
111112

112113
with open('mp-docs-shared/mathCmds.tex.txt', 'r') as f:
113114
for line in f:
114-
macros = re.findall(r'\\(re)?newcommand{\\(.*?)}(\[(\d)\])?{(.+)}', line)
115+
macros = re.findall(r'(?<!%)\\(re)?newcommand{\\(.*?)}(\[(\d)\])?{([^%\n]+)}', line)
115116
for macro in macros:
116117
if len(macro[2]) == 0:
117118
mathjax3_config['tex']['macros'][macro[1]] = macro[4]

0 commit comments

Comments
 (0)