@@ -1131,7 +1131,9 @@ inlineToLaTeX (Strong lst) =
11311131inlineToLaTeX (Strikeout lst) = do
11321132 -- we need to protect VERB in an mbox or we get an error
11331133 -- see #1294
1134− contents <- inlineListToLaTeX $ protectCode lst
1134+ -- with regular texttt we don't get an error, but we get
1135+ -- incorrect results if there is a space, see #5529
1136+ contents <- inlineListToLaTeX $ walk (concatMap protectCode) lst
11351137 modify $ \s -> s{ stStrikeout = True }
11361138 return $ inCmd "sout" contents
11371139inlineToLaTeX (Superscript lst) =
@@ -1336,12 +1338,10 @@ handleMathComment s =
13361338 '%':_ -> s ++ "\n"
13371339 _ -> s
13381340
1339−protectCode :: [Inline] -> [Inline]
1340−protectCode [] = []
1341−protectCode (x@(Code ("",[],[]) _) : xs) = x : protectCode xs
1342−protectCode (x@(Code _ _) : xs) = ltx "\\mbox{" : x : ltx "}" : xs
1341+protectCode :: Inline -> [Inline]
1342+protectCode x@(Code _ _) = [ltx "\\mbox{" , x , ltx "}"]
13431343 where ltx = RawInline (Format "latex")
1344−protectCode (x : xs) = x : protectCode xs
1344+protectCode x = [x]
13451345
13461346setEmptyLine :: PandocMonad m => Bool -> LW m ()
13471347setEmptyLine b = modify $ \st -> st{ stEmptyLine = b }