aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs7
-rw-r--r--test/command/3450.md2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 70744bde3..18138bf4c 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -1124,7 +1124,12 @@ inlineToLaTeX (Image attr _ (source, _)) = do
Just dim ->
[d <> text (show dim)]
Nothing ->
- []
+ case dir of
+ Width | isJust (dimension Height attr) ->
+ [d <> "\\textwidth"]
+ Height | isJust (dimension Width attr) ->
+ [d <> "\\textheight"]
+ _ -> []
dimList = showDim Width ++ showDim Height
dims = if null dimList
then empty
diff --git a/test/command/3450.md b/test/command/3450.md
index 8759aa0c1..5b35e1d9e 100644
--- a/test/command/3450.md
+++ b/test/command/3450.md
@@ -8,5 +8,5 @@
% pandoc -fmarkdown-implicit_figures -t latex
![image](lalune.jpg){height=2em}
^D
-\includegraphics[height=2em]{lalune.jpg}
+\includegraphics[width=\textwidth,height=2em]{lalune.jpg}
```