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

Skip to content

Commit 3a5398f

Browse files
committed
responded to JDH review comments on usetex.rst
svn path=/trunk/matplotlib/; revision=5483
1 parent b0f8e6b commit 3a5398f

5 files changed

Lines changed: 98 additions & 39 deletions

File tree

doc/devel/outline.rst

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ 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
35-
configuration Darren preliminary ?
35+
configuration Darren submitted ?
3636
win32 install Charlie ? no author Darren
3737
os x install Charlie ? no author ?
3838
linux install Darren has author ?
@@ -245,27 +245,48 @@ usetex user's guide-- reviewed by JDH
245245

246246
Review of :ref:`usetex-tutorial`:
247247

248-
#. In the section on the ps distiller, you might mention that it is
249-
the rasterization which some users find objectionable, and the
250-
distiller pram (eg 6000) is a dpi setting for the rasterizer. Not
251-
everyone will immediately grasp the controversy surrounding dumping
252-
high res bitmaps into a ps file.
248+
#. DONE - In the section on the ps distiller, you might mention that it is the
249+
rasterization which some users find objectionable, and the distiller pram
250+
(eg 6000) is a dpi setting for the rasterizer. Not everyone will
251+
immediately grasp the controversy surrounding dumping high res bitmaps into
252+
a ps file.
253253

254-
#. ``= Possible Hangups =`` - this is moin, not rest. I have fixed
255-
this already, just wanted to point it out. Also, for everything
256-
but top level chapters, I refer ``Upper lower`` for section
257-
titles, eg ``Possible hangups``.
254+
#. DONE - ``= Possible Hangups =`` - this is moin, not rest. I have
255+
fixed this already, just wanted to point it out. Also, for everything but
256+
top level chapters, I refer ``Upper lower`` for section titles, eg
257+
``Possible hangups``.
258258

259-
#. in the troubleshooting section, could you add a FAQ showing how to
259+
#. DONE - in the troubleshooting section, could you add a FAQ showing how to
260260
find their .matplotlib dir (matplotlib.get_data_path) and link to
261-
it. Also link to the PATH var and properly format
262-
``text.latex.preample``. For the dirs, do we want `tex.cache` or
261+
it.
262+
263+
I think you mean mpl.get_configdir. I added this to the faq/HOWTO, and
264+
linked to it from usetex.rst and customizing.rst. I also added the
265+
MPLCONFIGDIR environment variable to environment_variables_faq.rst.
266+
267+
DONE - Also link to the PATH var and properly format
268+
``text.latex.preample``.
269+
270+
DONE - For the dirs, do we want `tex.cache` or
263271
``tex.cache``? I've been using the latter. We could use rest
264272
specific markup for files and dirs, but I've been resisting goin
265273
whle hog onthe markup... But we may eventually decide that is the
266274
better choice.
267275

