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 | latextool.sh |
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.
1# optional ruby package (used for debugging in case things go wrong)
2gem install POpen4
3#---[ installing plugin ]---
4cd vendor/plugins
5git clone https://github.com/ndl/wiki_external_filter.git
6cd ../../config/
7wget https://www.hostedredmine.com/attachments/download/5214/wiki_external_filter.yml
8rake db:migrate:plugins RAILS_ENV=production
9# applying patch
10cd ../../lib/redmine/
11# this patch also works for redmine 1.2.0
12wget http://www.ndl.kiev.ua/downloads/redmine-1.0.2-macros-escaping.patch
13# or a copy from https://www.hostedredmine.com/attachments/5478/redmine-1.0.2-macros-escaping.patch
14# please do a 'patch --dry-run' before to ensure it can be patched
15patch -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
div.wiki img.externalfilterinline {
vertical-align: top;
}
