@@ -51,6 +51,10 @@ bracketedText openB closeB = try (do
51-- | Returns an option or argument of a LaTeX command
51-- | Returns an option or argument of a LaTeX command
52optOrArg = choice [ (bracketedText '{' '}'), (bracketedText '[' ']') ]
52optOrArg = choice [ (bracketedText '{' '}'), (bracketedText '[' ']') ]
54+-- | True if the string begins with '{'
55+isArg ('{':rest) = True
54-- | Returns list of options and arguments of a LaTeX command
58-- | Returns list of options and arguments of a LaTeX command
55commandArgs = many optOrArg
59commandArgs = many optOrArg
@@ -549,7 +553,7 @@ link = try (do
550image = try (do
554image = try (do
551 ("includegraphics", _, args) <- command
555 ("includegraphics", _, args) <- command
552− let args' = filter (\arg -> (take 1 arg) /= "[") args
556+ let args' = filter isArg args -- filter out options
553 let src = if null args' then
557 let src = if null args' then
554 Src "" ""
558 Src "" ""