Shengting Cao's Notebook ᕦʕ •ᴥ•ʔᕤ

How to Enable Latex in The Blog?

Enable LaTax on webpage

Add this HTML code into site-footer.html file because I use this template for every posts page.

<!-- enable math in the blog  -->
<!DOCTYPE html>
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
<html>
  <head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">

    <!-- The loading of KaTeX is deferred to speed up page rendering -->
    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>

    <!-- To automatically render math in text elements, include the auto-render extension: -->
    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
        onload="renderMathInElement(document.body);"></script>
  </head>
  ...
</html>

Code and the rendered example

Embed formulas $$ {\pi=\frac c d} $$ in the text is a example.

Embed formulas $$ {\pi=\frac c d} $$ in the text is a example.

Notice: to have inline math enable you should have a .mmark file instead of .md file.

LaTex Syntax

Here are some examples that we often used in Deep Learning class.

\hat{} $$ { \hat{a} } $$ \bar{} $$ { \bar{y} } $$ \lparen \rparen$${\lparen \rparen}$$ \lbrack \rbrack $$ \lbrack \rbrack $$ \{ \} $$ { } $$

( \big( \Big( \bigg( \Bigg($$ { ( \big( \Big( \bigg( \Bigg( } $$ \left(\LARGE{AB}\right) $$\left(\LARGE{AB}\right)$$

Full Documentation and Symbols

#LaTex