Bloerg
         

Compiling a LaTeX/BibTeX document is a tedious process does not integrate very well with the make idiom. Until now, I used rubber to compile my documents. However, there are several shortcomings that make rubber only a good rather than a perfect solution. Most notably, it is basically unmaintained for years now with the current release dating back to 2006. This wouldn’t be a big issue if it weren’t for some annoyances such as in-source specification of the LaTeX compiler1 and the inability to specify additional flags (e.g. -shell-escape).

Thanks to Austin Clements and his a spiritual successor to rubber, latexrun, the days of frustration and despair are over now. The name might not be as sexy but the feature list and improvements are certainly impressive. Most importantly, latexrun spits out errors and warnings in a format that makes Vim’s quickfix window happy and I can finally specify commands and arguments willy-nilly from outside of my document.

(Un)fortunately, latexrun likes to output auxiliary files in a separate build directory called latex.out. While that works for most packages, it breaks with the source highlighting package minted. As a temporary workaround, one can use the -O . option to use the current working directory as the build directory. But apart from that issue, I am very happy with this little program.

  1. Such as XeLaTeX which I use almost exclusively these days.

When a friend found out that I am “blogging”, she assumed I would be posting personal details and share my views about this and that. Aside from my very personal configurations however, that is obviously not the case. I’d like to change that a tiny little bit by linking to a page with a list of books – see also the header bar – that I read in the past. This will not only give you a limited idea about myself but also helps me keeping track of what I read.

To keep this post a bit technical, here is the bit of code that uses Font Awesome to display the Jekyll star ratings next to some of the books (props to Lawrence Woodman about the initial idea):

module Jekyll
  class RatingStars < Liquid::Tag

    def initialize(tag_name, text, tokens)
      super
      @stars = text
    end

    def render(context)
      rating = Float(@stars)
      num_full_stars = rating.floor()
      num_half_stars = rating - num_full_stars >= 0.5 ? 1 : 0
      num_empty_stars = 5 - num_full_stars - num_half_stars

      html = String.new
      html += '<span class="rating">'

      num_full_stars.times do
        html += '<i class="fa fa-star"></i>'
      end

      num_half_stars.times do
        html += '<i class="fa fa-star-half-o"></i>'
      end

      num_empty_stars.times do
        html += '<i class="fa fa-star-o"></i>'
      end

      html += '</span>'
      html
    end
  end
end

Liquid::Template.register_tag('rating', Jekyll::RatingStars)

Another year has passed thus it’s time for the third installment of the series on my Vim configuration. The main motto of this year has been “reduction and time saving”.

NeoBundle becomes Plug and Airline becomes Lightline

I know, I know, yet another plugin manager. This time it’s vim-plug, which has all the features of NeoBundle has but additionally can install plugins in parallel. This a huge timesaver when installing or updating some twenty plugins. This requires +ruby support until we will finally see NeoVim replacing Bram Moolenaar’s original Vim.

In the process of slimming down my .vimrc and the overall appearance of a typical Vim session (“less is more”), I replaced Airline with Lightline. I removed the majority of additional information except for the color-coded mode, filename, modified flag and current position. Pure and simple.

2014-10-13/lightline.png

Improved vim-tex-fold

I already wrote about the plugin that folds parts of a TeX document. Since the initial release it has seen some major improvements with some input given by Daniel Andreasen. The plugin should be a bit faster (probably not noticeable) and more flexible by allowing to fold custom environments. Give it a shot, if you edit LaTeX documents regularly and do not want to use one of the larger LaTeX toolboxes.

Semi-asynchronous execution

Calling out to external programs and libraries in Vim is synchronous and blocks any user input. This becomes a big problem when dealing with long-running processes such as compiling program sources or TeX documents with Make. NeoVim’s main objective is to lift this limitation by replacing Vim’s synchronous main loop by an event-driven loop. In the mean time vim-dispatch fills that role by talking to a surrounding tmux session. Thus, whenever you run :Make it will start a new instance on the bottom while allowing you to continue editing the actual text. This has become a major time saver in the past.

Honorary plugin mentions

Some more plugins that made it into my .vimrc:

Mappings

Probably the biggest change has been remapping the <Leader> prefix from the comma key to the space bar. It’s a lot easier now to hit the space bar with my thumb instead of finding the comma key with my index finger.

Another big timesaver was mapping the command sequence 1z= to <Leader>ss. If spell checking is enabled it will replace a wrong word under the cursor by the first suggestion of the correction list.

Beamer is an awesome way to make slides with LaTeX. But I always felt that the stock themes do not necessarily look particularly nice and the custom themes often scream “Beamer” at first sight.

So, I sat down and made the mtheme …

2014-09-20/mtheme.png

In the spirit of Jan Tschichold and Matthew Butterick, the theme tries to minimize visual noise and maximize space for content. Thus an ordinary slide is free of superfluous elements such as a navigation bar, progress indicators and heavy block elements. What’s left is all the necessary information: the frame titles, a frame number to refer to the slide and the actual content.

Colors

Yes, teal and orange is an annoying fad in movie productions but it is a refreshing choice for a presentation theme. Rather than using both colors all the time, a dark teal tone is used for the majority of the Beamer elements while orange is used to highlight bits and pieces such as \alert{} commands. Instead of going for an all-white background, I toned it down a tiny notch to reduce eye strain but keep the contrast high enough to easily discern individual letters.

Fonts

Fira Sans is gorgeous typeface commissioned by Mozilla and designed by Carrois. It comes with an enormous amount of styles and features that cover even the most adventurous presentations. In the mtheme I used Fira Sans Light as the main font and the regular Fira Sans Book typeface for any heavier uses such as \textbf{}. Fira Sans Mono is a perfect match for lstlistings or minted environments.

Titles tend to be difficult to get right because of capitalization which almost always looks weird. I avoid this problem by lowercasing frame titles and set them in small capitals of Fira Sans Book.

Sections

In a presentation it can sometimes be difficult to go from one sub-topic to another. An elegant solution is to insert a slide whenever a new section starts. As a little gimmick, the mtheme features a tiny progress bar drawn with TikZ below the section title.

Chart styles

A visual representation of numerical data can help to draw conclusions about an issue quicker than large columns of numbers. Nevertheless, to achieve this honorable goal, this representation must focus on the data and avoid any redundant or unnecessary information by increasing the data-ink ratio, a term coined by Edward Tufte.

I like to use the pgfplots package to visualize two- and three-dimensional data sets but the default style is – although better than what Excel offers – not very impressive. To improve the look, I include the (horizontal) mbarplot and mlineplot styles which reduce the number of visual elements such as boxes and employ a color scheme that is (hopefully) easier on the eyes.

Conclusion

Even though this theme might give your presentation a somewhat “professional” look, you should focus on content first. Because the comments are not back yet, you can leave any feedback in this reddit thread.