How do the templates work? [PDF, PS, Latex]

How the LaTeX templates work and what is usually needed to get them up and working.

[work in progess...]

The PDF and PS invoices are generated using a program called LaTeX which handles the layout and typesetting. The actual LaTeX files are creating using Template Toolkit with extensions for LaTeX. These extensions are in the Template::Latex package available from CPAN. The software then generates a LaTeX file which is then processed to create a PDF or PS.

Typically the first thing to do is to install a LaTeX distribution like TexLive (distributed with many Linux distributions and available for OSX and Windows). This provides LaTeX and many of the modules needed. In general I recommend that if your distro has a texlive-extras package that you install this too.

After this is installed, you must then install Template::Latex. This can be done by typing on the command line:

Note: Debian & Ubuntu look below.

cpan Template::Latex

This will also install a number of dependencies including LaTeX::Driver, which will need to know where your LaTeX binaries are. It is usually pretty good at finding them.

If things go wrong and you can't get it to work, the following commands may provide useful diagnostic information when requesting help:

>From the LedgerSMB application directory:
perl -MLedgerSMB::Template::Latex -e print

>From the doc/manual directory in the LedgerSMB application directory:
pdflatex LedgerSMB-manual


Debian & Ubuntu note:
Template::Latex is included in Template::Plugin::Latex which is now in Debian as
libtemplate-plugin-latex-perl. (It has migrated to Debian Testing ('wheezy')).
http://packages.debian.org/search?keywords=libtemplate-plugin-latex-perl
Install with apt-get install libtemplate-plugin-latex-perl


Ref: Latex in templates & Debian squeeze and xelatex
http://ledgersmb.org/faq/localization/im-using-non-ascii-unicode-charact...

Source:
How the LaTeX templates work
http://permalink.gmane.org/gmane.comp.finance.ledger.smb.user/6347


With answers from Chris Travers, Robert James Clay

Release: 
FAQ Category: