Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
40b9df2f
Commit
40b9df2f
authored
Oct 11, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some information about using graphics with the Python document
classes
parent
80bd5ca7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
0 deletions
+93
-0
Doc/doc/doc.tex
Doc/doc/doc.tex
+93
-0
No files found.
Doc/doc/doc.tex
View file @
40b9df2f
...
...
@@ -1828,6 +1828,99 @@ This \UNIX\ is also followed by a space.
PostScript versions of the formatted documentation.
\section
{
Including Graphics
\label
{
graphics
}}
The standard documentation included with Python makes no use of
diagrams or images; this is intentional. The outside tools used to
format the documentation have not always been suited to working with
graphics. As the tools have evolved and been improved by their
maintainers, support for graphics has improved.
The internal tools, starting with the
\program
{
mkhowto
}
script, do
not provide any direct support for graphics. However,
\program
{
mkhowto
}
will not interfere with graphics support in the
external tools.
Experience using graphics together with these tools and the
\code
{
howto
}
and
\code
{
manual
}
document classes is not extensive,
but has been known to work. The basic approach is this:
\begin{enumerate}
\item
Create the image or graphic using your favorite
application.
\item
Convert the image to a format supported by the conversion to
your desired output format. If you want to generate HTML or
PostScript, you can convert the image or graphic to
encapsulated PostScript (a
\file
{
.eps
}
file);
\LaTeX
2HTML
can convert that to a
\file
{
.gif
}
file; it may be possible
to provide a
\file
{
.gif
}
file directly. If you want to
generate PDF, you need to provide an ``encapsulated'' PDF
file. This can be generated from encapsulated PostScript
using the
\program
{
epstopdf
}
tool provided with the te
\TeX
{}
distribution on Linux and
\UNIX
.
\item
In your document, add this line to ``import'' the general
graphics support package
\code
{
graphicx
}
:
\begin{verbatim}
\usepackage
{
graphicx
}
\end{verbatim}
\item
Where you want to include your graphic or image, include
markup similar to this:
\begin{verbatim}
\begin{figure}
\centering
\includegraphics
[width=5in]
{
myimage
}
\caption
{
Description of my image
}
\end{figure}
\end{verbatim}
In particular, note for the
\macro
{
includegraphics
}
macro
that no file extension is provided. If you're only
interested in one target format, you can include the
extension of the appropriate input file, but to allow
support for multiple formats, omitting the extension makes
life easier.
\item
Run
\program
{
mkhowto
}
normally.
\end{enumerate}
If you're working on systems which support some sort of
\program
{
make
}
facility, you can use that to ensure the intermediate
graphic formats are kept up to date. This example shows a
\file
{
Makefile
}
used to format a document containing a diagram
created using the
\program
{
dia
}
application:
\begin{verbatim}
default: pdf
all: html pdf ps
html: mydoc/mydoc.html
pdf: mydoc.pdf
ps: mydoc.ps
mydoc/mydoc.html: mydoc.tex mygraphic.eps
mkhowto --html
$
<
mydoc.pdf: mydoc.tex mygraphic.pdf
mkhowto
--
pdf
$
<
mydoc.ps: mydoc.tex mygraphic.eps
mkhowto --postscript
$
<
.SUFFIXES: .dia .eps .pdf
.dia.eps:
dia
--
nosplash
--
export
$
@
$
<
.eps.pdf:
epstopdf
$
<
\end{verbatim}
% $ <-- bow to font-lock
\section
{
Future Directions
\label
{
futures
}}
The history of the Python documentation is full of changes, most of
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment