diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-12-10 09:07:46 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-12-10 09:07:46 -0800 |
commit | 4ffa70970dc7219aa71c137c728280b7460ed604 (patch) | |
tree | 34d2995f2c377cf673a8be8a9cda9f7fa942ad18 /src/Text/Pandoc | |
parent | 2b1ddc26801abd94fcf5a3cdf312cbf4156843f4 (diff) | |
parent | 7960013cd4586542c2d7feab908a8befccc677f0 (diff) | |
download | pandoc-4ffa70970dc7219aa71c137c728280b7460ed604.tar.gz |
Merge pull request #1695 from bjornbm/master
Escape inline verbatim spaces in LaTeX output
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index ae2f4e907..417317b54 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -746,8 +746,10 @@ inlineToLaTeX (Code (_,classes,_) str) = do Nothing -> rawCode Just h -> modify (\st -> st{ stHighlighting = True }) >> return (text h) - rawCode = liftM (text . (\s -> "\\texttt{" ++ s ++ "}")) + rawCode = liftM (text . (\s -> "\\texttt{" ++ escapeSpaces s ++ "}")) $ stringToLaTeX CodeString str + where + escapeSpaces = concatMap (\c -> if c == ' ' then "\\ " else [c]) inlineToLaTeX (Quoted qt lst) = do contents <- inlineListToLaTeX lst csquotes <- liftM stCsquotes get |