@@ -41,7 +41,7 @@ import Network.URI ( isURI, unEscapeString )
4141import Data.Aeson (object, (.=))
4242import Data.List ( (\\), isInfixOf, stripPrefix, intercalate, intersperse, nub, nubBy )
4343import Data.Char ( toLower, isPunctuation, isAscii, isLetter, isDigit, ord )
44−import Data.Maybe ( fromMaybe )
44+import Data.Maybe ( fromMaybe, isJust )
4545import qualified Data.Text as T
4646import Control.Applicative ((<|>))
4747import Control.Monad.State
@@ -146,6 +146,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do
146146 titleMeta <- stringToLaTeX TextString $ stringify $ docTitle meta
147147 authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta
148148 let docLangs = nub $ query (extract "lang") blocks
149+ let hasStringValue x = isJust (getField x metadata :: Maybe String)
149150 let context = defField "toc" (writerTableOfContents options) $
150151 defField "toc-depth" (show (writerTOCDepth options -
151152 if stBook st
@@ -183,6 +184,8 @@ pandocToLaTeX options (Pandoc meta blocks) = do
183184 -- set lang to something so polyglossia/babel is included
184185 defField "lang" (if null docLangs then ""::String else "en") $
185186 defField "otherlangs" docLangs $
187+ defField "colorlinks" (any hasStringValue
188+ ["citecolor", "urlcolor", "linkcolor", "toccolor"]) $
186189 defField "dir" (if (null $ query (extract "dir") blocks)
187190 then ""::String
188191 else "ltr") $