blob: 6b6a286215276130b12b6614eae6290be0a19b75 [file] [log] [blame]
Fred Drake6c299262001-07-18 20:01:15 +00001Python standard documentation -- in LaTeX
2-----------------------------------------
Guido van Rossumcd7bf391992-04-05 15:06:03 +00003
Fred Drake697c1c71998-08-12 17:13:28 +00004This directory contains the LaTeX sources to the Python documentation
5and tools required to support the formatting process. The documents
6now require LaTeX2e; LaTeX 2.09 compatibility has been dropped.
Guido van Rossum7f777ed1990-08-09 14:25:15 +00007
Fred Drake34eefe51998-03-03 21:41:22 +00008If you don't have LaTeX, or if you'd rather not format the
9documentation yourself, you can ftp a tar file containing HTML, PDF,
10or PostScript versions of all documents. Additional formats may be
11available. These should be in the same place where you fetched the
Fred Drake6c299262001-07-18 20:01:15 +000012main Python distribution (try <http://www.python.org/> or
13<ftp://ftp.python.org/pub/python/>).
Guido van Rossumf1245a81995-03-20 13:00:53 +000014
Fred Drake34eefe51998-03-03 21:41:22 +000015The following are the LaTeX source files:
Guido van Rossum7f777ed1990-08-09 14:25:15 +000016
Fred Drake099b76c1998-05-11 16:31:32 +000017 api/*.tex Python/C API Reference Manual
Fred Drake6c299262001-07-18 20:01:15 +000018 doc/*.tex Documenting Python
Fred Drake099b76c1998-05-11 16:31:32 +000019 ext/*.tex Extending and Embedding the Python Interpreter
20 lib/*.tex Python Library Reference
Fred Drake697c1c71998-08-12 17:13:28 +000021 mac/*.tex Macintosh Library Modules
Fred Drake099b76c1998-05-11 16:31:32 +000022 ref/*.tex Python Reference Manual
23 tut/*.tex Python Tutorial
Greg Ward0862f802000-04-28 16:53:36 +000024 inst/*.tex Installing Python Modules
25 dist/*.tex Distributing Python Modules
Guido van Rossum7f777ed1990-08-09 14:25:15 +000026
Fred Drake697c1c71998-08-12 17:13:28 +000027Most use the "manual" document class and "python" package, derived from
28the old "myformat.sty" style file. The Macintosh Library Modules
29document uses the "howto" document class instead. These contains many
30macro definitions useful in documenting Python, and set some style
31parameters.
Guido van Rossum7f777ed1990-08-09 14:25:15 +000032
Fred Drake34eefe51998-03-03 21:41:22 +000033There's a Makefile to call LaTeX and the other utilities in the right
Fred Drake6c299262001-07-18 20:01:15 +000034order and the right number of times. By default, it will build the
Thomas Hellerb7c95292003-09-27 19:32:04 +000035HTML version of the documentation, but DVI, PDF, and PostScript can
Fred Drake6c299262001-07-18 20:01:15 +000036also be made. To view the generated HTML, point your favorite browser
37at the top-level index (html/index.html) after running "make".
Guido van Rossum7f777ed1990-08-09 14:25:15 +000038
Fred Drake6c299262001-07-18 20:01:15 +000039The Makefile can also produce DVI files for each document made; to
40preview them, use xdvi. PostScript is produced by the same Makefile
41target that produces the DVI files. This uses the dvips tool.
42Printing depends on local conventions; at our site, we use lpr. For
43example:
44
45 make paper-letter/lib.ps # create lib.dvi and lib.ps
46 xdvi paper-letter/lib.dvi # preview lib.dvi
47 lpr paper-letter/lib.ps # print on default printer
Guido van Rossumcd7bf391992-04-05 15:06:03 +000048
Guido van Rossumf1245a81995-03-20 13:00:53 +000049
Fred Drake71472a51998-03-04 15:21:02 +000050What if I find a bug?
51---------------------
52
Fred Drakeda6daee2001-01-22 21:38:09 +000053First, check that the bug is present in the development version of the
Andrew M. Kuchling75534262003-12-23 17:04:35 +000054documentation at <http://www.python.org/dev/doc/devel/>; we may
Fred Drakeda6daee2001-01-22 21:38:09 +000055have already fixed it.
Fred Drake71472a51998-03-04 15:21:02 +000056
57If we haven't, tell us about it. We'd like the documentation to be
58complete and accurate, but have limited time. If you discover any
59inconsistencies between the documentation and implementation, or just
60have suggestions as to how to improve the documentation, let is know!
Fred Drakeda6daee2001-01-22 21:38:09 +000061Specific bugs and patches should be reported using our bug & patch
62databases at:
Fred Drake71472a51998-03-04 15:21:02 +000063
Fred Drakeda6daee2001-01-22 21:38:09 +000064 http://sourceforge.net/projects/python
65
66Other suggestions or questions should be sent to the Python
67Documentation Team:
68
Fred Drake333d6fd2003-07-30 02:55:01 +000069 docs@python.org
Fred Drake71472a51998-03-04 15:21:02 +000070
71Thanks!
72
73
Fred Drake34eefe51998-03-03 21:41:22 +000074What tools do I need?
75---------------------
Guido van Rossuma417b661997-12-08 20:51:26 +000076
Fred Drake34eefe51998-03-03 21:41:22 +000077You need to install Python; some of the scripts used to produce the
Fred Drakebd400941998-08-11 17:41:20 +000078documentation are written in Python. You don't need this
79documentation to install Python; instructions are included in the
80README file in the Python distribution.
Guido van Rossuma417b661997-12-08 20:51:26 +000081
Fred Drake34eefe51998-03-03 21:41:22 +000082The simplest way to get the rest of the tools in the configuration we
Fred Drake7e861bd2000-08-31 15:29:38 +000083used is to install the teTeX TeX distribution, versions 0.9 or newer.
84More information is available on teTeX at <http://www.tug.org/tetex/>.
85This is a Unix-only TeX distribution at this time. This documentation
86release was tested with the 1.0.7 release, but there have been no
87substantial changes since late in the 0.9 series, which we used
88extensively for previous versions without any difficulty.
Fred Drake34eefe51998-03-03 21:41:22 +000089
Fred Drake099b76c1998-05-11 16:31:32 +000090If you don't want to get teTeX, here is what you'll need:
Fred Drake34eefe51998-03-03 21:41:22 +000091
92To create DVI, PDF, or PostScript files:
93
94 - LaTeX2e, 1995/12/01 or newer. Older versions are likely to
95 choke.
96
97 - makeindex. This is used to produce the indexes for the
98 library reference and Python/C API reference.
99
100To create PDF files:
101
Fred Drake7e861bd2000-08-31 15:29:38 +0000102 - pdflatex. We used the one in the teTeX distribution (pdfTeX
103 version 3.14159-13d (Web2C 7.3.1) at the time of this
104 writing). Versions even a couple of patchlevels earlier are
105 highly likely to fail due to syntax changes for some of the
106 pdftex primitives.
Fred Drake34eefe51998-03-03 21:41:22 +0000107
108To create PostScript files:
109
110 - dvips. Most TeX installations include this. If you don't
Fred Drake71472a51998-03-04 15:21:02 +0000111 have one, check CTAN (<ftp://ctan.tug.org/tex-archive/>).
Fred Drake34eefe51998-03-03 21:41:22 +0000112
113To create info files:
114
Fred Drakeda71e311999-01-13 23:02:38 +0000115 Note that info support is currently being revised using new
116 conversion tools by Michael Ernst <mernst@cs.washington.edu>.
Fred Drake45084ed1998-04-09 15:19:41 +0000117
Fred Drake34eefe51998-03-03 21:41:22 +0000118 - makeinfo. This is available from any GNU mirror.
119
Fred Drake45084ed1998-04-09 15:19:41 +0000120 - emacs or xemacs. Emacs is available from the same place as
121 makeinfo, and xemacs is available from ftp.xemacs.org.
122
Fred Drakeda71e311999-01-13 23:02:38 +0000123 - Perl. Find the software at
124 <http://language.perl.com/info/software.html>.
125
Fred Drake95669882000-10-26 19:01:46 +0000126 - HTML::Element. If you don't have this installed, you can get
127 this from CPAN. Use the command:
128
129 perl -e 'use CPAN; CPAN::install("HTML::Element");'
130
131 You may need to be root to do this.
132
Fred Drake34eefe51998-03-03 21:41:22 +0000133To create HTML files:
134
Kurt B. Kaiser39c3bdc2003-07-08 18:05:26 +0000135 - Perl 5.6.0 or newer. Find the software at
Fred Drake71472a51998-03-04 15:21:02 +0000136 <http://language.perl.com/info/software.html>.
Fred Drake34eefe51998-03-03 21:41:22 +0000137
Fred Drake6c299262001-07-18 20:01:15 +0000138 - LaTeX2HTML 99.2b8 or newer. Older versions are not
139 supported; each version changes enough that supporting
140 multiple versions is not likely to work. Many older
141 versions don't work with Perl 5.6 as well. This also screws
142 up code fragments. ;-( Releases are available at:
143 <http://www.latex2html.org/>.
Fred Drake34eefe51998-03-03 21:41:22 +0000144
145
Fred Drake4977ff02004-01-13 23:56:03 +0000146LaTeX (or pdfLaTeX) ran out of memory; how can I fix it?
147--------------------------------------------------------
148
149This is known to be a problem at least on Mac OS X, but it has been
150observed on other systems in the past.
151
152On some systems, the default sizes of some of the memory pools
153allocated by TeX needs to be changed; this is a configuration setting
154for installations based on web2c (most if not all installations).
155This is usually set in a file named texmf/web2c/texmf.cnf (where the
156top-level texmf/ directory is part of the TeX installation). If you
157get a "buffer overflow" warning from LaTeX, open that configuration
158file and look for the "main_memory.pdflatex" setting. If there is not
159one, you can add a line with the setting. The value 1500000 seems to
160be sufficient for formatting the Python documetantion.
161
162
Fred Drake34eefe51998-03-03 21:41:22 +0000163What if Times fonts are not available?
164--------------------------------------
165
166As distributed, the LaTeX documents use PostScript Times fonts. This
167is done since they are much better looking and produce smaller
Fred Drake82bac592002-07-08 14:10:41 +0000168PostScript files. If, however, your TeX installation does not support
Fred Drake4912beb1998-03-11 17:07:35 +0000169them, they may be easily disabled. Edit the file
Fred Drake82bac592002-07-08 14:10:41 +0000170texinputs/pypaper.sty and comment out the line that starts
Fred Drake41dee841999-03-03 21:39:19 +0000171"\RequirePackage{times}" by inserting a "%" character at the beginning
Fred Drake82bac592002-07-08 14:10:41 +0000172of the line. If you're formatting the docs for A4 paper instead of
173US-Letter paper, change paper-a4/pypaper.sty instead. An alternative
174is to install the right fonts and LaTeX style file.
Fred Drake4912beb1998-03-11 17:07:35 +0000175
176
177What if I want to use A4 paper?
178-------------------------------
179
Fred Drake6c299262001-07-18 20:01:15 +0000180Instead of building the PostScript by giving the command "make ps",
181give the command "make PAPER=a4 ps"; the output will be produced in
182the paper-a4/ subdirectory. (You can use "make PAPER=a4 pdf" if you'd
Fred Drakeda6daee2001-01-22 21:38:09 +0000183rather have PDF output.)
Guido van Rossuma417b661997-12-08 20:51:26 +0000184
185
Guido van Rossumf1245a81995-03-20 13:00:53 +0000186Making HTML files
187-----------------
188
Fred Drake34eefe51998-03-03 21:41:22 +0000189The LaTeX documents can be converted to HTML using Nikos Drakos'
Fred Drake6c299262001-07-18 20:01:15 +0000190LaTeX2HTML converter. See the Makefile; after some twiddling, "make"
191should do the trick.
Guido van Rossumf1245a81995-03-20 13:00:53 +0000192
Fred Drake4912beb1998-03-11 17:07:35 +0000193
Fred Drake6355bd41998-03-27 05:17:21 +0000194What else is in here?
195---------------------
196
197There is a new LaTeX document class called "howto". This is used for
Fred Drakebd400941998-08-11 17:41:20 +0000198the new series of Python HOWTO documents which is being coordinated by
Fred Drakeda6daee2001-01-22 21:38:09 +0000199Andrew Kuchling <akuchlin@mems-exchange.org>. The file
200templates/howto.tex is a commented example which may be used as a
201template. A Python script to "do the right thing" to format a howto
202document is included as tools/mkhowto. These documents can be
203formatted as HTML, PDF, PostScript, or ASCII files. Use "mkhowto
204--help" for information on using the formatting tool.
Fred Drakebd400941998-08-11 17:41:20 +0000205
206For authors of module documentation, there is a file
207templates/module.tex which may be used as a template for a module
208section. This may be used in conjunction with either the howto or
209manual document class. Create the documentation for a new module by
210copying the template to lib<mymodule>.tex and editing according to the
211instructions in the comments.
Fred Drake6355bd41998-03-27 05:17:21 +0000212
Fred Drake6c299262001-07-18 20:01:15 +0000213Documentation on the authoring Python documentation, including
214information about both style and markup, is available in the
215"Documenting Python" manual.
216
Fred Drake6355bd41998-03-27 05:17:21 +0000217
Fred Drake4912beb1998-03-11 17:07:35 +0000218Copyright notice
219================
220
221The Python source is copyrighted, but you can freely use and copy it
222as long as you don't change or remove the copyright notice:
223
224----------------------------------------------------------------------
Fred Drake85d27572003-06-29 16:55:47 +0000225Copyright (c) 2000-2003 Python Software Foundation.
Guido van Rossumfd71b9e2000-06-30 23:50:40 +0000226All rights reserved.
Fred Drake4912beb1998-03-11 17:07:35 +0000227
Fred Drakeda6daee2001-01-22 21:38:09 +0000228Copyright (c) 2000 BeOpen.com.
229All rights reserved.
230
231Copyright (c) 1995-2000 Corporation for National Research Initiatives.
232All rights reserved.
233
234Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
235All rights reserved.
236
Fred Drakebac3f042003-09-27 07:16:32 +0000237See the file "commontex/license.tex" for information on usage and
Guido van Rossumfd71b9e2000-06-30 23:50:40 +0000238redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Fred Drake4912beb1998-03-11 17:07:35 +0000239----------------------------------------------------------------------