268-
#. try and use internal reference links for every section and be
276+
I think we should use the directive provided by sphinx::
277+
278+
:file:`tex.cache`
279+
280+
I don't think that looks too ugly in ascii, its clear what it means. If you
281+
don't like it, I think we should use::
282+
283+
``tex.cache``
284+
285+
which is formatted most
286+
similarly to the :file: directive in html. Let me know if you don't want to
287+
use the file directive.
288+
289+
#. DONE - try and use internal reference links for every section and be
269290
generous with the sections. Eg, I added a section headers and
270291
internal linka for the postscript and unicode sections (we will
271292
want to be able to refer people to these easily from FAQs and mail
@@ -277,3 +298,5 @@ Review of :ref:`usetex-tutorial`:
277298
==================
278299

279300
Looks good!
301+
302+
Thanks!

doc/faq/environment_variables_faq.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@ Environment Variables
1717
The list of directories that is added to Python's standard search list when
1818
importing packages and modules
1919

20+
.. envvar:: MPLCONFIGDIR
2021

21-
Setting Environment Variables in Linux
22-
======================================
22+
This is the directory used to store user customizations to matplotlib, as
23+
well as some caches to improve performance. If :envvar:`MPLCONFIGDIR` is not
24+
defined, :file:`{HOME}/.matplotlib` is used by default.
25+
26+
.. _setting-linux-osx-environment-variables:
27+
28+
Setting Environment Variables in Linux and OS-X
29+
===============================================
2330

2431
To list the current value of :envvar:`PYTHONPATH`, which may be empty, try::
2532

@@ -71,6 +78,7 @@ first or last? To append to an existing environment variable::
7178
To make your changes available in the future, add the commands to your
7279
`~/.cshrc` file.
7380

81+
.. _setting-windows-environment-variables:
7482

7583
Setting Environment Variables in Windows
7684
========================================

doc/faq/howto_faq.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@
44
HOWTO
55
*****
66

7+
.. _locating-matplotlib-config-dir:
8+
9+
Where is my .matplotlib directory?
10+
==================================
11+
12+
Each user has a :file:`.matplotlib/` directory which may contain a
13+
:ref:`matplotlibrc <customizing-with-matplotlibrc-files>` file and various
14+
caches to improve matplotlib's performance. To locate your :file:`.matplotlib/`
15+
directory, use :func:`matplotlib.get_configdir`:
16+
17+
>>> import matplotlib as mpl
18+
>>> mpl.get_configdir()
19+
'/home/darren/.matplotlib'
20+
21+
This directory is generally located in your :envvar:`HOME` directory, but if
22+
you would like to use a configuration directory other than
23+
:file:`{HOME}/.matplotlib/`, you can do so by specifying the location in your
24+
:envvar:`MPLCONFIGDIR` environment variable.
25+
726
.. _howto-ticks:
827

928
How do I configure the tick linewidths?

doc/users/customizing.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
Customizing matplotlib
55
**********************
66

7+
.. _customizing-with-matplotlibrc-files:
8+
79
The matplotlibrc File
810
=====================
911

@@ -16,8 +18,8 @@ locations, in the following order:
1618

1719
1. :file:`matplotlibrc` in the current working directory, usually used for
1820
specific customizations that you do not want to apply elsewhere.
19-
2. :file:`{HOME}/.matplotlib/matplotlibrc`, for the user's default
20-
customizations
21+
2. :file:`.matplotlib/matplotlibrc`, for the user's default customizations. See
22+
:ref:`locating-matplotlib-config-dir`.
2123
3. :file:`{INSTALL}/matplotlib/mpl-data/matplotlibrc`, where :file:`{INSTALL}`
2224
is something like :file:`/usr/lib/python2.5/site-packages` on Linux, and
2325
maybe :file:`C:\Python25\Lib\site-packages` on Windows. Every time you
@@ -27,6 +29,8 @@ locations, in the following order:
2729

2830
See below for a sample :ref:`matplotlibrc file<matplotlibrc-sample>`.
2931

32+
.. _customizing-with-dynamic-rc-settings:
33+
3034
Dynamic rc Settings
3135
===================
3236

doc/users/usetex.rst

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -79,51 +79,56 @@ Postscript options
7979
In order to produce encapsulated postscript files that can be embedded in a new
8080
LaTeX document, the default behavior of matplotlib is to distill the output,
8181
which removes some postscript operators used by LaTeX that are illegal in an
82-
eps file. This step produces fonts which may be unacceptable to some users. One
83-
workaround is to to set ``ps.distiller.res`` to a higher value (perhaps 6000) in
84-
your rc settings. A better workaround, which requires Poppler_ or Xpdf_, can be
82+
eps file. This step produces results which may be unacceptable to some users,
83+
because the text is coarsely rasterized and converted to bitmaps, which are not
84+
scalable like standard postscript, and the text is not searchable. One
85+
workaround is to to set ``ps.distiller.res`` to a higher value (perhaps 6000)
86+
in your rc settings, which will produce larger files but may look better and
87+
scale reasonably. A better workaround, which requires Poppler_ or Xpdf_, can be
8588
activated by changing the ``ps.usedistiller`` rc setting to ``xpdf``. This
86-
alternative produces postscript with text that can be edited in Adobe
87-
Illustrator, and searched text in pdf documents.
89+
alternative produces postscript without rasterizing text, so it scales
90+
properly, can be edited in Adobe Illustrator, and searched text in pdf
91+
documents.
8892

8993
.. _usetex-hangups:
9094

9195
Possible hangups
9296
================
9397

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.
98+
* On Windows, the :envvar:`PATH` environment variable may need to be modified
99+
to include the directories containing the latex, dvipng and ghostscript
100+
executables. See :ref:`environment-variables` and
101+
:ref:`setting-windows-environment-variables` for details.
100102

101-
* Using MiKTeX with Computer Modern fonts, if you get odd -Agg and PNG
103+
* Using MiKTeX with Computer Modern fonts, if you get odd \*Agg and PNG
102104
results, go to MiKTeX/Options and update your format files
103105

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.
106+
* The fonts look terrible on screen. You are probably running Mac OS, and there
107+
is some funny business with older versions of dvipng on the mac. Set
108+
``text.dvipnghack : True`` in your matplotlibrc file.
107109

108110
* On Ubuntu and Gentoo, the base texlive install does not ship with
109111
the type1cm package. You may need to install some of the extra
110112
packages to get all the goodies that come bundled with other latex
111113
distributions.
112114

113-
* Some progress has been made so Matplotlib uses the dvi files
115+
* Some progress has been made so matplotlib uses the dvi files
114116
directly for text layout. This allows latex to be used for text
115117
layout with the pdf and svg backends, as well as the \*Agg and PS
116118
backends. In the future, a latex installation may be the only
117119
external dependency.
118120

119121
.. _usetex-troubleshooting:
120122

121-
Trouble shooting
122-
================
123+
Troubleshooting
124+
===============
123125

124-
* Try deleting `tex.cache` from your `~/.matplotlib` directory
126+
* Try deleting your :file:`.matplotlib/tex.cache` directory. If you don't know
127+
where to find :file:`.matplotlib`, see
128+
:ref:`locating-matplotlib-config-dir`.
125129

126-
* Make sure LaTeX, dvipng and ghostscript are each working and on your PATH.
130+
* Make sure LaTeX, dvipng and ghostscript are each working and on your
131+
:envvar:`PATH`.
127132

128133
* Make sure what you are trying to do is possible in a LaTeX document,
129134
that your LaTeX syntax is valid and that you are using raw strings
@@ -133,7 +138,7 @@ Trouble shooting
133138
upgrading Ghostscript_. If possible, please try upgrading to the
134139
latest release before reporting problems to the list.
135140

136-
* The text.latex.preample rc setting is not officially supported. This
141+
* The ``text.latex.preamble`` rc setting is not officially supported. This
137142
option provides lots of flexibility, and lots of ways to cause
138143
problems. Please disable this option before reporting problems to
139144
the mailing list.

0 commit comments

Comments
 (0)