blob: e8aa6777cdf57bf3049136ba4e6986f4f4e78bd9 [file] [log] [blame]
Guido van Rossumcd7bf391992-04-05 15:06:03 +00001Python main documentation -- in LaTeX
2-------------------------------------
3
4This directory contains the LaTeX sources to the Python documentation
5and a published article about Python.
Guido van Rossum7f777ed1990-08-09 14:25:15 +00006
Guido van Rossumf1245a81995-03-20 13:00:53 +00007If you don't have LaTeX, you can ftp a tar file containing PostScript
8of the 4 main documents. It should be in the same place where you
9fetched the main Python distribution, in a file named
10"pythondoc-ps<version>.tar.gz". (See "../Misc/FAQ" for more
11information about ftp-ing Python files.)
12
Guido van Rossum676d6da1992-02-11 15:51:36 +000013The following are the LaTeX source files:
Guido van Rossum7f777ed1990-08-09 14:25:15 +000014
Guido van Rossum676d6da1992-02-11 15:51:36 +000015 tut.tex The tutorial
Guido van Rossum6938f061994-08-01 12:22:53 +000016 lib.tex, lib*.tex The library reference
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000017 ref.tex, ref[1-8].tex The reference manual
Guido van Rossum6938f061994-08-01 12:22:53 +000018 ext.tex How to extend Python
Guido van Rossum676d6da1992-02-11 15:51:36 +000019 qua.tex, quabib.bib Article published in CWI Quarterly
Guido van Rossum7f777ed1990-08-09 14:25:15 +000020
Guido van Rossum6938f061994-08-01 12:22:53 +000021All except qua.tex (which isn't built by the default target) use the
22style option file "myformat.sty". This contains some macro
23definitions and sets some style parameters.
Guido van Rossum7f777ed1990-08-09 14:25:15 +000024
Guido van Rossumd18b8af1992-04-06 14:02:37 +000025The style parameters are set up for European paper size (21 x 29.7 cm,
26a.k.a. A4, or roughly 8.27 x 11.7 inch) by default. To use US paper,
27comment out the line saying \input{a4wide.sty} in myformat.sty (you
28may want to fiddle with lay-out parameters like \textwidth and
29\textheight, since the default format uses rather wide margins).
Guido van Rossumcd7bf391992-04-05 15:06:03 +000030
31You need the makeindex utility to produce the index for ref.tex
32lib.tex; you need bibtex to produce the references list for qua.tex.
33
Guido van Rossumf1245a81995-03-20 13:00:53 +000034There's a Makefile to call LaTeX and the other utilities in the right
35order and the right number of times. This will produce DVI files for
36each document made; to preview them, use xdvi. PostScript is produced
37by the same Makefile target that produces the DVI files. This uses
38the dvips tool. Printing depends on local conventions; at my site, I
39use lpr. For example:
Guido van Rossum7f777ed1990-08-09 14:25:15 +000040
Guido van Rossumf1245a81995-03-20 13:00:53 +000041 make ref # creates ref.dvi and ref.ps
42 xdvi ref # preview it ref.dvi
43 lpr -Ppsc ref.ps # print it on printer "psc".
Guido van Rossumcd7bf391992-04-05 15:06:03 +000044
Guido van Rossumf1245a81995-03-20 13:00:53 +000045
46Making HTML files
47-----------------
48
49The Reference, Tutorial and Extensions manual can all be converted to
50HTML using Nikos Drakos' LaTeX2HTML converter. See the Makefile;
51after some twiddling, "make l2h" should do the trick.
52
53The Library manual doesn't work well with LaTeX2HTML; instead, there's
54a Python script texi2html.py in this directory that can be run on the
55texinfo generated as an intermediate step for generating the INFO
56files as described in the next section. The command "make libwww"
57should do this.
Guido van Rossum6938f061994-08-01 12:22:53 +000058
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000059
60Making the INFO version of the Library Reference
61------------------------------------------------
62
Guido van Rossumf1245a81995-03-20 13:00:53 +000063The Library Reference can also be read in hypertext form using the
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000064Emacs INFO system. This uses Texinfo format as an intermediate step.
65It requires texinfo version 2 (we have used 2.14).
66
Guido van Rossum6938f061994-08-01 12:22:53 +000067To build the info files (python-lib.info*), say "make lib.info". This
Guido van Rossumf1245a81995-03-20 13:00:53 +000068takes a while, even on a machine with a 100 MHz clock and 64 Mbytes of
69RAM :-). Please ignore the output, which appears like error messages
70but really is debugging output only.
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000071
Guido van Rossumf1245a81995-03-20 13:00:53 +000072You may have to change a site dependency in fix.el: if texinfo 2.xx
73isn't installed by default at your site, you'll have to install it
74(use archie to locate a version and ftp to fetch it). If you can't
75install it in the standard Emacs load path, uncomment the line
76containing a "(setq load-path ...)" statement, and fill in the path
77where you put it.
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000078
79The files used by the conversion process are:
80
Guido van Rossum6938f061994-08-01 12:22:53 +000081partparse.py Python script that converts LaTeX sources to
82 texi files.
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000083
Guido van Rossum6938f061994-08-01 12:22:53 +000084texi{pre,post}.dat Files placed before and after the result.
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000085
Guido van Rossum6938f061994-08-01 12:22:53 +000086fix.el Elisp file executed by Emacs. Two calls to
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000087 'texinfo-all-menus-update are necessary in
Guido van Rossum6938f061994-08-01 12:22:53 +000088 some cases.
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000089
Guido van Rossum6938f061994-08-01 12:22:53 +000090fix_hack Shell script to fix the results of the
91 "underscore hack". {\ptt \char'137} is
92 back-translated to a simple underscore. This
93 is needed for the texindex program.
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000094
Guido van Rossum6938f061994-08-01 12:22:53 +000095whichlibs Shell script to print a list of lib*.tex files
96 to be processed.
Guido van Rossum95cd2ef1992-12-08 14:37:55 +000097
98A Million thanks for Jan-Hein B\"uhrman for writing and debugging the
99convertor and related scripts, and for fixing the LaTeX sources and
100writing new macros for myformat.sty!