summaryrefslogtreecommitdiff
path: root/docs/tutorial.rst
diff options
context:
space:
mode:
authorPorcelain Mouse <pmouse-github@nobig5.com>2019-12-21 18:41:54 -0800
committerPorcelain Mouse <pmouse-github@nobig5.com>2020-04-04 14:11:04 -0700
commit6335feb03501ac7d159f9a03eea088c09fdda539 (patch)
tree5123d8d9dc0c69fb16ee85ea45227d567e987da6 /docs/tutorial.rst
parent171bd7bc1506ed9329a1e9798de2b1876576e8e6 (diff)
downloadpint-6335feb03501ac7d159f9a03eea088c09fdda539.tar.gz
Updates to Documentation
Diffstat (limited to 'docs/tutorial.rst')
-rw-r--r--docs/tutorial.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index cc8d0e7..474fa2a 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -389,7 +389,7 @@ The same is true for latex (`L`) and HTML (`H`) specs.
The formatting specs (ie 'L', 'H', 'P') can be used with Python string 'formatting
syntax'_ for custom float representations. For example, scientific notation:
-..doctest::
+.. doctest::
>>> 'Scientific notation: {:.3e~L}'.format(accel)
'Scientific notation: 1.300\\times 10^{0}\\ \\frac{\\mathrm{m}}{\\mathrm{s}^{2}}'
@@ -400,7 +400,10 @@ Pint also supports the LaTeX siunitx package:
>>> accel = 1.3 * ureg['meter/second**2']
>>> # siunitx Latex print
>>> print('The siunitx representation is {:Lx}'.format(accel))
- The siunitx representation is \SI[]{1.3}{\meter\per\second\squared}
+ The siunitx representation is \SI{1.3}{\meter\per\second\squared}
+ >>> accel = accel.plus_minus(0.2)
+ >>> print('The siunitx representation is {:Lx}'.format(accel))
+ The siunitx representation is \SI{1.3 +- 0.2}{\meter\per\second\squared}
Additionally, you can specify a default format specification: