From 428d1d2c025bdf533ff68ea0f3aed4bf15578c22 Mon Sep 17 00:00:00 2001 From: "C.D. Clark III" Date: Mon, 7 Dec 2015 17:54:05 -0600 Subject: [PATCH] Updated documentation for siunitx support. Added siunitx example to the tutorial in the documentation. --- docs/tutorial.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/tutorial.rst b/docs/tutorial.rst index dd345e7..7da7422 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -248,6 +248,15 @@ If you want to use abbreviated unit names, prefix the specification with `~`: The same is true for latex (`L`) and HTML (`H`) specs. +Pint also supports the LaTeX siunitx package: + +.. doctest:: + + >>> 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} + Finally, you can specify a default format specification: >>> 'The acceleration is {}'.format(accel)