aboutsummaryrefslogtreecommitdiff
path: root/test/command/newif.md
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-05-26 22:50:35 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-05-27 09:15:04 -0700
commit81eadfd99ad3e905b806cc6c80ab0fea0185286f (patch)
tree20aca56660789331dc9cd034c7e1f1f4116d8e95 /test/command/newif.md
parente0a1f7d2cfa1b18210ea13e0aa03747e6c76e5c5 (diff)
downloadpandoc-81eadfd99ad3e905b806cc6c80ab0fea0185286f.tar.gz
LaTeX reader: improve `\def` and implement `\newif`.
- Improve parsing of `\def` macros. We previously set "verbatim mode" even for parsing the initial `\def`; this caused problems for things like ``` \def\foo{\def\bar{BAR}} \foo \bar ``` - Implement `\newif`. - Add tests.
Diffstat (limited to 'test/command/newif.md')
-rw-r--r--test/command/newif.md55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/command/newif.md b/test/command/newif.md
new file mode 100644
index 000000000..f444f14c9
--- /dev/null
+++ b/test/command/newif.md
@@ -0,0 +1,55 @@
+```
+% pandoc -f latex -t plain
+\iftrue
+should print
+\iftrue
+should print
+\else
+should not print
+\fi
+\else
+should not print
+\fi
+
+\iffalse
+should not print
+\else
+\iftrue
+should print
+\else
+should not print
+\fi
+\fi
+
+\newif\ifepub
+
+\ifepub
+should not print
+\fi
+
+\epubtrue
+
+\ifepub
+should print
+\else
+should not print
+\fi
+
+\epubfalse
+
+\ifepub
+should not print
+\else
+should print
+\fi
+^D
+should print
+
+should print
+
+should print
+
+should print
+
+should print
+```