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 open an issue or send me an email.

Haskell Development with Neovim

After a year and a half of using Haskell on and off, I’ve finally settled on a set of high-quality development and editor tools, using Stack and Neovim. Continue reading

Reach for Markdown, not LaTeX

Published on February 26, 2017

Troubleshooting Haskell Stack Setup on OS X

Published on August 03, 2016