An assertion is triggered on my machine when trying to build the documentation with any math. This is due to an incompatibility in the dvisgm preamble. The exception stack is this:
Traceback (most recent call last):
File "../../third-party/m.css/documentation/doxygen.py", line 3859, in <module>
run(state, templates=os.path.abspath(args.templates), wildcard=args.wildcard, index_pages=args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
File "../../third-party/m.css/documentation/doxygen.py", line 3716, in run
parsed = parse_xml(state, file)
File "../../third-party/m.css/documentation/doxygen.py", line 2845, in parse_xml
func = parse_func(state, memberdef)
File "../../third-party/m.css/documentation/doxygen.py", line 1926, in parse_func
func.description, templates, params, func.return_value, func.return_values, func.exceptions, search_keywords, func.deprecated, func.since = parse_func_desc(state, element)
File "../../third-party/m.css/documentation/doxygen.py", line 1756, in parse_func_desc
parsed = parse_desc_internal(state, element.find('detaileddescription'))
File "../../third-party/m.css/documentation/doxygen.py", line 690, in parse_desc_internal
parsed = parse_desc_internal(state, i,
File "../../third-party/m.css/documentation/doxygen.py", line 1289, in parse_desc_internal
out.parsed += latex2svgextra.patch(i.text, svg, depth, attribs)
File "../../third-party/m.css/documentation/../plugins/latex2svgextra.py", line 196, in patch
assert found
AssertionError
The actual problem is the following. dvisgm has made a miniscule change in specifying its version:
<?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.12 -->
<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='33.921937pt' height='14.94396pt' viewBox='0 -8.966376 27.137549 11.955168'>
Now instead of 2.12.x we have 2.12.
Proposed fix/workaround
The file to be patched is latex2svgextra.py. We can simply modify _patch26_src to incorporate the lack of the subversion number.
_patch26_src = re.compile(r"""<\?xml version='1\.0' encoding='UTF-8'\?>
<!-- This file was generated by dvisvgm \d+\.\d+(\.\d+)? -->
<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='(?P<width>[^']+)pt' height='(?P<height>[^']+)pt' viewBox='(?P<viewBox>[^']+)'>
""")
Alternatively we could also define a new variable _patch212_src with the above declaration and add the following lines of code:
svg, found = _patch_src.subn(repl, svg)
if not found:
svg, found = _patch26_src.subn(repl, svg)
assert found
if not found:
svg, found = _patch212_src.subn(repl, svg)
assert found
Maybe throwing an exception expliciting what is going on would be useful.
The above fix allows me to build the documentation without any problems.
Environment
Problem
An assertion is triggered on my machine when trying to build the documentation with any math. This is due to an incompatibility in the
dvisgm
preamble. The exception stack is this:The actual problem is the following.
dvisgm
has made a miniscule change in specifying its version:Now instead of
2.12.x
we have2.12
.Proposed fix/workaround
The file to be patched is
latex2svgextra.py
. We can simply modify_patch26_src
to incorporate the lack of the subversion number.Alternatively we could also define a new variable
_patch212_src
with the above declaration and add the following lines of code:Maybe throwing an exception expliciting what is going on would be useful.
The above fix allows me to build the documentation without any problems.