How I got LaTeX working with Hugo and blogdown

Solution 1 of 3 NOTE: This solution for getting LaTeX to work via MathJax requires the blog post to be in .Rmd format. It doesn’t work in .Rmarkdown. And recall, the latter is needed for my syntax highlighting to work. So currently I don’t know how to create a post that has both syntax highlighting for code (requires .Rmarkdown) and LaTeX math expressions (requires .Rmd). (Hey, wait! The syntax highlighting for the GJL_mathjax.
Read more...

Produce a Python blog post with figures

To create a Hugo blog post with Python code and figures, I export an ipython notebook as a .md file. The result is a .zip file containing the .md file and images for the figures. A little modification is needed to get these files just right so that when Hugo builds my website, the post is ready to go with no blank figures. After exporting the jupyter / ipython notebook as .
Read more...

Syntax highlighting for a Hugo data science blog

NOTE: I believe this requires the post to be in .Rmarkdown format, and that an .Rmd post will not have the syntax highlighting. This post explains how I set up my Hugo blog (with the Whiteplain theme) to get the type of syntax highlighting I want for data science / statistics purposes. I relied heavily on this post from Amber Thomas. Thanks a lot Amber! If I were you, I’d probably use Amber’s more thorough post as a guide.
Read more...

Blogging with runnable Python in Rmarkdown files

I wondered if I could blog with runnable Python code chunks if I’m creating my Hugo content with .Rmarkdown files. It looks like I can with the reticulate package; see the vignette here. install.packages('reticulate', repos="https://cloud.r-project.org") library(reticulate) I believe this allows you to actually run Python. Alternatively, if you just want to display Python code, just use a code fence, i.e. the Github-style code block that’s 3 backticks, new line, code, then three closing backticks on a new line, like so:
Read more...