LaTeX code with backslashes in a Markdown docstring in Python does not render properly in GitHub.
Expected behaviour:
The README highlights lazydocs as compatible with Github Markdown, so the expected behaviour is that a Markdown documentation page generated from a Python docstring using lazydocs will render properly in GitHub, including all Markdown features that are supported on GitHub, including LaTeX. However, natural LaTeX code (with a natural/single number of backslashes) does not work reliably in the lazydoc output when viewed on GitHub.
Steps to reproduce the issue:
Create a blank python file with just the following docstring:
"""The vector $\mathbf{x}$ when written with a single backslash and works, but specifying a $3 \times 3$ matrix with a single backslash fails.
Specifying a $3 \\times 3$ matrix with a double-backslash works, and specifying the vector $\\mathbf{x}$ with a double-backslash also works."""
Run lazydocs and push to GitHub.
View the generated documentation Markdown file in GitHub and observe that the natural LaTeX code (with a single backslash) sometimes fails, e.g. at $3 \times 3$ on the first line. (It is supposed to look like on the second line.)
Technical details:
Host Machine OS (Windows/Linux/Mac): Mac for viewing GitHub; lazydoc ran on Debian GNU/Linux 11 (bullseye)
It would be extremely useful for documenting mathematics implemented in Python code (e.g. machine learning, etc.) for LaTeX to work properly in the documentation without need for modifying the number of backslashes, so that the LaTeX code can be retained properly within the code files.
Describe the bug:
LaTeX code with backslashes in a Markdown docstring in Python does not render properly in GitHub.
Expected behaviour:
The README highlights lazydocs as compatible with Github Markdown, so the expected behaviour is that a Markdown documentation page generated from a Python docstring using lazydocs will render properly in GitHub, including all Markdown features that are supported on GitHub, including LaTeX. However, natural LaTeX code (with a natural/single number of backslashes) does not work reliably in the lazydoc output when viewed on GitHub.
Steps to reproduce the issue:
lazydocs
and push to GitHub.Technical details:
Possible Fix:
Additional context:
It would be extremely useful for documenting mathematics implemented in Python code (e.g. machine learning, etc.) for LaTeX to work properly in the documentation without need for modifying the number of backslashes, so that the LaTeX code can be retained properly within the code files.