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

Skip to content

Commit 2aeb227

Browse files
authored
Merge pull request #25668 from oscargus/textdoc
Fix what's new note for text
2 parents 43772b7 + 27d8c03 commit 2aeb227

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
``mathtext`` now supports ``\text``
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33

4-
``\text`` can be used to obtain upright text within an equation.
4+
``\text`` can be used to obtain upright text within an equation and to get a plain dash
5+
(-).
56

67
.. plot::
78
:include-source: true
89
:alt: Illustration of the newly added \text command, showing that it renders as normal text, including spaces, despite being part of an equation. Also show that a dash is not rendered as a minus when part of a \text command.
910

10-
import matplotlib.pyplot as plt
11-
plt.text(0.1, 0.5, r"$a = \sin(\phi) \text{ such that } \phi = \frac{x}{y}$")
12-
plt.text(0.1, 0.3, r"$\text{dashes (-) are retained}$")
11+
import matplotlib.pyplot as plt
12+
plt.text(0.1, 0.5, r"$a = \sin(\phi) \text{ such that } \phi = \frac{x}{y}$")
13+
plt.text(0.1, 0.3, r"$\text{dashes (-) are retained}$")

0 commit comments

Comments
 (0)