Top Level Namespace

Defined Under Namespace

Modules: Rake, Rake4LaTeX

Constant Summary collapse

CLEAN =
Rake::FileList["**/*~", "**/*.bak", "**/core"]
CLOBBER =
Rake::FileList.new
@@testrai_file =
'_tmp_.rai'

Instance Method Summary collapse

Instance Method Details

#tex_postrule(*args, &block) ⇒ Object

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 .



364
365
366
367
368
369
370
371
372
373
# 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) ⇒ Object

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.



393
394
395
396
397
# 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