aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-02-21 17:17:11 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-02-21 17:18:06 -0800
commit0690df507b5482acb37e67101162189ab0188f21 (patch)
tree6392cd696f26a89d061ed28fd801835f69ca66d8 /src/Text/Pandoc
parent00d20ccd09a8542fda631ab16c7f569098f2918d (diff)
downloadpandoc-0690df507b5482acb37e67101162189ab0188f21.tar.gz
LaTeX writer: Fix image height with percentage.
This previously caused the image to be resized to a percentage of textwidth, rather than textheight. Closes #4389.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index fa72f0f1a..ca59e451b 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -1122,7 +1122,11 @@ inlineToLaTeX (Image attr _ (source, _)) = do
Just (Pixel a) ->
[d <> text (showInInch opts (Pixel a)) <> "in"]
Just (Percent a) ->
- [d <> text (showFl (a / 100)) <> "\\textwidth"]
+ [d <> text (showFl (a / 100)) <>
+ case dir of
+ Width -> "\\textwidth"
+ Height -> "\\textheight"
+ ]
Just dim ->
[d <> text (show dim)]
Nothing ->