git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: allow specifying just width or height for image size.
1193c1aJohn MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+6−1
@@ -1124,7 +1124,12 @@ inlineToLaTeX (Image attr _ (source, _)) = do
1124 Just dim ->
1124 Just dim ->
1125 [d <> text (show dim)]
1125 [d <> text (show dim)]
1126 Nothing ->
1126 Nothing ->
1127+ case dir of
1128+ Width | isJust (dimension Height attr) ->
1129+ [d <> "\\textwidth"]
1130+ Height | isJust (dimension Width attr) ->
1131+ [d <> "\\textheight"]
1127− []
1132+ _ -> []
1128 dimList = showDim Width ++ showDim Height
1133 dimList = showDim Width ++ showDim Height
1129 dims = if null dimList
1134 dims = if null dimList
1130 then empty
1135 then empty
test/command/3450.md+1−1
@@ -8,5 +8,5 @@
8% pandoc -fmarkdown-implicit_figures -t latex
8% pandoc -fmarkdown-implicit_figures -t latex
9![image](lalune.jpg){height=2em}
9![image](lalune.jpg){height=2em}
10^D
10^D
11−\includegraphics[height=2em]{lalune.jpg}
11+\includegraphics[width=\textwidth,height=2em]{lalune.jpg}
12```
12```