@@ -51,6 +51,10 @@ bracketedText openB closeB = try (do
5151-- | Returns an option or argument of a LaTeX command
5252optOrArg = choice [ (bracketedText '{' '}'), (bracketedText '[' ']') ]
5353
54+-- | True if the string begins with '{'
55+isArg ('{':rest) = True
56+isArg other = False
57+
5458-- | Returns list of options and arguments of a LaTeX command
5559commandArgs = many optOrArg
5660
@@ -549,7 +553,7 @@ link = try (do
549553
550554image = try (do
551555 ("includegraphics", _, args) <- command
552− let args' = filter (\arg -> (take 1 arg) /= "[") args
556+ let args' = filter isArg args -- filter out options
553557 let src = if null args' then
554558 Src "" ""
555559 else