Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39c3d3b

Browse files
committed
added usetex review
svn path=/trunk/matplotlib/; revision=5467
1 parent 86e45bf commit 39c3d3b

4 files changed

Lines changed: 127 additions & 48 deletions

File tree

doc/devel/coding_guide.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.. _coding-guide:
22

33
************
4-
Coding Guide
4+
Coding guide
55
************
66

77
.. _version-control:
88

9-
Version Control
9+
Version control
1010
===============
1111

1212
svn checkouts
@@ -35,18 +35,25 @@ in mind.
3535

3636
* if your changes are non-trivial, please make an entry in the
3737
:file:`CHANGELOG`
38-
* if you change the API, please document it in :file:`API_CHANGES`, and
39-
consider posting to mpl-devel
40-
* Are your changes python2.4 compatible? We are still trying to
41-
support 2.4, so avoid features new to 2.5
38+
39+
* if you change the API, please document it in :file:`API_CHANGES`,
40+
and consider posting to `mpl-devel
41+
<http://lists.sourceforge.net/mailman/listinfo/matplotlib-devel>`_
42+
43+
* Are your changes python2.4 compatible? We still support 2.4, so
44+
avoid features new to 2.5
45+
4246
* Can you pass :file:`examples/tests/backend_driver.py`? This is our
4347
poor man's unit test.
48+
4449
* If you have altered extension code, do you pass
4550
:file:`unit/memleak_hawaii.py`?
51+
4652
* if you have added new files or directories, or reorganized existing
4753
ones, are the new files included in the match patterns in
4854
:file:`MANIFEST.in`. This file determines what goes into the source
4955
distribution of the mpl build.
56+
5057
* Keep the maintenance branch and trunk in sync where it makes sense.
5158
If there is a bug on both that needs fixing, use `svnmerge.py
5259
<http://www.orcaware.com/svn/wiki/Svnmerge.py>`_ to keep them in
@@ -58,6 +65,7 @@ in mind.
5865
svnmerge/svnmerge.py
5966

6067
* get a svn copy of the maintenance branch and the trunk (see above)
68+
6169
* Michael advises making the change on the branch and committing
6270
it. Make sure you svn upped on the trunk and have no local
6371
modifications, and then from the svn trunk do::
@@ -87,7 +95,7 @@ in mind.
8795

8896
.. _style-guide:
8997

90-
Style Guide
98+
Style guide
9199
===========
92100

93101
Importing and name spaces
@@ -278,7 +286,7 @@ forced to use ``**kwargs``. An example is
278286

279287
.. _docstrings:
280288

281-
Documentation and Docstrings
289+
Documentation and docstrings
282290
============================
283291

284292
matplotlib uses artist introspection of docstrings to support

doc/devel/documenting_mpl.rst

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.. _documenting-matplotlib:
22

33
**********************
4-
Documenting Matplotlib
4+
Documenting matplotlib
55
**********************
66

7-
Getting Started
7+
Getting started
88
===============
99

1010
The documentation for matplotlib is generated from ReStructured Text
@@ -33,7 +33,7 @@ arguments to build everything.
3333
The output produced by Sphinx can be configured by editing the `conf.py`
3434
file located in the `doc/`.
3535

36-
Organization of Matplotlib's Documentation
36+
Organization of matplotlib's documentation
3737
==========================================
3838

3939
The actual ReStructured Text files are kept in `doc/users`, `doc/devel`,
@@ -96,7 +96,13 @@ Figures
9696
Each guide will have its own `figures/` directory for scripts to generate images
9797
to be included in the dcoumentation. It is not necessary to explicitly save
9898
the figure in the script, a figure will be saved with the same name as the
99-
filename when the documentation is generated.
99+
filename when the documentation is generated. For example, use::
100+
101+
.. literalinclude:: figures/pyplot_simple.py
102+
103+
.. image:: figures/pyplot_simple.png
104+
:scale: 75
105+
100106

101107
Any figures that rely on optional system configurations should be generated
102108
with a script residing in doc/static_figs. The resulting figures will be saved
@@ -105,6 +111,8 @@ avoid unintentionally overwriting any existing figures. Please add a line to
105111
the README in doc/static-figs for any additional requirements necessary to
106112
generate a new figure.
107113

114+
115+
108116
.. _referring-to-mpl-docs:
109117

110118
Referring to mpl documents
@@ -131,6 +139,8 @@ directory, I use the symlink directory. For example, from
131139
.. literalinclude:: ../mpl_data/matplotlibrc
132140

