# LaTeX in docstrings not rendering

**URL:** <https://discourse.julialang.org/t/latex-in-docstrings-not-rendering/8867>\
**Category:** General Usage\
**Tags:** documenter\
**Created:** [February 6, 2018, 3:56pm UTC](https://discourse.julialang.org/t/latex-in-docstrings-not-rendering/8867 "2018-02-06T15:56:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bernard\_GODARD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernard_godard/32/4155_2.png) [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Post date:** [February 6, 2018, 3:56pm UTC](https://discourse.julialang.org/t/latex-in-docstrings-not-rendering/8867/1 "2018-02-06T15:56:43Z")

</div>

I have had a look at

> [@LaTeX support in docstrings - how?](https://discourse.julialang.org/t/latex-support-in-docstrings-how/4952):
>
> It appears that any docstrings that have LaTeX in them (surrounded by double backticks) need to be preceded by @doc\_str. Is that correct? [The documentation](https://docs.julialang.org/en/stable/manual/documentation/#%5CLaTeX-1) hints at this, but it’s not very clear. Also, do backslashes need to be escaped within double backticks or not? The documentation shows examples both ways.

and  
[https://docs.julialang.org/en/stable/manual/documentation.html](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

```julia
"""
    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](https://github.com/bgodard/CALCEPH.jl/blob/master/src/fivePointStencil.jl)  
Rendered page: [https://bgodard.github.io/CALCEPH.jl/latest/utilities/](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.

---

<div class="post-metadata">

**Author:** ![saschatimme](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saschatimme/32/10313_2.png) [@saschatimme](https://discourse.julialang.org/u/saschatimme)\
**Post date:** [February 6, 2018, 4:03pm UTC](https://discourse.julialang.org/t/latex-in-docstrings-not-rendering/8867/2 "2018-02-06T16:03:08Z")

</div>

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](https://www.mathjax.org/cdn-shutting-down/).

---

<div class="post-metadata">

**Author:** ![Bernard\_GODARD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernard_godard/32/4155_2.png) [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Post date:** [February 6, 2018, 4:32pm UTC](https://discourse.julialang.org/t/latex-in-docstrings-not-rendering/8867/3 "2018-02-06T16:32:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![saschatimme](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saschatimme/32/10313_2.png) [@saschatimme](https://discourse.julialang.org/u/saschatimme)\
**Post date:** [February 6, 2018, 4:35pm UTC](https://discourse.julialang.org/t/latex-in-docstrings-not-rendering/8867/4 "2018-02-06T16:35:16Z")

</div>

The developer tools are included in each browser, e.g. [Chrome](https://developer.chrome.com/devtools) or [Safari](https://developer.apple.com/safari/tools/).

---

<div class="post-metadata">

**Author:** ![zygmuntszpak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zygmuntszpak/32/2591_2.png) [@zygmuntszpak](https://discourse.julialang.org/u/zygmuntszpak)\
**Post date:** [February 7, 2018, 7:14am UTC](https://discourse.julialang.org/t/latex-in-docstrings-not-rendering/8867/5 "2018-02-07T07:14:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Bernard\_GODARD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernard_godard/32/4155_2.png) [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Post date:** [February 7, 2018, 8:02am UTC](https://discourse.julialang.org/t/latex-in-docstrings-not-rendering/8867/6 "2018-02-07T08:02:43Z")

</div>

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

[https://github.com/bgodard/CALCEPH.jl/commit/4f3a0afaf4ce86bdf9be9292b7e0b2072ad343b4](https://github.com/bgodard/CALCEPH.jl/commit/4f3a0afaf4ce86bdf9be9292b7e0b2072ad343b4)

Thank you
