LaTeX reader: Fixed space after \figurename etc.

This commit is contained in:
John MacFarlane 2017-08-12 13:40:28 -07:00
parent 3897df868a
commit 0ab8670a0e
2 changed files with 17 additions and 12 deletions

View file

@ -1351,10 +1351,7 @@ inlineCommands = M.fromList $
]
doTerm :: PandocMonad m => Translations.Term -> LP m Inlines
doTerm term = do
s <- (symbol '~' >> return (str "\160")) <|> return space
t <- translateTerm term
return (str t <> s)
doTerm term = str <$> translateTerm term
ifstrequal :: PandocMonad m => LP m Inlines
ifstrequal = do

View file

@ -1,21 +1,29 @@
```
% pandoc -f latex -t plain -M lang=en
\figurename 2
% pandoc -f latex -t native -M lang=en
\figurename\ 2
^D
Figure 2
[Para [Str "Figure\160\&2"]]
```
```
% pandoc -f latex -t plain -M lang=de-DE
\figurename 2
% pandoc -f latex -t native -M lang=de-DE
\figurename\ 2
^D
Abbildung 2
[Para [Str "Abbildung\160\&2"]]
```
```
% pandoc -f latex -t plain -M lang=en
% pandoc -f latex -t native -M lang=en
\setmainlanguage{german}
\figurename 2
^D
Abbildung 2
[Para [Str "Abbildung2"]]
```
```
% pandoc -f latex -t native -M lang=sr
\figurename~2
\figurename.
^D
[Para [Str "Slika\160\&2",SoftBreak,Str "Slika."]]
```