From fe312b0a7a0e63e307162da47dc9f1ca8f47737f Mon Sep 17 00:00:00 2001 From: John MacFarlane <jgm@berkeley.edu> Date: Thu, 16 Aug 2018 20:48:51 -0700 Subject: [PATCH] LaTeX writer/template: be sensitive to `filecolor` variable. `linkcolor` only affects internal links, and `urlcolor` only affects linked URLs. For external links, the option to use is `filecolor`. Closes #4822. --- MANUAL.txt | 12 +++++++----- data/templates/default.latex | 1 + src/Text/Pandoc/Writers/LaTeX.hs | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 3e0e92452..7ba9e188e 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1526,12 +1526,14 @@ LaTeX variables are used when [creating a PDF]. : options to pass to the microtype package `colorlinks` -: add color to link text; automatically enabled if any of `linkcolor`, `citecolor`, - `urlcolor`, or `toccolor` are set +: add color to link text; automatically enabled if any of + `linkcolor`, `filecolor`, `citecolor`, `urlcolor`, or `toccolor` are set -`linkcolor`, `citecolor`, `urlcolor`, `toccolor` -: color for internal links, citation links, external links, and links in table of contents: - uses options allowed by [`xcolor`], including the `dvipsnames`, `svgnames`, and `x11names` lists +`linkcolor`, `filecolor`, `citecolor`, `urlcolor`, `toccolor` +: color for internal links, external links, citation links, linked + URLs, and links in table of contents, respectively: uses options + allowed by [`xcolor`], including the `dvipsnames`, `svgnames`, and + `x11names` lists `links-as-notes` : causes links to be printed as footnotes diff --git a/data/templates/default.latex b/data/templates/default.latex index 795b6c868..c2e32e006 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -183,6 +183,7 @@ $endif$ $if(colorlinks)$ colorlinks=true, linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$, + filecolor=$if(filecolor)$$filecolor$$else$Maroon$endif$, citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$, urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$, $else$ diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index a3be5ecb7..3db643503 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -248,7 +248,8 @@ pandocToLaTeX options (Pandoc meta blocks) = do defField "biblatex" True _ -> id) $ defField "colorlinks" (any hasStringValue - ["citecolor", "urlcolor", "linkcolor", "toccolor"]) $ + ["citecolor", "urlcolor", "linkcolor", "toccolor", + "filecolor"]) $ (if null dirs then id else defField "dir" ("ltr" :: String)) $