Using PFG/TIKZ with Redmine

The Wiki external filter is a very handy redmine plugin. I'm using it for drawing diagrams with PGF/TIKZ . Here are some notes on how to do it.

System Ubuntu 11.04 Redmine 1.2.0

Install external tools/scripts

Name Purpose Install
Latex/Tikz document typesetting & drawing tools sudo apt-get install texlive-latex-extra pgf pdf2svg dvipng
Latex tool interfaces wiki external plugin and latex

Install filter

I'm using an extra ruby installation (Ruby Enterprise Edition), where the current user has write permissions to, so I don't need to sudo before gem commands.

# optional ruby package (used for debugging in case things go wrong)
gem install POpen4
#---[ installing plugin ]---
cd vendor/plugins
git clone
cd ../../config/
rake db:migrate:plugins RAILS_ENV=production
# applying patch 
cd ../../lib/redmine/
# this patch also works for redmine 1.2.0
# or a copy from
# please do a 'patch --dry-run' before to ensure it can be patched
patch  -p3  < redmine-1.0.2-macros-escaping.patch

Configure cache storage

In file config/environments/production.rb append:

config.action_controller.cache_store = :file_store, "#{RAILS_ROOT}/cache" 

And set e.g.

caching expiration time = 30

at http://<host>:<port>/settings/plugin/wiki_external_filter

Setup CSS (optional)

I've configure the macro {{le()}} for small latex excerpts. The following css fix vertical alignment in this case.

public/stylesheets/application.css img.externalfilterinline {
  vertical-align: top;