@@ -33,7 +33,7 @@ import Text.Pandoc.Shared
3333import Text.Pandoc.Templates
3434import Text.Printf ( printf )
3535import Data.List ( (\\), isSuffixOf, isPrefixOf, intersperse, intercalate )
36−import Data.Char ( toLower )
36+import Data.Char ( toLower, isPunctuation )
3737import Control.Monad.State
3838import Text.PrettyPrint.HughesPJ hiding ( Str )
3939import System.FilePath (dropExtension)
@@ -428,8 +428,12 @@ citeCommand c p s k = do
428428
429429citeArguments :: [Inline] -> [Inline] -> String -> State WriterState Doc
430430citeArguments p s k = do
431+ let s' = case s of
432+ (Str (x:[]) : r) | isPunctuation x -> dropWhile (== Space) r
433+ (Str (x:xs) : r) | isPunctuation x -> Str xs : r
434+ _ -> s
431435 pdoc <- inlineListToLaTeX p
432− sdoc <- inlineListToLaTeX s
436+ sdoc <- inlineListToLaTeX s'
433437 let optargs = case (isEmpty pdoc, isEmpty sdoc) of
434438 (True, True ) -> empty
435439 (True, False) -> brackets sdoc