133141

142+
143+
134144
.. _internal-section-refs:
135145

136146
Internal section references
@@ -161,6 +171,13 @@ hyphens to separate words.
161171

162172
.. _emacs-helpers:
163173

174+
Section names, etc
175+
==================
176+
177+
For everything but top level chapters, please use ``Upper lower`` for
178+
section titles, eg ``Possible hangups`` rather than ``Possible
179+
Hangups``
180+
164181
Emacs helpers
165182
=============
166183

@@ -182,7 +199,7 @@ Some helpful functions::
182199
C-c TAB - rst-toc-insert
183200

184201
Insert table of contents at point
185-
202+
186203
C-c C-u - rst-toc-update
187204

188205
Update the table of contents at point

doc/devel/outline.rst

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ legends ? no author ?
2828
animation John has author ?
2929
collections ? no author ?
3030
text - mathtext Michael in review John
31-
text - usetex Darren submitted ?
31+
text - usetex Darren in review John
3232
text - annotations John submitted ?
3333
fonts et al Michael ? no author Darren
3434
pyplot tut John submitted Eric
@@ -177,4 +177,40 @@ include them as formal review notes.
177177
sub-packages with the gamut of licenses, GPL to MIT?
178178

179179

180+
usetex user's guide-- reviewed by JDH
181+
-------------------------------------
180182

183+
Review of :ref:`usetex-tutorial`:
184+
185+
#. In the section on the ps distiller, you might mention that it is
186+
the rasterization which some users find objectionable, and the
187+
distiller pram (eg 6000) is a dpi setting for the rasterizer. Not
188+
everyone will immediately grasp the controversy surrounding dumping
189+
high res bitmaps into a ps file.
190+
191+
#. ``= Possible Hangups =`` - this is moin, not rest. I have fixed
192+
this already, just wanted to point it out. Also, for everything
193+
but top level chapters, I refer ``Upper lower`` for section
194+
titles, eg ``Possible hangups``.
195+
196+
#. in the troubleshooting section, could you add a FAQ showing how to
197+
find their .matplotlib dir (matplotlib.get_data_path) and link to
198+
it. Also link to the PATH var and properly format
199+
``text.latex.preample``. For the dirs, do we want `tex.cache` or
200+
``tex.cache``? I've been using the latter. We could use rest
201+
specific markup for files and dirs, but I've been resisting goin
202+
whle hog onthe markup... But we may eventually decide that is the
203+
better choice.
204+
205+
#. try and use internal reference links for every section and be
206+
generous with the sections. Eg, I added a section headers and
207+
internal linka for the postscript and unicode sections (we will
208+
want to be able to refer people to these easily from FAQs and mail
209+
list posts, etc)::
210+
211+
.. _usetex-postscript:
212+
213+
Postscript options
214+
==================
215+
216+
Looks good!

doc/users/usetex.rst

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,30 @@ matplotlibrc use::
5252

5353
Here is the standard example, `tex_demo.py`:
5454

55-
.. literalinclude:: ../mpl_examples/pylab_examples/tex_demo.py
55+
.. literalinclude:: ../mpl_examples/pylab_examples/tex_demo.py
5656

5757
.. image:: ../_static/tex_demo.png
5858

5959
Note that display math mode (``$$ e=mc^2 $$``) is not supported, but adding the
6060
command ``\displaystyle``, as in `tex_demo.py`, will produce the same
6161
results.
6262

63+
.. _usetex-unicode:
64+
65+
usetex with unicode
66+
===================
6367
It is also possible to use unicode strings with the LaTeX text manager, here is
6468
an example taken from `tex_unicode_demo.py`:
6569

66-
.. literalinclude:: ../mpl_examples/pylab_examples/tex_unicode_demo.py
70+
.. literalinclude:: ../mpl_examples/pylab_examples/tex_unicode_demo.py
6771

6872
.. image:: ../_static/tex_unicode_demo.png
6973

74+
.. _usetex-postscript:
75+
76+
Postscript options
77+
==================
78+
7079
In order to produce encapsulated postscript files that can be embedded in a new
7180
LaTeX document, the default behavior of matplotlib is to distill the output,
7281
which removes some postscript operators used by LaTeX that are illegal in an
@@ -77,50 +86,59 @@ activated by changing the ``ps.usedistiller`` rc setting to ``xpdf``. This
7786
alternative produces postscript with text that can be edited in Adobe
7887
Illustrator, and searched text in pdf documents.
7988

