LaTeX in docstrings not rendering

I have had a look at

and
https://docs.julialang.org/en/stable/manual/documentation.html

But I cannot get math formula to be rendered whether my doc is built by Travis or on my local machine using mkdocs.

The doctring is

"""
    fivePointStencil(f,x,n::Integer,h)
Evaluates function f and its derivatives up to order n ∈ [0,4] at x:
``f(x),f'(x),...,f^{(n)}(x)``
The result is an array of length n+1.
Derivatives are numerically computed using the 5-point stencil method
with h≠0 being the grid spacing:
[https://en.wikipedia.org/wiki/Five-point_stencil](https://en.wikipedia.org/wiki/Five-point_stencil)
"""

Source: https://github.com/bgodard/CALCEPH.jl/blob/master/src/fivePointStencil.jl
Rendered page: https://bgodard.github.io/CALCEPH.jl/latest/utilities/

I have tried replacing docstring triple quotes by simple quotes and replacing double backticks by escaped dollar signs but the rendered doc stays the same.

I must be doing something wrong but I cannot figure out what.

Thank you for your help.

This seems to be a problem with MathJax which is used to render the formulas. If you open the developer tools in your browser you can see that there is an error that MathJax was not found. This probably due to the fact that the MathJax CDN is retired.

1 Like

Thank you @saschatimme.
But what are the developer tools?

The developer tools are included in each browser, e.g. Chrome or Safari.

When I click on the rendered page link that you gave the LaTeX renders for me. I’m using a mobile phone, but I’m pretty confident that it will render on my PC as well. Will post if it doesn’t. Are you running any script blocker?

I have switched to a different MathJax CDN so the LaTex renders now:

https://github.com/bgodard/CALCEPH.jl/commit/4f3a0afaf4ce86bdf9be9292b7e0b2072ad343b4

Thank you

1 Like