Namespace

Class Index [+]

Quicksearch

LatexTools

Tools for generating Latex code fragments

The latex-tools gem is a collection of classes that facilitate the writing of various elements of Latex code. It is not designed for authoring entire Latex files, merely their component parts. Right now, it only consists of one such ‘tool’, LatexTable, which provides an easy and convenient way of outputting Latex code for tables from data in a ruby script.

Installation

Install the gem just like any other gem:

  gem install latex-tools

Documentation Status

The classes (right now only LatexTable) should be documented well enough to get started, but individual class methods are mostly undocumented. This documentation will (hopefully) be added in the future.

The LatexTools module

The LatexTools module wraps everything in this package. For convenience of use (i.e. unless you have a good reason not to do so), you should include the following line at the beginning of your source code:

  include LatexTools

Not doing so will result in much more verbose and much harder to read code, which is not how this module was intended to be used. For instance, when the module is included properly, use of the LatexTable class becomes quite clean and “c++ like”:

  t = LatexTable.new(3)
  t << " " << "Height" << "Weight" << endl
  t << hline
  t << "Person 1" << '156 cm' << '55 kg' << endl
  t << "Person 2" << '183 cm' << '62 kg' << endl
  t << hline
  t.to_s

(See the LatexTable class documentation for more.)

Public Instance Methods

cline(begincol, endcol) click to toggle source
     # File lib/latex_table.rb, line 576
576:   def cline(begincol, endcol)
577:     return LatexTable::Cline.new(begincol, endcol)
578:   end
endl() click to toggle source
     # File lib/latex_table.rb, line 572
572:   def endl
573:     :endl
574:   end
fill_to_end(alignment_or_content, content = nil) click to toggle source
     # File lib/latex_table.rb, line 560
560:   def fill_to_end(alignment_or_content, content = nil)
561:     if(content.nil?)
562:       return LatexTable::MultiColumn.new(:fill, :c, alignment_or_content)
563:     else
564:       return LatexTable::MultiColumn.new(:fill, alignment_or_content, content)
565:     end
566:   end
hline() click to toggle source
     # File lib/latex_table.rb, line 568
568:   def hline
569:     :hline
570:   end
multicol(ncol, alignment_or_content, content = nil) click to toggle source
Alias for: multicolumn
multicolumn(ncol, alignment_or_content, content = nil) click to toggle source
     # File lib/latex_table.rb, line 551
551:   def multicolumn(ncol, alignment_or_content, content = nil)
552:     if(content.nil?)
553:       return LatexTable::MultiColumn.new(ncol, :c, alignment_or_content)
554:     else
555:       return LatexTable::MultiColumn.new(ncol, alignment_or_content, content)
556:     end
557:   end
Also aliased as: multicol

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.