89+
.. _usetex-hangups:
90+
91+
Possible hangups
92+
================
93+
94+
* On Windows, the PATH environment variable may need to be modified to
95+
find the latex, dvipng and ghostscript executables. This is done by
96+
going to the control panel, selecting the "system" icon, selecting
97+
the "advanced" tab, and clicking the "environment variables" button
98+
(and people think Linux is complicated. Sheesh.) Select the PATH
99+
variable, and add the appropriate directories.
80100

81-
= Possible Hangups =
101+
* Using MiKTeX with Computer Modern fonts, if you get odd -Agg and PNG
102+
results, go to MiKTeX/Options and update your format files
82103

83-
* On Windows, the PATH environment variable may need to be modified to find
84-
the latex, dvipng and ghostscript executables. This is done by going to the
85-
control panel, selecting the "system" icon, selecting the "advanced" tab,
86-
and clicking the "environment variables" button (and people think Linux is
87-
complicated. Sheesh.) Select the PATH variable, and add the appropriate
88-
directories.
104+
* The fonts look terrible on screen. You are probably running Mac OS,
105+
and there is some funny business with dvipng on the mac. Set
106+
text.dvipnghack : True in your matplotlibrc file.
89107

90-
* Using MiKTeX with Computer Modern fonts, if you get odd -Agg and PNG
91-
results, go to MiKTeX/Options and update your format files
108+
* On Ubuntu and Gentoo, the base texlive install does not ship with
109+
the type1cm package. You may need to install some of the extra
110+
packages to get all the goodies that come bundled with other latex
111+
distributions.
92112

93-
* The fonts look terrible on screen. You are probably running Mac OS, and
94-
there is some funny business with dvipng on the mac. Set text.dvipnghack :
95-
True in your matplotlibrc file.
113+
* Some progress has been made so Matplotlib uses the dvi files
114+
directly for text layout. This allows latex to be used for text
115+
layout with the pdf and svg backends, as well as the \*Agg and PS
116+
backends. In the future, a latex installation may be the only
117+
external dependency.
96118

97-
* On Ubuntu and Gentoo, the base texlive install does not ship with the
98-
type1cm package. You may need to install some of the extra packages to get
99-
all the goodies that come bundled with other latex distributions.
119+
.. _usetex-troubleshooting:
100120

101-
* Some progress has been made so Matplotlib uses the dvi files directly for
102-
text layout. This allows latex to be used for text layout with the pdf and
103-
svg backends, as well as the \*Agg and PS backends. In the future, a latex
104-
installation may be the only external dependency.
121+
Trouble shooting
122+
================
105123

106-
= In the event that things dont work =
107-
* Try deleting `tex.cache` from your `~/.matplotlib` directory
124+
* Try deleting `tex.cache` from your `~/.matplotlib` directory
108125

109-
* Make sure LaTeX, dvipng and ghostscript are each working and on your PATH.
126+
* Make sure LaTeX, dvipng and ghostscript are each working and on your PATH.
110127

111-
* Make sure what you are trying to do is possible in a LaTeX document, that
112-
your LaTeX syntax is valid and that you are using raw strings if necessary
113-
to avoid unintended escape sequences.
128+
* Make sure what you are trying to do is possible in a LaTeX document,
129+
that your LaTeX syntax is valid and that you are using raw strings
130+
if necessary to avoid unintended escape sequences.
114131

115-
* Most problems reported on the mailing list have been cleared up by
116-
upgrading Ghostscript_. If possible, please try upgrading to the latest
117-
release before reporting problems to the list.
132+
* Most problems reported on the mailing list have been cleared up by
133+
upgrading Ghostscript_. If possible, please try upgrading to the
134+
latest release before reporting problems to the list.
118135

119-
* The text.latex.preample rc setting is not officially supported. This option
120-
provides lots of flexibility, and lots of ways to cause problems. Please
121-
disable this option before reporting problems to the mailing list.
136+
* The text.latex.preample rc setting is not officially supported. This
137+
option provides lots of flexibility, and lots of ways to cause
138+
problems. Please disable this option before reporting problems to
139+
the mailing list.
122140

123-
* If you still need help, please see :ref:`reporting-problems`
141+
* If you still need help, please see :ref:`reporting-problems`
124142

125143
.. _LaTeX: http://www.tug.org
126144
.. _dvipng: http://sourceforge.net/projects/dvipng

0 commit comments

Comments
 (0)