lzanini / mdbook-katex

A preprocessor for mdBook, rendering LaTex equations to HTML at build time.
MIT License
195 stars 34 forks source link

Process chapter names as well #93

Open VojtechStep opened 10 months ago

VojtechStep commented 10 months ago

Chapter names are used for rendering the sidebar table of contents. When it contains latex markup, then it's rendered correctly in the chapter contents, but the sidebar has the unrendered latex source code.

The processing is a matter of adding chapter.name to the rendering queue in preprocess::KatexProcessor::run and then popping it back. Preferable it would also pass a flag to get_render_tasks so that every ToC entry doesn't have its own reference to the stylesheet header.

This issue is blocked on https://github.com/rust-lang/mdBook/issues/2179, because otherwise the result is even worse than having raw latex in the sidebar.

SichangHe commented 10 months ago

Hi @VojtechStep. Given that you want this feature, I suggest that you implement it to your liking and I will help merge your PR.

VojtechStep commented 10 months ago

I will submit a PR once the mentioned mdbook issue is solved 👍