thegeeklab / hugo-geekdoc

Hugo theme made for documentation
https://geekdocs.de
MIT License
511 stars 313 forks source link

Feature Request: Easier KaTeX Integration #859

Open mbkma opened 1 month ago

mbkma commented 1 month ago

Feature Request: Easier KaTeX Integration

Description: Currently, when using the Geekdoc theme in Hugo, I have to write {{< katex >}} every time I want to use LaTeX. This can be cumbersome, especially when working with many mathematical expressions. I am requesting an easier way to integrate KaTeX, such as using $$ for inline and block math.

Proposed Solution: It would be highly beneficial if we could use $$ delimiters for KaTeX integration, similar to how other Markdown processors handle LaTeX. This would make the process more intuitive and reduce the overhead of repeatedly writing the shortcode.

Examples:

Instead of writing:

{{< katex >}}
\int_{a}^{b} f(x) \, dx
{{< /katex >}}

We could simply write:

$$
\int_{a}^{b} f(x) \, dx
$$

This change would streamline the writing process and improve the overall user experience for those frequently incorporating mathematical expressions into their content.

Additional Information: If there's already a way to achieve this with the current setup or if there are any workarounds, please provide guidance.

Thank you for considering this feature request.

xoxys commented 1 month ago

Thanks for your request. Should be possible with Hugo 0.122 now https://gohugo.io/content-management/mathematics/ As far as I can see this would require: