RTeX has been updated for Rails 2. The v1 branch (supporting Rails 1) is available from Subversion at Rubyforge.

Current Version:
1.99.0 (2.0 Preview 1)

Using the `rtex' Executable

RTeX includes an executable, rtex that is automatically installed along with the Rubygem.

Basic Usage

Basic help information is available using the --help option:

rtex --help
USAGE: rtex [OPTIONS]
  -l, --layout LAYOUT    Path to layout file (use <%= yield %>)
  -o, --output OUTFILE   Output to file (defaults to STDOUT)
  -f, --filter FILTER    Filter input (supported: textile)
                         (Wraps in a basic `article' document; use --layout to customize)
      --no-pdf           Don't generate PDF (just output TeX)
  -i, --install PATH     Install as plugin into Rails app at PATH
  -h, --help             Show this message

Quick Examples

Generate a quick PDF from Textile content

rtex -o output.pdf -f textile input.textile

You could also use it as a filter.

cat input.textile | rtex -f textile > output.pdf

Converting Textile content to PDF with a custom layout

In pretty.tex.erb (you can name this whatever you’d like)

  \documentstyle[11pt]{article}
  \begin{document}
  \title{My Pretty Stationary}
  \author{Jon Johnston\\
    Nameless, Inc.}
  \maketitle
  <%= yield %>
  \end{document}

Then, the command:

rtex -o output.pdf -l pretty.tex.erb -t textile input.textile

Again, you can use it as a filter

cat input.textile | rtex -f textile -l pretty.tex.erb > output.pdf

Creating your own filters

More documentation needed, please contribute.