question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tex macros not rendering, also in documentation

See original GitHub issue

Describe the problem

Tex Macros are not working as expected, as far as I can tell.

The example in the documentation does not appear to be rendering correctly, even within the online documentation. The documentation looks like this:


Screen Shot 2022-01-07 at 4 28 39 PM


This does not look like the intended rendering. I get the same thing using the code from the documentation in my _config.yml file, specifically by adding this:

sphinx:
  config:
    mathjax3_config:
      TeX:
        Macros:
          "N": "\\mathbb{N}"
          "floor": ["\\lfloor#1\\rfloor", 1]
          "bmat" : ["\\left[\\begin{array}"]
          "emat" : ["\\end{array}\\right]"]

Note that I am using mathjax3_config (with the “3”) here, which I think is required.

It does correctly render using the math directive approach instead

```{math}
\newcommand\N{\mathbb{N}}
\newcommand\floor[1]{\lfloor#1\rfloor}
\newcommand{\bmat}{\left[\begin{array}}
\newcommand{\emat}{\end{array}\right]}
$$
A = \bmat{} 1 & 1 \\ 2 & 1\\ 3 & 2 \emat{},\ b=\bmat{} 2\\ 3 \\ 4\emat{},\ \gamma = 0.5
$$

which generates output like this:

Screen Shot 2022-01-07 at 9 39 47 PM

So it looks like the _config.yml macros syntax has stopped working, including when the online documentation was generated.

Python version

3.9

Operating system

Mac OS 12

Package versions

Jupyter Book      : 0.12.1
External ToC      : 0.2.3
MyST-Parser       : 0.15.2
MyST-NB           : 0.13.1
Sphinx Book Theme : 0.1.9
Jupyter-Cache     : 0.4.3
NbClient          : 0.5.9

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
stoffprofcommented, May 4, 2022

Wow, that’s a simple fix! Thanks!

1reaction
mmckycommented, May 4, 2022

Sorry it took so long to get this sorted @stoffprof.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Print small TeX code verbatim and render it
Print small TeX code verbatim and render it ... so that I can show what the latex code looks like and how does...
Read more >
latex - MathJax does not render all tex expression
1 Answer 1 ... This macro is not supported out of the box. A full list of macros and environments supported by MathJax...
Read more >
The beamer class - CTAN
Permission is also granted to distribute and/or modify both the documentation and the code under the conditions of the LaTeX Project Public License,...
Read more >
Advanced usage - mkdocs-macros
Issue. The most frequent issue, when adding the mkdocs-macros plugin to an existing mkdocs project, is some markdown pages may not be rendered...
Read more >
AUTOCORRECT (MACROS) IN WORD 2010 NOT WORKING ...
When I make macros through autocorrect in Word and try to apply them. ... AUTOCORRECT (MACROS) IN WORD 2010 NOT WORKING IN MY...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found