@@ -731,7 +731,9 @@ inlineToLaTeX (Code (_,classes,_) str) = do
731731 where listingsCode = do
732732 inNote <- gets stInNote
733733 when inNote $ modify $ \s -> s{ stVerbInNote = True }
734− let chr = ((enumFromTo '!' '~') \\ str) !! 0
734+ let chr = case "!\"&'()*,-./:;?@_" \\ str of
735+ (c:_) -> c
736+ [] -> '!'
735737 return $ text $ "\\lstinline" ++ [chr] ++ str ++ [chr]
736738 highlightCode = do
737739 case highlight formatLaTeXInline ("",classes,[]) str of