1. Ensure that Ubuntu’s software repositories are up to date

    $ sudo apt update
  2. Install the complete TeX package

    $ sudo apt install texlive-full
  3. Install the Asciidoctor LaTeX Plugin

    $ sudo gem install asciidoctor-latex --pre
  4. Create a new document and set the stem variable to latexmath to ensure that LaTeX is the interpreter for all Stem blocks in this document.

    :stem: latexmath
  5. If you followed the recommendation in a previous post, Customize the Jekyll Footer, then adding the following remote reference to MathJax.js at the top your custom _includes/footer.html file is trivial. Otherwise, follow the link for details on how to set up this footer override.

    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_HTML-full"> </script>
  6. Create a Stem block with your TeX equation or other LaTeX-specific text. Remember to use the block delimiter ++++ to enclose mutliple lines of \(\LaTeX{}\) content.

    $y = \int_0^\infty \gamma^2 \cos(x) dx$
  7. View your new Jekyll static site in a web browser: http://localhost:4000

    Replace localhost with the hostname or domain name of your remote server if your Jekyll installation is not on your local workstation.

  8. The rendered equation in the example should look like this.

\[y = \int_0^\infty \gamma^2 \cos(x) dx\]