7 :Author: Günter Milde <milde@users.berlios.de>
10 This sandbox project is a place to try out and discuss
11 `latex2e writer extensions`_ and alternative latex writers
16 ``latex2e`` writer extensions
17 *****************************
19 .. Steps for uploading Changes:
21 * pepare patch to ../../docutils/docutils/writers/latex2e/__init__.py
23 * (add and) run functional and unit- tests::
25 ../../docutils/test/test_functional.py
26 ../../docutils/test/test_writers/test_latex2e.py
28 if output changed: test-compile and approve new output in
29 ../../docutils/test/functional/output/
31 More (informal) tests are in::
34 ../../docutils/test/functional/input/data/latex.txt
40 * remove from TODO list in ../../docutils/docs/dev/todo.txt
41 or the BUGS in ../../docutils/BUGS.txt
43 * describe new end-user features in ../../docutils/docs/user/latex.txt
44 * describe new settings in ../../docutils/docs/user/config.txt
46 * add backwards-incompatible changes to ../../docutils/RELEASE-NOTES.txt
47 * add summary of changes to ../../docutils/HISTORY.txt
49 * Commit and announce.
56 http://docutils.sourceforge.net/docs/user/latex.html#problems
58 http://docutils.sourceforge.net/docs/dev/todo.html#latex-writer
61 --stylesheet-path option
62 ------------------------
64 There are 2 use cases:
66 1. files in the TEXINPUTS path ("installed", site-wide style files (standard
69 * specify only the filename
72 2. files outside the TEXINPUTS path (not installed, local style files)
74 * a relative path should be rewritten if the output document is in a
75 different dir than the pwd
77 Currently, 1) is done with --stylesheet and 2) with --stylesheet-path.
81 -1 having both ``--stylesheet`` and ``stylesheet-path`` makes things
84 Explaining the two options and their interaction to the user is
87 This holds even more if you take into account the third related
88 option, ``--embed-stylesheet``.
90 -1 it is impossible to have some paths rewritten and some not, as in e.g. ::
92 --stylesheet=mathpazo -stylesheet-path=mystyle.tex
94 "mystyle.tex" would overwrite "mathpazo".
99 Instead of two options, do "the right thing" based on simple rules, e.g:
101 a) Use the "package" vs. "custom style sheet" distinction:
103 Rewrite, if there is an filename extension and it is not ``.sty`` ::
105 --stylesheet='mathpazo,mystyle.tex'
107 will use 'mathpazo' verbatim and rewrite 'mystyle.tex'.
109 -1 will not work for latex packages in the pwd or outside the TEXINPUTS
112 b) rewrite paths that have a directory part::
114 --stylesheet='mathpazo,./mystyle.sty'
116 will use 'mathpazo' verbatim and rewrite './mystyle.sty'.
118 +1 explicite and flexible
120 +1 the common case (files in the TEXINPUTS path) is the most simple
122 -1 need to document/learn special syntax
124 c) rewrite path if this prevents errors:
126 * Check for a given file (or relative path) relative to pwd and output dir.
127 * If it is available relative to pwd but not relative to the output dir,
130 +1 no need to explain any additional syntax
132 +1 does "the right thing" in most usual cases
134 -1 hidden automatism might lead to problems in corner cases
136 -1 mechanism depends on the availability of files at the time of the run,
137 which is harder to explain and less predictable than b)
141 A project with rst documents sorted into a hierarchy of sub-directories
142 and a common style file in the base dir or a sub dir::
157 stylesheet-path: mystyle.sty
159 in docutils.conf, all documents will get a valid link to the style file,
160 if the conversion is started from the base dir.
163 Require only standard packages
164 ------------------------------
166 Provide fallback solutions for the use of "exotic" packages in case they do
167 not exist on the target system.
169 .. \@ifpackageloaded{} \IfPackageExists{}
173 Bibliography directive
174 ----------------------
176 Alan suggested a bibliography directive so that BibTex references are not
177 automatically placed at the end (and bibtex for HTML via ... can be supported)
179 This would imply supression of the "Bibliography" or "References" header
180 added by LaTeX which is possible with:
182 From: Martin Scharrer <martin@scharrer-online.de>
183 Subject: Re: Literaturverzeichnis ?berschrift entfernen
184 Date: Sun, 22 Mar 2009 06:30:33 -0700 (PDT)
186 On Mar 21, 11:10?pm, Elfish26111...@gmail.com wrote:
189 > ich benutze Bibtex und w?rde gerne die komplette ?berschrift, also
190 > auch die daf?r reservierte Box entfernen.
191 > Hat jemand eine Idee wie ich das machen kann?
193 > \renewcommand{\bibname}{}
195 > habe ich bereits versucht. Aber wie gesagt den reservierten Platz in
196 > der Überschrift behält er immernoch.
198 Die Ueberschrift ist denk ich mal ein '\chapter*{\bibname}' was du
199 dann zu einem '\chapter*{}' machst.
200 Die Loesung ist einfach das \chapter macro umzudefinieren:
203 \renewcommand{\chapter}[2]{}
204 % Literaturverzeichnis einbinden: ueber BibTeX oder manuell ...
207 Wobei der '*' hier einfach als ein zusaetzliches Argument genommen
209 Dann braucht \bibname gar nicht mehr geaendert werden.
218 Test documents and unit tests highlighting problems with the LaTeX
219 export and testing alternatives.
224 Related sandbox projects
225 ************************
227 * `<../dkuhlman/Docs>`__,
228 * `<../docpy-writer>`__,
229 * `<../jensj/latex_math>`__,
230 * `<../latex_directive>`__, and
231 * `<../verse-writer>`__.
236 .. _latex.html: ../../docutils/docs/user/latex.html
238 ../../docutils/docs/user/docutils-05-compat.sty.html
240 .. _font encoding: ../../docutils/docs/user/latex.html#
243 .. _PSNFSS documentation:
244 http://dante.ctan.org/CTAN/macros/latex/required/psnfss/psnfss2e.pdf
245 .. _Docutils Release Notes:
246 http://docutils.sourceforge.net/RELEASE-NOTES.html
247 .. _Docutils History:
248 http://docutils.sourceforge.net/HISTORY.html