*Updated:* The original implementation was not thread safe. The expectation was that the working directory would not change within one ruby process. This doesn't work well in multi-threaded environments. Now absolute paths are used instead of assuming the current working directory is for one PDF generation.

Build status Coverage report Dependency Status Inline docs License: MIT Workflow: global rebase

ArTeX: TeX/PDF Generation for Ruby

Project homepage (FAQ, manual, documentation, contact info): github.com/avarteqgmbh/artex

Source repository at: gitlab.com/korobkov/artex


  • xelatex executable, available in modern LaTeX distributions, like TeXLive

  • Requires Ruby

Rendering from Rails

For each action you want to render pdf from, add a file, for example `app/views/products/show.pdf.rtex`. Additionally, you need a layout with the same extensions, which should contain the whole LaTeX preamble and yield within the document.


This gem has been forked from the rtex gem (github.com/bruce/rtex). RTeX can be used either as stand alone executable or as a rails plugin. Using it as rails plugin means to create PDF files using the rails rendering engine. This will bring you in trouble if you don't want to generate your PDF files within controllers. In contrast to that ArTeX has no dependencies on ActionPack and thus can also be used in models.

We'll keep on updating the gem and we'll try to provide some examples in the future. Besides of that the code will be iteratively cut down, rewritten and enhanced.

Requirements (tested)