@@ -166,6 +166,11 @@ inlineListToLaTeX :: [Block] -- ^ List of note blocks to use in resolving note
166166inlineListToLaTeX notes lst =
167167 concatMap (inlineToLaTeX notes) lst
168168
169+isQuoted :: Inline -> Bool
170+isQuoted (Quoted _ _) = True
171+isQuoted Apostrophe = True
172+isQuoted _ = False
173+
169174-- | Convert inline element to LaTeX
170175inlineToLaTeX :: [Block] -- ^ List of note blocks to use in resolving note refs
171176 -> Inline -- ^ Inline to convert
@@ -178,9 +183,13 @@ inlineToLaTeX notes (Code str) = "\\verb" ++ [chr] ++ stuffing ++ [chr]
178183 where stuffing = str
179184 chr = ((enumFromTo '!' '~') \\ stuffing) !! 0
180185inlineToLaTeX notes (Quoted SingleQuote lst) =
181− "`" ++ inlineListToLaTeX notes lst ++ "'"
186+ let s1 = if (not (null lst)) && (isQuoted (head lst)) then "\\," else ""
187+ s2 = if (not (null lst)) && (isQuoted (last lst)) then "\\," else "" in
188+ "`" ++ s1 ++ inlineListToLaTeX notes lst ++ s2 ++ "'"
182189inlineToLaTeX notes (Quoted DoubleQuote lst) =
183− "``" ++ inlineListToLaTeX notes lst ++ "''"
190+ let s1 = if (not (null lst)) && (isQuoted (head lst)) then "\\," else ""
191+ s2 = if (not (null lst)) && (isQuoted (last lst)) then "\\," else "" in
192+ "``" ++ s1 ++ inlineListToLaTeX notes lst ++ s2 ++ "''"
184193inlineToLaTeX notes Apostrophe = "'"
185194inlineToLaTeX notes EmDash = "---"
186195inlineToLaTeX notes EnDash = "--"