rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust

Home Page:https://rust-lang.github.io/mdBook/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MathJax inside HTML `details` tag

your-diary opened this issue · comments

commented

Is is possible to render MathJax inside <details> tag?

Input

<details>
<summary>Proof</summary>
\\[
    {}_{N - 1} C _{M - 1}
\\]
</details>

Output

▼ Proof
\\[ {}_{N - 1} C _{M - 1} \\]

(The equation is output as it is. Not rendered...)


By the way, I use mdbook for mathematical writing (rather than LaTeX), and I sometimes want to embed a long proof inside a <details> tag.

I tried this with the mdbook-katex preprocessor and it is rendered. I recommend you to give it a shot.

Note that you currently have to use $ and $$ instead, though.
Edit: mdbook-latex supports custom delimiters now.

Steven Hé (Sīchàng)

commented

@SichangHe
I just tested it today and it worked like a charm.
Thank you for your suggestion and I'm sorry for my very late reply.

commented

Finally found a solution without the need of mdbook-katex.

Just insert an empty line after the closing </summary> tag.

<details>
<summary>Proof</summary>

\\[
    {}_{N - 1} C _{M - 1}
\\]
</details>

ref: #2145