-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
I am experiencing an issue similar to #6114 on pandoc v3.6.3 (Lua 5.4) on Arch Linux,
$ pandoc -f latex -t native
\includegraphics[width=5cm]{abc.jpg}
^D
[ Para
[ Image
( "" , [] , [ ( "width" , "5cm" ) ] )
[ Str "image" ]
( "abc.jpg" , "" )
]
]
$ pandoc -f latex -t native # from issue 6114, works as expected
\includegraphics[width=5cm]
{abc.jpg}
^D
[ Para
[ Image
( "" , [] , [ ( "width" , "5cm" ) ] )
[ Str "image" ]
( "abc.jpg" , "" )
]
]
$ pandoc -f latex -t native
\includegraphics[
width=5cm,
]{abc.jpg}
^D
Error at "source" (line 1, column 1):
unexpected Tok (line 1, column 1) (CtrlSeq "includegraphics") "\\includegraphics"
expecting end of input
$ pandoc -f latex -t native
\includegraphics[%
width=5cm,%
]{abc.jpg}
^D
Error at "source" (line 1, column 1):
unexpected Tok (line 1, column 1) (CtrlSeq "includegraphics") "\\includegraphics"
expecting end of input
# This does produce an output, but treats '%' signs as part of the filename rather than comments.
$ pandoc -f latex -t native
\includegraphics[width=5cm]{%
abc.jpg%
}
^D
[ Para
[ Image
( "" , [] , [ ( "width" , "5cm" ) ] )
[ Str "image" ]
( "%\nabc.jpg%\n" , "" )
]
]
Here's a minimal document in LaTeX showing that the syntax is valid
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=5cm]{example-image-a}
\includegraphics[
width=5cm,
]{example-image-a}
\includegraphics[%
width=5cm,%
]{example-image-a}
\includegraphics[width=5cm]{%
example-image-a%
}
\end{document}
In all afore-mentioned cases, I think the expected output should be
[ Para
[ Image
( "" , [] , [ ( "width" , "5cm" ) ] )
[ Str "image" ]
( "abc.jpg" , "" )
]
]