TeX - LaTeX Asked on June 18, 2021
I have the following YAML in a .md
file and everything is working smooth.
But I want to use xcolor
to change color for TOC.
Pandoc Manual (see here) says:
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
My Question is: how do I pass xcolor option / or how to use svgnames
color, because if I change
toccolor: Blue
to toccolor: DarkBlue
I get undefined color.
Error producing PDF.
! Package xcolor Error: Undefined color `DarkBlue'.
See the xcolor package documentation for explanation.
Type H <return> for immediate help.
Here is the YAML Code
---
title: Name of the Article
author: Author Name
date: today
lang: ro-RO
geometry:
- a4paper
- margin=2.5cm
- heightrounded
header-includes: |
usepackage{fancyhdr}
pagestyle{fancy}
fancyhead[L]{textbf{leftmark}}
fancyhead[R]{textbf{rightmark}}
lfoot{}cfoot{thepage}rfoot{}
numbersections: yes,
linestretch: 1.2
toccolor: Blue
bibliography: [X:/absolute/path/to/ref.bib]
csl: [X:/absolute/path/to/chicago-fullnote-bibliography.csl]
documentclass: article
toc: true
---
As @Marijn suggested by pointing to Github there is an issue with the default.latex
template, meaning that instead of
PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
currently, template has:
PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
Pandoc version 2.13
has this issue, but the template is fixed on GitHub therefore will be shipped with the next version
Solution for this problem is the following:
pandoc -D latex > default.latex
This will copy the template in the current directory.
remove *
from svgnames
and x11names
in the line PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
copy the modified default.latex
to C:UsersUSERNAMEAppDataRoamingpandoctemplates
run as ussualy: pandoc INPUT.md -o OUTPUT.pdf
Thanks a lot, @Marijn!
Correct answer by Mafsi on June 18, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP