Index of /sandbox/latex-variants

[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory  -  
[DIR]data/28-Jan-2012 09:50 -  
[DIR]docs/22-Mar-2013 08:17 -  
[DIR]latex2e_adaptive_preamble/28-Jan-2012 09:50 -  
[DIR]latex2e_external_stylesheet/28-Jan-2012 09:50 -  
[DIR]latex2e_listings/28-Jan-2012 09:50 -  
[DIR]tests/22-Mar-2013 08:17 -  
[DIR]tools/28-Jan-2012 09:50 -  

Latex Writer Variants

Latex Writer Variants

Author: Günter Milde <>
Date: 2009-10-15

This sandbox project is a place to try out and discuss latex2e writer extensions and alternative latex writers for special needs.


latex2e writer extensions


  1. Which default font do you prefer for the output?

  2. Did you have problems with Find or Export of words with non-ASCII chars (e.g. Umlauts) in the PDF reader (Acrobat, xpdf, ...)

    Which font encoding do you prefer for the output?

  3. Does the latex2e writer need a --stylesheet-path option?

  4. Feature wishes or ideas of improvement for the latex2e writer.

Users of are encouraged to respond by mail to the docutils-users list.

Proposed Changes

See also the notes in and the TODO list in

Default font

Which default font do you prefer for the output?

By default, PDFLaTeX uses embedded computer modern family, which look good on paper but poor on LCDs (even if outlined, due to suboptimal hinting), and result in large PDFs. rst2pdf uses the "standard" PDF fonts by default (Times, Helvetica, Courier) which IMO look reasonable both on screen and on paper. Because they aren't embedded, it also results in a smaller file size.

Using different fonts (e.g. standard postscript fonts) can be achieved easily by selecting a font package with the --stylesheet command line option or in a custom style-sheet.

Font embedding must be configured in the LaTeX installation.


Use one of the Postscript default fonts supported by standard LaTeX (pages 10 and 11 of the PSNFSS documentation)

-2 very very wide
+0 nonspectacular
-1 no "Base35" font
New Century Schoolbook
-1 very wide
+1 recommended by font experts
+1 good LaTeX support including matching math fonts, small caps, old-style figures
-1 bad rendering in xpdf viewer (auto-hinting leads to different x-hight for different characters at some magnifications)
+1 'de facto standard'
-1 overused
-1 narrow (devised for multi-column layouts)
+1 recommended by font experts
-1 no Base35 font, no required part of LaTeX any more.

Implement as default stylesheet option, so it can be easily overridden.

My vote is for Palatino. --Matthew Leingang

--stylesheet-path option

There are 2 use cases:

  1. files in the TEXINPUTS path ("installed", site-wide style files (standard or local))
    • specify only the filename
    • include literally
  2. files outside the TEXINPUTS path (not installed, local style files)
    • a relative path should be rewritten if the output document is in a different dir than the pwd

Currently, 1) is done with --stylesheet and 2) with --stylesheet-path.


-1 having both --stylesheet and stylesheet-path makes things

Explaining the two options and their interaction to the user is not straightforward.

This holds even more if you take into account the third related option, --embed-stylesheet.


it is impossible to have some paths rewritten and some not, as in e.g.

--stylesheet=mathpazo -stylesheet-path=mystyle.tex

"mystyle.tex" would overwrite "mathpazo".


Instead of two options, do "the right thing" based on simple rules, e.g:

  1. Use the "package" vs. "custom style sheet" distinction:

    Rewrite, if there is an filename extension and it is not .sty


    will use 'mathpazo' verbatim and rewrite 'mystyle.tex'.


    will not work for latex packages in the pwd or outside the TEXINPUTS path.

  2. rewrite paths that have a directory part:


    will use 'mathpazo' verbatim and rewrite './mystyle.sty'.


    explicite and flexible


    the common case (files in the TEXINPUTS path) is the most simple


    need to document/learn special syntax

  3. rewrite path if this prevents errors:

    • Check for a given file (or relative path) relative to pwd and output dir.
    • If it is available relative to pwd but not relative to the output dir, rewrite the path.

    no need to explain any additional syntax


    does "the right thing" in most usual cases


    hidden automatism might lead to problems in corner cases


    mechanism depends on the availability of files at the time of the run, which is harder to explain and less predictable than b)

Require only standard packages

Provide fallback solutions for the use of "exotic" packages in case they do not exist on the target system.

Bibliography directive

Alan suggested a bibliography directive so that BibTex references are not automatically placed at the end (and bibtex for html via ... can be supported)

This would imply supression of the "Bibliography" or "References" header added by LaTeX which is possible with:

From: Martin Scharrer <> Subject: Re: Literaturverzeichnis ?berschrift entfernen Date: Sun, 22 Mar 2009 06:30:33 -0700 (PDT)

On Mar 21, 11:10?pm, wrote: > Hallo, > > ich benutze Bibtex und w?rde gerne die komplette ?berschrift, also > auch die daf?r reservierte Box entfernen. > Hat jemand eine Idee wie ich das machen kann? > > renewcommand{bibname}{} > > habe ich bereits versucht. Aber wie gesagt den reservierten Platz in > der Überschrift behält er immernoch.

Die Ueberschrift ist denk ich mal ein 'chapter*{bibname}' was du dann zu einem 'chapter*{}' machst. Die Loesung ist einfach das chapter macro umzudefinieren:

begingroup renewcommand{chapter}[2]{} % Literaturverzeichnis einbinden: ueber BibTeX oder manuell ... endgroup

Wobei der '*' hier einfach als ein zusaetzliches Argument genommen wird. Dann braucht bibname gar nicht mehr geaendert werden.

Gruesse, Martin

Implemented Changes

Changes to the latex2e writer in the SVN version since docutils version 0.5 are documented in the compatibility style sheet latex2e-compat.

Also see the Docutils Release Notes, the Docutils History.

Alternative latex writers

Browse the SVN repository at

other latex writers

Currently none.


Test documents and unit tests highlighting problems with the LaTeX export and testing alternatives.

See tests