From 2902260b636b36134c0157e32291900603e1011d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 28 Jun 2017 15:07:35 +0200 Subject: Make `papersize: a4` work regardless of the case of `a4`. It is converted to `a4` in LaTeX and `A4` in ConTeXt. --- src/Text/Pandoc/Writers/ConTeXt.hs | 5 +++++ src/Text/Pandoc/Writers/LaTeX.hs | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'src/Text/Pandoc') 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 @@ -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, -- cgit v1.2.3