blob: 1942639f661e88343850dd53c7dae74c26e8b3db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
smartunits
==========
A [LaTeX](http://en.wikipedia.org/wiki/LaTeX) package that implements
automatic conversions between (some) metric and Imperial units.
Example
-------
```tex
\documentclass{article}
\usepackage{smartunits}
\begin{document}
\SmartUnitSettings{metric imperial, places=1}
\SmartUnit{cm=10} % 10 cm (4')
\SmartUnit{celsius=20} % 20 C (43 F)
\SmartUnit{miles=5} % 8 km (5 mi)
\SmartUnit{miles=5, precision=1} % 8.0 km (5 mi)
\SmartUnit{miles=5, km=7} % 7 km (5 mi)
\end{document}
```
Units supported
---------------
Currently smartunits converts between the following five classes of units:
============ ==============
Metric Imperial
------------ -------------- -------------
kilometers miles (distance)
centimeters feet and inches (length)
Celsius Fahrenheit (temperature)
24-hour time 12-hour time (time)
litres USA/UK gallons (volume)
kilograms pounds (weight)
============ ============== =============
It is quite easy to extend the code to other units. I am happy to consider new requests.
Requirements
------------
The package requires
[pgfkeys](https://www.ctan.org/pkg/pgfkeys) and
[siunitx](https://www.ctan.org/pkg/siunitx).
### Author
Copyright (c) 2016 [Andrew Mathas](mailto:andrew.mathas@gmail.com)
Released under the [LaTeX Project Public
License](http://www.latex-project.org/lppl.txt) v1.3c or later
|