Class: Rubbr::Builder::Tex
Class Method Summary collapse
Methods included from Cli
#color?, #disable_stderr, #disable_stdinn, #disable_stdout, #error, #executable?, #notice, #valid_executable, #warning
Class Method Details
.build ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/rubbr/builder/tex.rb', line 7 def build clean_build_dir base_latex_file = Rubbr.[:base_latex_file] base_bibtex_file = Rubbr.[:base_bibtex_file] case Rubbr.[:engine] when :pdflatex @output_format = :pdf preprocessor = Rubbr::Runner::PdfLaTeX else @output_format = :dvi preprocessor = Rubbr::Runner::LaTeX end build_dir do copy_source_files copy_vendor_files copy_graphic_files # first run latex = preprocessor.new(base_latex_file) if base_bibtex_file && latex.warnings.join =~ /No file .+\.bbl/ bibtex = Rubbr::Runner::BibTeX.new(base_bibtex_file) end if latex.warnings.join =~ /No file .+\.(aux|toc)/ latex = preprocessor.new(base_latex_file) end if latex.warnings.join =~ /There were undefined citations/ latex = preprocessor.new(base_latex_file) end if latex.warnings.join =~ /Label\(s\) may have changed\. Rerun/ latex = preprocessor.new(base_latex_file) end # last run needed to get lof to be proper latex = preprocessor.new(base_latex_file) latex.feedback if bibtex bibtex.feedback end end distribute_file(base_latex_file) notice "Build of #@output_format completed for: #{base_latex_file} " + "in #{Rubbr.[:build_dir]}" end |