aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-28 15:07:35 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-06-28 15:07:35 +0200
commit2902260b636b36134c0157e32291900603e1011d (patch)
tree288bb78df1e2d472c3f5a33149e4df84622058ed /src/Text
parent7ea49da0021c38579cd7080aec44ab4b1b7b1111 (diff)
downloadpandoc-2902260b636b36134c0157e32291900603e1011d.tar.gz
Make `papersize: a4` work regardless of the case of `a4`.
It is converted to `a4` in LaTeX and `A4` in ConTeXt.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs5
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs4
2 files changed, 9 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index 7886bc052..3c901cab6 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE ScopedTypeVariables #-}
{-
Copyright (C) 2007-2017 John MacFarlane <jgm@berkeley.edu>
@@ -103,6 +104,10 @@ pandocToConTeXt options (Pandoc meta blocks) = do
$ defField "layout" layoutFromMargins
$ defField "number-sections" (writerNumberSections options)
$ maybe id (defField "context-lang") mblang
+ $ (case getField "papersize" metadata of
+ Just ("a4" :: String) -> resetField "papersize"
+ ("A4" :: String)
+ _ -> id)
$ metadata
let context' = defField "context-dir" (toContextDir
$ getField "dir" context) context
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 07ddddcb0..55ecda819 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -256,6 +256,10 @@ pandocToLaTeX options (Pandoc meta blocks) = do
else defField "dir" ("ltr" :: String)) $
defField "section-titles" True $
defField "geometry" geometryFromMargins $
+ (case getField "papersize" metadata of
+ Just ("A4" :: String) -> resetField "papersize"
+ ("a4" :: String)
+ _ -> id) $
metadata
let context' =
-- note: lang is used in some conditionals in the template,