Frequently Asked Questions - Debian

The short answer is that TeX doesn't know how to deal with UTF-8 (or rather non-ASCII) characters. XeTeX has been designed to work around these limitations. The easiest way to generate PDFs is to install Xe(La)TeX and use the 'xedemo' templates - these templates have been 'ported' from LaTeX to XeLaTeX.

Distribution specific install instructions listed below.

Debian / Ubuntu 

Install texlive-xetex that includes xelatex

apt-get install texlive-xetex

but you need to patch LaTeX::Driver
Install liblatex-{driver,encode,table}-perl for latex

apt-get install liblatex-{driver,encode,table}-perl

and libmoosex-followpbp-perl for Template::Plugin::Latex

apt-get install libmoosex-followpbp-perlafter that:

apt-get install libtemplate-plugin-latex-perl  (or cpan Template::Plugin::Latex)

LedgerSMB xelatex configuration

Install xelatex and change the LedgerSMB configuration from the menu:
System -> System Defaults -> Templates directory
Change to "xedemo"

Change a path

From the mailing list: (Chris Travers)
Right now, I am open to suggestions on a better approach, as the Template::Latex api's don't seem to work to do this, but I resorted to changing the paths in LaTeX::Driver::Paths directly (find the location with locate LaTeX/Driver/ This file gets written at installation time for the LaTeX::Driver module and so I consider it reasonably editable.

locate LaTeX/Driver/

If locate is not installed you can do:  find /usr . |grep "LaTeX/Driver/"
/usr/share/perl5/LaTeX/Driver/  ( Debian / Ubuntu )

Make a backup copy of  LaTeX/Driver/ (you have to have root priviliges to do this or use sudo)

cp /usr/share/perl5/LaTeX/Driver/ /usr/share/perl5/LaTeX/Driver/ the path to your path for LaTeX/Driver/

User your text editor to edit LaTeX/Driver/  (you have to have root priviliges to do this or use sudo)

In LaTeX/Driver/ change

$program_path{pdflatex} = '/path/to/pdflatex;


$program_path{pdflatex} = '/path/to/xelatex';


This is the error you get, if you do not change:
/usr/share/perl5/LaTeX/Driver/  (Debian path)  :


latex error - pdflatex exited with errors:
l.26 \RequireXeTeX
! Fatal fontspec error: "cannot-use-pdftex"
! The fontspec package requires either XeTeX or LuaTeX to function.
! You must change your typesetting engine to, e.g., "xelatex" or "lualatex"
! instead of plain "latex" or "pdflatex".
! See the fontspec documentation for further information.
! For immediate help type H <return>.
l.38 }


The utf8 character "hack fix"

Before making this change will UTF8 characters appear as squares in the PDF file. To print utf8 characters in pdf files, you must make the following change:

These are the steps:
su root
open /usr/share/perl5/LaTeX/
in your text editor
go to line 174 on Debian Squeeze (6.x) and line 176 on Debian Wheexy (7.x)
you see "write_file( ..." there

".tex", $source


".tex", {binmode=>':utf8'}, $source


Font fix

In order for Verdana to work, install the package ttf-mscorefonts-installer (Debian/Ubuntu)

apt-get install ttf-mscorefonts-installer

In versions 1.3.28 and up, the demo templates no longer depend on Verdana though, but use the non-proprietary Liberation font set, which can be installed using

apt-get install fonts-liberation

Code reference to LedgerSMB

The code for this is LedgerSMB/Template/