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

Skip to content

Commit b186fbb

Browse files
committed
Document \mathdefault{} and \mathregular{} and the new mathtext.default rcParam.
svn path=/trunk/matplotlib/; revision=6703
1 parent 40356df commit b186fbb

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

doc/users/mathtext.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,16 @@ commands such as fractions or sub/superscripts::
144144
Fonts
145145
-----
146146

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::
150157

151158
r'$s(t) = \mathcal{A}\mathrm{sin}(2 \omega t)$'
152159

@@ -223,6 +230,12 @@ selected using the ``mathtext.fontset`` parameter in
223230

224231
.. image:: ../_static/stixsans_fontset.png
225232

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+
226239
Custom fonts
227240
~~~~~~~~~~~~
228241

0 commit comments

Comments
 (0)