class Object

Constants

CLEAN
CLOBBER

Public Instance Methods

tex_postrule(*args, &block) click to toggle source

Define a task to be executed after each TeX run.

The task name is added to LaTeXRunner::Post_Prerequisites. LaTeXRunner#run_latex_once will loop on all tasks in LaTeXRunner::Post_Prerequisites.

In the task definition you have access to the TeXRunner via Rake::Task#texrunner .

end

# File lib/rake4latex/base.rb, line 364
def tex_postrule(*args, &block)
  #~ rules = rule(*args, &block)
  Rake::Task.create_rule(*args, &block)  #@rules << [pattern, deps, block]
  #
  if args.size == 1 #normal rule without arguments
    Rake4LaTeX::LaTeXRunner::Post_Prerequisites << args.first.keys.first
  else  #rule with arguments (args.last is a hash with :needs)
    Rake4LaTeX::LaTeXRunner::Post_Prerequisites << args.first
  end
end
tex_postrule_check(rulename, &block) click to toggle source

Define a procedure to decide, if the post process should be called.

The task name is added to LaTeXRunner::Post_Prerequisites_check. LaTeXRunner#run_latex_once will loop on all tasks in LaTeXRunner::Post_Prerequisites_check.

The block will be called with a hash, the block must accept this one parameter.

Inside the block you have access to:

  • :task: The task for which you test.

  • :checksums: the checksums of the files before the TeX-run.

  • :texrunner: The actual TeXRunner, calling the pre-check.

  • :logger: the logger of the related task

The block must return false or the reason for a call (e.g. “testdocument.aux changed”)

Example: See BibTeX-definition.

end

# File lib/rake4latex/base.rb, line 393
def tex_postrule_check(rulename, &block)
  raise "No block for postrule_check #{rulename}" unless block_given?
  raise "Wrong number of arguments for postrule_check #{rulename}" unless block.arity == 1
  Rake4LaTeX::LaTeXRunner::Post_Prerequisites_check[rulename] ||= [] << block
end