Skip to content

Commit a290025

Browse files
committed
Enhance handling of comments in .tex files for MathJax in Sphinx docs.
1 parent 727a806 commit a290025

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/sphinx/source/conf.py

Lines changed: 2 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 = 'MOST'
21-
copyright = '2011-2024, Power Systems Engineering Research Center (PSERC)'
21+
copyright = '2011-2025, Power Systems Engineering Research Center (PSERC)'
2222
author = 'Ray D. Zimmerman, Carlos E. Murillo-Sánchez'
2323

2424
# The full version, including alpha/beta/rc tags
@@ -112,7 +112,7 @@
112112

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

0 commit comments

Comments
 (0)