@@ -262,7 +262,7 @@ stringToLaTeX context zs = do
262262 isUrl = ctx == URLString
263263 mbAccentCmd =
264264 if writerPreferAscii opts && ctx == TextString
265− then uncons xs >>= \(c,_) -> M.lookup c accents
265+ then uncons xs >>= \(c,_) -> lookupAccent c
266266 else Nothing
267267 emits s =
268268 case mbAccentCmd of
@@ -350,32 +350,30 @@ stringToLaTeX context zs = do
350350 _ -> emitc x
351351 | otherwise -> emitc x
352352
353−accents :: M.Map Char String
354−accents = M.fromList
355− [ ('\779' , "\\H")
356− , ('\768' , "\\`")
357− , ('\769' , "\\'")
358− , ('\770' , "\\^")
359− , ('\771' , "\\~")
360− , ('\776' , "\\\"")
361− , ('\775' , "\\.")
362− , ('\772' , "\\=")
363− , ('\781' , "\\|")
364− , ('\817' , "\\b")
365− , ('\807' , "\\c")
366− , ('\783' , "\\G")
367− , ('\777' , "\\h")
368− , ('\803' , "\\d")
369− , ('\785' , "\\f")
370− , ('\778' , "\\r")
371− , ('\865' , "\\t")
372− , ('\782' , "\\U")
373− , ('\780' , "\\v")
374− , ('\774' , "\\u")
375− , ('\808' , "\\k")
376− , ('\785' , "\\newtie")
377− , ('\8413', "\\textcircled")
378− ]
353+lookupAccent :: Char -> Maybe String
354+lookupAccent '\779' = Just "\\H"
355+lookupAccent '\768' = Just "\\`"
356+lookupAccent '\769' = Just "\\'"
357+lookupAccent '\770' = Just "\\^"
358+lookupAccent '\771' = Just "\\~"
359+lookupAccent '\776' = Just "\\\""
360+lookupAccent '\775' = Just "\\."
361+lookupAccent '\772' = Just "\\="
362+lookupAccent '\781' = Just "\\|"
363+lookupAccent '\817' = Just "\\b"
364+lookupAccent '\807' = Just "\\c"
365+lookupAccent '\783' = Just "\\G"
366+lookupAccent '\777' = Just "\\h"
367+lookupAccent '\803' = Just "\\d"
368+lookupAccent '\785' = Just "\\f"
369+lookupAccent '\778' = Just "\\r"
370+lookupAccent '\865' = Just "\\t"
371+lookupAccent '\782' = Just "\\U"
372+lookupAccent '\780' = Just "\\v"
373+lookupAccent '\774' = Just "\\u"
374+lookupAccent '\808' = Just "\\k"
375+lookupAccent '\8413' = Just "\\textcircled"
376+lookupAccent _ = Nothing
379377
380378toLabel :: PandocMonad m => Text -> LW m Text
381379toLabel z = go `fmap` stringToLaTeX URLString z