Solarized LaTeX Listings

October 04, 2014

Out of the box, LaTeX listings are pretty bad. With a bit of work, you can ascribe some colors to the code, but you’re still stuck with choosing a theme. Given that I recently just switched to the Solarized colorscheme in Vim and iTerm2, I made a LaTeX package that styles code listings with the predefined Solarized light colors.

Source

The source for this theme is on GitHub, and the README has pretty good documentation. Here’s an example of the final result:

After you install them in the right place, you can include \usepackage{solarized-light} to turn source code listings light (as in above), \usepackage{solarized-dark} to have listings styled with the dark Solarized theme, and just \usepackage{solarized} to have access to the raw Solarized color codes (see the source for their names).

Once you’ve done this, you just have to include your code in your LaTeX file using the listings packages. You might want to check out the LaTeX wiki for more information on how to get started quickly with code listings, or the official documentation for a more comprehensive reference.



Jake on the Web

If you cared enough to read that far, you should consider following me on GitHub or paying a visit to my homepage. If this post was about one of my open source projects, make sure to star it on GitHub! I love hearing what people think, so feel free to comment, open an issue, or send me an email.

Vim and Haskell in 2016 on OS X

Stephen Diehl’s article “Vim and Haskell in 2016” does a great job of outlining the quickest way to get a quality Haskell development experience. His post presumes Ubuntu; here we presume OS X. Continue reading

Let’s Have a Chat about Encryption

Published on April 17, 2016

SML Dev Setup

Published on March 09, 2016