Rendering LaTeX as a compile step?

@jmooring As of Chrome 109, all major browsers (Opera requiring special config) supper MathML syntax without requiring CSS. Much like SVG it’s got it’s own syntax and rendering style. The Hugo In Action way is to have a Netlify function that outputs MathJax’s SVG in a JSON file.

KaTeX can produce the markup that would be great as a server-side render.

@kamov I’ve been exploring this too. It doesn’t appear that Hugo has a render injection point, even with a shortcode that can render these appropriately (I’m still working this though…) another option would be to ask the contributors to bring the KaTeX extension into goldmark (but it’s not an official extension). If I find a way of doing it sans the goldmark extension, I’ll try to post here.

The code below works for me in all my browsers, without CSS:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <semantics>
    <mrow>
      <msub>
        <mi>y</mi>
        <mi>t</mi>
      </msub>
      <mo>=</mo>
      <msub>
        <mi>β</mi>
        <mn>0</mn>
      </msub>
      <mo>+</mo>
      <msub>
        <mi>β</mi>
        <mn>1</mn>
      </msub>
      <msub>
        <mi>x</mi>
        <mi>t</mi>
      </msub>
      <mo>+</mo>
      <msub>
        <mi>ϵ</mi>
        <mi>t</mi>
      </msub>
    </mrow>
    <annotation encoding="application/x-tex">
      y_t=\beta_0+\beta_1 x_t + \epsilon_t
    </annotation>
  </semantics>
</math>