mirror of
https://github.com/jgm/pandoc.git
synced 2026-10-16 14:36:08 +08:00
@@ -1205,7 +1205,8 @@ inlineToLaTeX (Image attr@(_,_,kvs) description (source, _)) = do
|
||||
_ -> ["keepaspectratio"]) <>
|
||||
maybe [] (\x -> ["page=" <> literal x]) (lookup "page" kvs) <>
|
||||
maybe [] (\x -> ["trim=" <> literal x]) (lookup "trim" kvs) <>
|
||||
maybe [] (\x -> ["alt=" <> braces (literal x)]) mbalt <>
|
||||
maybe [] (\x -> ["alt=" <>
|
||||
braces (hsep $ map literal $ T.words x)]) mbalt <>
|
||||
maybe [] (const ["clip"]) (lookup "clip" kvs)
|
||||
options = if null optList
|
||||
then empty
|
||||
|
||||
@@ -70,7 +70,7 @@ tests = [ testGroup "code blocks"
|
||||
"\\begin{description}\n\\item[foo] ~ \n\\subsection{bar}\n\nbaz\n\\end{description}"
|
||||
, "containing image" =:
|
||||
header 1 (image "imgs/foo.jpg" "" (text "Alt text")) =?>
|
||||
"\\section{\\texorpdfstring{\\protect\\pandocbounded{\\includegraphics[keepaspectratio,alt={Alt text}]{imgs/foo.jpg}}}{Alt text}}"
|
||||
"\\section{\\texorpdfstring{\\protect\\pandocbounded{\\includegraphics[keepaspectratio,alt={Alt\ntext}]{imgs/foo.jpg}}}{Alt text}}"
|
||||
]
|
||||
, testGroup "inline code"
|
||||
[ "struck out and highlighted" =:
|
||||
@@ -249,7 +249,7 @@ tests = [ testGroup "code blocks"
|
||||
(plain $ image (pack "img.jpg") (pack "") (text "alt text"))
|
||||
=?>
|
||||
"\\begin{figure}[htbp]\n\\centering\n"
|
||||
<> "\\pandocbounded{\\includegraphics[keepaspectratio,alt={alt text}]{img.jpg}}\n"
|
||||
<> "\\pandocbounded{\\includegraphics[keepaspectratio,alt={alt\ntext}]{img.jpg}}\n"
|
||||
<> "\\caption{caption}\n\\end{figure}"
|
||||
]
|
||||
]
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
^D
|
||||
\begin{figure}
|
||||
\centering
|
||||
\pandocbounded{\includegraphics[keepaspectratio,alt={This is a figure.}]{img.jpg}}
|
||||
\pandocbounded{\includegraphics[keepaspectratio,alt={This is a
|
||||
figure.}]{img.jpg}}
|
||||
\caption{This is a figure.}
|
||||
\end{figure}
|
||||
|
||||
@@ -50,7 +51,8 @@ Right & Left & Center & Default \\
|
||||
\begin{figure}
|
||||
\centering
|
||||
\caption{This is a figure.}
|
||||
\pandocbounded{\includegraphics[keepaspectratio,alt={This is a figure.}]{img.jpg}}
|
||||
\pandocbounded{\includegraphics[keepaspectratio,alt={This is a
|
||||
figure.}]{img.jpg}}
|
||||
\end{figure}
|
||||
|
||||
\begin{longtable}[]{@{}rlcl@{}}
|
||||
@@ -86,7 +88,8 @@ Right & Left & Center & Default \\
|
||||
^D
|
||||
\begin{figure}
|
||||
\centering
|
||||
\pandocbounded{\includegraphics[keepaspectratio,alt={This is a figure.}]{img.jpg}}
|
||||
\pandocbounded{\includegraphics[keepaspectratio,alt={This is a
|
||||
figure.}]{img.jpg}}
|
||||
\caption{This is a figure.}
|
||||
\end{figure}
|
||||
|
||||
|
||||
@@ -60,7 +60,8 @@
|
||||
|
||||
\begin{figure}
|
||||
\centering
|
||||
\pandocbounded{\includegraphics[keepaspectratio,alt={This is a test x = 5}]{test.png}}
|
||||
\pandocbounded{\includegraphics[keepaspectratio,alt={This is a test x =
|
||||
5}]{test.png}}
|
||||
\caption{This is a test
|
||||
\protect\VERB|\NormalTok{x }\OperatorTok{=} \DecValTok{5}|}
|
||||
\end{figure}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
^D
|
||||
\begin{figure}
|
||||
\centering
|
||||
\pandocbounded{\includegraphics[keepaspectratio,page=13,trim=1cm,clip,width=4cm,alt={Global frog population.}]{slides.pdf}}
|
||||
\pandocbounded{\includegraphics[keepaspectratio,page=13,trim=1cm,clip,width=4cm,alt={Global
|
||||
frog population.}]{slides.pdf}}
|
||||
\caption{Global frog population.}
|
||||
\end{figure}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user