# A couple of Jekyll updates

DevFeed: [A couple of Jekyll updates](<https://devfeed.tech/articles/a-couple-of-jekyll-updates-35135.md>)

Original publisher: [Read original article](<http://www.practicallyefficient.com/2017/07/02/a-couple-of-jekyll-updates.html>)

Author: Eddie Smith

Published: 2017-07-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Eddie Smith](<https://devfeed.tech/sources/eddie-smith.md>)

Topics: [Jekyll](<https://devfeed.tech/topics/jekyll.md>), [Markdown](<https://devfeed.tech/topics/markdown.md>), [CSS](<https://devfeed.tech/topics/css.md>), [YAML](<https://devfeed.tech/topics/yaml.md>), [HTML](<https://devfeed.tech/topics/html.md>), [LaTeX](<https://devfeed.tech/topics/latex.md>)

Tags: [css](<https://devfeed.tech/tags/css.md>), [html-elements](<https://devfeed.tech/tags/html-elements.md>), [jekyll](<https://devfeed.tech/tags/jekyll.md>), [latex](<https://devfeed.tech/tags/latex.md>), [markdown](<https://devfeed.tech/tags/markdown.md>), [yaml](<https://devfeed.tech/tags/yaml.md>)

## AI overview

A personal update on a Jekyll site that adds image captions with CSS and Markdown, and integrates MathJax selectively through YAML front matter while retaining the kramdown converter.

## Source excerpt

Since moving to Jekyll last year, I've done relatively little to tweak the inner workings of this site. After all, one of the most appealing things about having a static site is that it doesn't need to have a lot of moving parts. It just works. But today I finally got around to a couple of housekeeping items that have been on my list: image captions and MathJax. Image captions For image captions, I settled on a beautifully simple solution posted by Andrew Wei on Stack Overflow:  *image_caption* This takes advantage of the fact that you can create CSS for combinations of HTML elements. In this case, I can use img + em { display: block; text-align: center;} to target the *image_caption* text only and center it under images, which are also centered on this site by default. It works perfectly, and this isn't even Jekyll-specific. Anyone publishing in Markdown could do this. Agreed. Jekyll + MathJax Adding MathJax took a little more time, but not much. It was worth it just to remind me of the brilliance of Jekyll's architecture. Even though the Jekyll site mentions MathJax, it doesn't say enough to be of immediate use. It basically points to a blog post that entails switching from the default kramdown Markdown converter to redcarpet. Given that I'm happy with kramdown and not in the mood to backtest a bunch of blog posts with a different converter, I wanted to stick with kramdown. A series of subsequent web searches lead me to a Github issue thread for a Jekyll theme that I'm not even using, but I found a really efficient implementation of MathJax there by user "mmistakes," who suggested adding a mathjax variable in each page's YAML front matter that could be set to true on a post by post basis. The elegance of this solution is that the MathJax script will only be written into the HTML of posts that actually have MathJax in them. This seemed super appealing to me because it meant that I didn't have to worry about MathJax being triggered by some accident