I've recently upgraded my computer with new OS, new version of R (4.0) and consequently all packages. When trying to compile a bookdown document to pdf that used to work, I now get the error message
LaTeX Error: Option clash for package xcolor.
If I look at the tex file that is generated then I see that the following packages are added by the bookdown package by default to the file.
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{colortbl}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage[normalem]{ulem}
\usepackage{makecell}
\usepackage{xcolor}
I have a bunch of other LaTeX-packages that are loaded earlier via the _output.yml file and the line in_header: latex/preamble.tex and I'm guessing that the clash is due to one of those. If I manually remove the last line containing \usepackage{xcolor} then everything compiles nicely.
But how do I modify the custom template that is used to add these default packages listed above? I checked the templates listed by pandoc but none of those seem to add these packages.
Following the information in the bookdown book it is possible to add a custom template, but the default LaTeX template from pandoc doesn't include those package either, so where do they come from?
Where can I find the default template that includes these extra packages for me? Or can I perhaps force xcolor to work by including a \PassOptionsToPackage{something}{xcolor} earlier in my LaTeX preamble?
(I am using the bookdown::tufte_book2 format but I haven't found the packages when hunting through the templates in the tufte package)