LaTeX reader: better support for \xspace.

Previously we only supported it in inline contexts; now
we support it in all contexts, including math.

Partially addresses #7299.
This commit is contained in:
John MacFarlane
2021-05-19 16:14:49 -07:00
parent 7efb71f4f6
commit 5736b331d8
4 changed files with 43 additions and 15 deletions
+1 -1
View File
@@ -5,5 +5,5 @@
^D
\newcommand{\myFruit}{Mango\xspace}
Mango\xspace is the king of fruits.
Mango is the king of fruits.
```
+23
View File
@@ -0,0 +1,23 @@
```
% pandoc -f latex -t plain
$1-{\ensuremath{r}\xspace}$
^D
1 − r
```
```
% pandoc -f latex -t plain
\newcommand{\foo}{Foo\xspace}
$\text{\foo bar}$
^D
Foo bar
```
```
% pandoc -f latex -t plain
a\xspace b
^D
a b
```