How to align and justify text in beamer columns with surrounding text

This is an update to my 2015 post on horizontally aligning text in beamer columns with surrounding text. In this article, I am going to add the request to also justify alignment of all text. At the same time, I am simplifying the solution from last time:

Continue reading “How to align and justify text in beamer columns with surrounding text”

How to create a nicely formatted Excel table from a pandas DataFrame using openpyxl

When I want to save the current state of a pandas DataFrame for “manual consumption”, I often write df.to_excel('foo.xlsx') within my IPython session or Jupyter Notebook. However, the default style does not look pretty and often needs manual adjustments (e.g. column widths) to be usable.

If you want to create custom reports from pandas, you therefore might want to to this styling programmatically. Package openpyxl does this job nicely. Here is a motivational example that shows you the basic ways of its API. First, have some random data:

Continue reading “How to create a nicely formatted Excel table from a pandas DataFrame using openpyxl”

How to use TeX comments to save yourself from always re-configuring TeXstudio

This posts documents an easy to miss feature supported by several LaTeX IDEs, TeXstudio in my case. They allow to cut short some otherwise tedious steps when switching between documents, by embedding a part of this variability into comments within the source files. This increases the portability of a document between TeX installations, increasing the chance that a simple Open and Compile of the source document succeeds on the first try, without first having to read the error log…

Continue reading “How to use TeX comments to save yourself from always re-configuring TeXstudio”

How to use TikZ externalize with PGFgantt

I recently switched on tikzexternalize on a document with several figures created by TikZ in it. Activating this Tikz library has the advantage of compiling the figures only once (if unchanged), speeding up the creation of the completed document. As a nice side benefit, one gets the images as separate PDF files, which in my case was the main motivation. One simple call to ImageMagick later, one has all images in a format of choice. However, I could not get it to work at first due to my using the PGFgantt package to create a gantt time chart. Here is the (not compiling) start point: Continue reading “How to use TikZ externalize with PGFgantt”

Finally the definitive full-frame graphic commands for beamer in LaTeX

After my two (!) previous posts on the same topic, it’s time to give my final entry for the competition of the definitive full-frame graphics command for use with beamer in LaTeX. To seal the deal, I do not propose 1, but 4 commands, depending on your use case: Continue reading “Finally the definitive full-frame graphic commands for beamer in LaTeX”

How-to make WordPress theme Twenty Sixteen completely dark

Through a custom child theme and 6 carefully built CSS rules, I have completely darkened all remaining bright elements of my WordPress installation. Here’s the result.

Roughly each year, WordPress releases a new default theme that ships with a fresh WordPress installation. As of writing, this blog relies on Twenty Sixteen. Through its Customize option, it is possible to change most colours of the theme without having to dive into the editor at all. However, this left me with some elements that were to bright for my taste: text inputs, buttons and widget borders. So I had to use some custom styles to complete the transition. Read on for all the boring details! 🙂 Continue reading “How-to make WordPress theme Twenty Sixteen completely dark”

How to only color external links in LaTeX

Package hyperref is quite handy for making a compiled LaTeX document more accessible, by allowing to quickly jump to references (back to the text with package backref), section headings (from the table of contents) and weblinks.

By default, links are marked by a coloured rectangles, which only appear on screen, not in print. If one wants to get rid of the rectangles, there are options. However, there is also the colorlinks that marks hyperlinks by changing their text colour. However, these makes all link types become coloured. There is a way to reset certain link types to the default text colour, just by setting their colour to an empty value like this:

\hypersetup{colorlinks=true,linkcolor=,urlcolor=blue}

The trick is the empty value for linkcolor. It applies to internal links (e.g. entries in the table of contents listing), which are thus not touched. This trick can be extended to the other fields citecolor, anchorcolor if needed, to either not change or change their colour.

How to launch Cygwin in the active FreeCommander directory

Under Windows, I rely on trusty FreeCommander for all my file management needs. And I use Cygwin for having my most needed shell programs nearby. Sometimes there is the need to quickly open a Cygwin terminal in the current folder within FreeCommander.Luckily, there is already a popular StackOverflow question for that. Unfortunately, most answers rely on registry editing or installing the additional chere utility. However, the answer by user Tom Kay does neither and works quite well for FreeCommander. Here is how: Continue reading “How to launch Cygwin in the active FreeCommander directory”

How to include your ownCloud calendar into Outlook (read-only)

Say you have your contacts and calendar synchronised via your own private or trusted ownCloud instance. But then at your workplace, you have to use Outlook for your work stuff. Then there is the occasional late appointment, and you run into collisions because you did not look at your private calendar before accepting a meeting invitation. What to do? Wouldn’t it be nice to see your private calendar as an overlay directly in Outlook?

Search no further, the solution is Continue reading “How to include your ownCloud calendar into Outlook (read-only)”

How to list subdirectories recursively with total size

Just a note to myself, as I always have a hard time understanding the find manpages. To list the directories and subdirectories up to a certain depth, “simply” enter:

find . -maxdepth 2 -type d

Option maxdepth states how deep the subdirectories should be listed, option type restricts output to directories (d).

If a directory listing including size is required, this much shorter snippet does the trick, using du (disk usage), the counterpart to the often-used df (disk free):

du -hd 1

Option h triggers human-readable output, replacing size byte count (5820) with SI prefixed numbers (5.8K), while d limits the recursion depth like before.