We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Description: Ruby LaTeX to PDF preprocessor (and Rails plugin)
Homepage: http://rtex.rubyforge.org
Clone URL: git://github.com/bruce/rtex.git
Click here to lend your support to: rtex and make a donation at www.pledgie.com !
bruce (author)
Sat Apr 19 23:11:43 -0700 2008
commit  ca72426be16b37334f7d49fd11298f3e8a5fde13
tree    6b1c6ac55458c8fce4d1370038d78c96f569f92b
parent  6dd1b3e3ede7eadd35cb04fe1f68a12bffbb90d6
rtex / README_RAILS.rdoc
100644 46 lines (30 sloc) 0.927 kb

RTex Rails plugin

Installation

  sudo gem install rtex
  rtex --install /path/to/rails/app

Dependencies

  • Rails >= 2.0.1

Usage

Create files with rtex or +pdf.rtex+ extensions (eg, +index.rtex+, +index.pdf.rtex+) using standard LaTeX markup.

  • Layouts are supported, eg: +application.pdf.rtex+
  • Partials are supported, eg: +_item.pdf.rtex+

Example

With the following:

  # app/controllers/items_controller.rb
  def index
    @items = Item.find(:all)
  end

  # app/views/items/index.pdf.rtex
  \section*{Items}
  \begin{itemize}
  <%= render :partial => @items %>
  \end{itemize}

  # app/views/items/_item.pdf.rtex
  \item <%=l item.name %> \\

  # app/layouts/application.pdf.rtex
  \documentclass[12pt]{article}
  \begin{document}
  <%= yield %>
  \end{document}

If you hit +the.server.url/items.pdf+, you end up with a nice PDF listing of items.

Obviously a simplistic example.