~ubuntu-branches/ubuntu/karmic/matplotlib/karmic

« back to all changes in this revision

Viewing changes to doc/users/mathtext.rst

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2009-09-18 10:13:37 UTC
  • mfrom: (2.2.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090918101337-c7wovuqfdi1x1afk
Tags: 0.99.0-1ubuntu1
* Merge from Debian unstable (LP: #419885), remaining changes:
  - Explicitly depend on python-tk as workaround for LP #301007; drop these
    changes if an auto backend discovery is implemented by upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
Fonts
145
145
-----
146
146
 
147
 
The default font is *italics* for mathematical symbols.  To change
148
 
fonts, eg, to write "sin" in a Roman font, enclose the text in a font
149
 
command::
 
147
The default font is *italics* for mathematical symbols.
 
148
 
 
149
.. note::
 
150
 
 
151
   This default can be changed using the ``mathtext.default`` rcParam.
 
152
   This is useful, for example, to use the same font as regular
 
153
   non-math text for math text, by setting it to ``regular``.
 
154
 
 
155
To change fonts, eg, to write "sin" in a Roman font, enclose the text
 
156
in a font command::
150
157
 
151
158
    r'$s(t) = \mathcal{A}\mathrm{sin}(2 \omega t)$'
152
159
 
223
230
 
224
231
.. image:: ../_static/stixsans_fontset.png
225
232
 
 
233
Additionally, you can use ``\mathdefault{...}`` or its alias
 
234
``\mathregular{...}`` to use the font used for regular text outside of
 
235
mathtext.  There are a number of limitations to this approach, most
 
236
notably that far fewer symbols will be available, but it can be useful
 
237
to make math expressions blend well with other text in the plot.
 
238
 
226
239
Custom fonts
227
240
~~~~~~~~~~~~
228
241
 
323
336
 
324
337
 
325
338
 
 
339
 
 
340
 
 
341