Skip to content

[Support] Inline maths equations with $6$ or \(...\) not {{< math.inline >}} #131

Answered by kdkasad
bee-san asked this question in Q&A
Discussion options

You must be logged in to vote

Is there anyway we can use single dollars such as $6$ for inline, and double dollars for blocks $$6$$? or \(...\) for inline?

Yes. You don't actually need the {{< math.inline >}} lines around the KaTeX. Those are to tell Hugo to parse what's inside it as an HTML Hugo template rather than as Markdown (that's why the conditional statements work). So they are required around the lines which include the KaTeX scripts, but not around the actual KaTeX markup.

You can use \\( ... \\) for inline KaTeX. You have to use two backslashes due to the way backslashes are treated during Markdown processing

The following works just fine:

{{< math.inline >}}
{{ if or .Page.Params.math .Site.Params.math }}

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@kdkasad
Comment options

@bee-san
Comment options

@kdkasad
Comment options

Answer selected by bee-san
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants