summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-02 10:31:58 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-02 10:31:58 -0800
commit22eb15ec3521fefdeaa93cb6fa02931afb602fe0 (patch)
treecf223464d282501a9fa0ee380e453265b66c3d29
parentecfb5a08381dcfd3eb1c586ceb6cbc3aea96a7d5 (diff)
LaTeX writer: escape `_` in code with --listings.
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 18138bf4c..3b2cd214e 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -1013,7 +1013,7 @@ inlineToLaTeX (Code (_,classes,_) str) = do
let chr = case "!\"&'()*,-./:;?@_" \\ str of
(c:_) -> c
[] -> '!'
- let str' = escapeStringUsing (backslashEscapes "\\{}%~") str
+ let str' = escapeStringUsing (backslashEscapes "\\{}%~_") str
-- we always put lstinline in a dummy 'passthrough' command
-- (defined in the default template) so that we don't have
-- to change the way we escape characters depending on whether