git.iko.soy/typeable/pandoc
on master help sign in
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.

commit0690df507b5482acb37e67101162189ab0188f21 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 21 Feb 2018, 17:17 (9 years ago) parent00d20cc
1 file changed+5−1
src/Text/Pandoc/Writers/LaTeX.hs+5−1
src/Text/Pandoc/Writers/LaTeX.hs+5−1
@@ -1122,7 +1122,11 @@ inlineToLaTeX (Image attr _ (source, _)) = do
11221122 Just (Pixel a) ->
11231123 [d <> text (showInInch opts (Pixel a)) <> "in"]
11241124 Just (Percent a) ->
1125− [d <> text (showFl (a / 100)) <> "\\textwidth"]
1125+ [d <> text (showFl (a / 100)) <>
1126+ case dir of
1127+ Width -> "\\textwidth"
1128+ Height -> "\\textheight"
1129+ ]
11261130 Just dim ->
11271131 [d <> text (show dim)]
11281132 Nothing ->