aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEmerson Harkin <emerson.f.harkin@gmail.com>2020-07-23 19:47:32 -0400
committerGitHub <noreply@github.com>2020-07-23 16:47:32 -0700
commit1b8f1611983706f81cc33db4c4fe0ce379973c65 (patch)
tree1e90c52e927870084fefd1bdc3868267d5fcf22b /test
parentc37a56e0606e796f60077cd3fca5494bfebf2186 (diff)
downloadpandoc-1b8f1611983706f81cc33db4c4fe0ce379973c65.tar.gz
Minimal support for SIRange in LaTeX reader (#6418)
Add support for `\SIRange{firstnumber}{secondnumber}{unit}` provided by siunitx. An en-dash is used instead of localized "to".
Diffstat (limited to 'test')
-rw-r--r--test/command/3587.md59
1 files changed, 59 insertions, 0 deletions
diff --git a/test/command/3587.md b/test/command/3587.md
index 414593b39..a8c3a576c 100644
--- a/test/command/3587.md
+++ b/test/command/3587.md
@@ -55,3 +55,62 @@
[Para [Str "18.2\160\176C"]]
```
+# SIRange tests
+
+## Integer range with simple common units
+
+```
+% pandoc -f latex -t native
+\SIRange{10}{20}{\gram}
+^D
+[Para [Str "10\160g\8211\&20\160g"]]
+```
+```
+% pandoc -f latex -t native
+\SIRange{35}{9}{\milli\meter}
+^D
+[Para [Str "35\160mm\8211\&9\160mm"]]
+```
+```
+% pandoc -f latex -t native
+\SIRange{4}{97367265}{\celsius}
+^D
+[Para [Str "4\160\176C\8211\&97367265\160\176C"]]
+```
+
+## Decimal range with simple units
+
+```
+% pandoc -f latex -t native
+\SIRange{4.5}{97367265.5}{\celsius}
+^D
+[Para [Str "4.5\160\176C\8211\&97367265.5\160\176C"]]
+```
+
+## Squared units
+
+```
+% pandoc -f latex -t native
+\SIRange{10}{20}{\square\meter}
+^D
+[Para [Str "10\160m\178\8211\&20\160m\178"]]
+```
+
+## Ignore round precision
+
+`round-precision` option appears to be ignored by `\SI` as of 7c6dbd37e, so
+`\SIRange` will ignore it as well.
+
+```
+% pandoc -f latex -t native
+\SIRange[round-precision=2]{10}{20}{\gram}
+^D
+[Para [Str "10\160g\8211\&20\160g"]]
+```
+```
+% pandoc -f latex -t native
+\SIRange[round-precision=2]{10.0}{20.25}{\gram}
+^D
+[Para [Str "10.0\160g\8211\&20.25\160g"]]
+```
+