README.rdoc in rails-latex-1.0.10 vs README.rdoc in rails-latex-1.0.11
- old
+ new
@@ -1,10 +1,10 @@
= Rails-LaTeX
* Git: http://github.com/jacott/rails-latex
-* Author: Geoff Jacobsen
-* Copyright: 2009-2010
+* Author: Geoff Jacobsen
+* Copyright: 2009-2010
* License: MIT-LICENSE
== Description
rails-latex is a renderer for rails 3 which allows tex files with erb to be turned into an inline pdf.
@@ -20,22 +20,22 @@
...
<%= link_to "print", story_path(@story,:format => :pdf) %>
app/views/stories/show.pdf.erb:
- ...
+ ...
<%= lesc @story.name % >
app/views/layouts/application.pdf.erbtex:
\documentclass[12pt,a4paper,sloppy,< %= @landscape % >]{article}
...
< %= yield % >
\end{document}
config/initializers/mime_types.rb:
- ...
+ ...
Mime::Type.register "application/pdf", :pdf, ['text/pdf'], ['pdf']
Only the file containing the \\documentclass should be of type: .pdf.erbtex . Partials and views (when there is a layout)
should be of type .pdf.erb .
@@ -46,16 +46,20 @@
You can override the defaults like so:
LatexToPdf.config.merge! :command => 'xetex', :arguments => ['-etex'], :parse_twice => true
+or to change just the arguments:
+
+ LatexToPdf.config[:arguments].delete('-halt-on-error')
+
The defaults are:
command: 'pdflatex'
- arguments: []
+ arguments: ['-halt-on-error']
parse_twice: false
-The last log file is moved to tmp/rails-latex/input.log . If the PDF is no produced the build directory is not removed;
+The last log file is moved to tmp/rails-latex/input.log . If the PDF is not produced the build directory is not removed;
an archive script should be written to occasionally clean up the tmp/rails-latex directory.
See the rails application under examples/rails-latex-demo/ for a working example.
=== Generating a String
@@ -74,10 +78,10 @@
Then in your mailer:
def email_sender(user, pdf_attachment)
@user = user
attachments["attachment_name.pdf"] = {:mime_type => 'application/pdf', :content => pdf_attachment}
- mail( .... )
+ mail( .... )
end
== Requirements
* ruby 1.8 or 1.9
\ No newline at end of file