@@ -166,6 +166,11 @@ inlineListToLaTeX :: [Block] -- ^ List of note blocks to use in resolving note
166inlineListToLaTeX notes lst =
166inlineListToLaTeX notes lst =
167 concatMap (inlineToLaTeX notes) lst
167 concatMap (inlineToLaTeX notes) lst
169+isQuoted :: Inline -> Bool
170+isQuoted (Quoted _ _) = True
171+isQuoted Apostrophe = True
169-- | Convert inline element to LaTeX
174-- | Convert inline element to LaTeX
170inlineToLaTeX :: [Block] -- ^ List of note blocks to use in resolving note refs
175inlineToLaTeX :: [Block] -- ^ List of note blocks to use in resolving note refs
171 -> Inline -- ^ Inline to convert
176 -> Inline -- ^ Inline to convert
@@ -178,9 +183,13 @@ inlineToLaTeX notes (Code str) = "\\verb" ++ [chr] ++ stuffing ++ [chr]
178 where stuffing = str
183 where stuffing = str
179 chr = ((enumFromTo '!' '~') \\ stuffing) !! 0
184 chr = ((enumFromTo '!' '~') \\ stuffing) !! 0
180inlineToLaTeX notes (Quoted SingleQuote lst) =
185inlineToLaTeX notes (Quoted SingleQuote 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
181− "`" ++ inlineListToLaTeX notes lst ++ "'"
188+ "`" ++ s1 ++ inlineListToLaTeX notes lst ++ s2 ++ "'"
182inlineToLaTeX notes (Quoted DoubleQuote lst) =
189inlineToLaTeX notes (Quoted DoubleQuote 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
183− "``" ++ inlineListToLaTeX notes lst ++ "''"
192+ "``" ++ s1 ++ inlineListToLaTeX notes lst ++ s2 ++ "''"
184inlineToLaTeX notes Apostrophe = "'"
193inlineToLaTeX notes Apostrophe = "'"
185inlineToLaTeX notes EmDash = "---"
194inlineToLaTeX notes EmDash = "---"
186inlineToLaTeX notes EnDash = "--"
195inlineToLaTeX notes EnDash = "--"