0

I'm using a preamble for a (PDF) markdown document for the first time. I want to insert some png images into my PDF, but I have problem when using include_graphics in my Rmd script.

This is my preamble:

\def\Theme{Verkeersongevallen 2019}
\AtBeginDocument{\let\maketitle\relax}
\usepackage{color}
\usepackage[default,scale=0.8]{opensans}
\definecolor{section_font}{HTML}{516F86}
\definecolor{subsection_font}{HTML}{516F86}
\definecolor{box_background}{HTML}{E2E8EF}
\definecolor{table_blue}{HTML}{6E8DB0}
\usepackage[format=plain,labelfont={color=subsection_font,up,small,bf},textfont={color=subsection_font,small,up},justification=justified,singlelinecheck=false,labelsep=period]{caption}
\usepackage[most]{tcolorbox}
\newtcolorbox{myquote}{colback=box_background,grow to right by=-10mm,grow to left by=-10mm, boxrule=0pt,boxsep=0pt,breakable}
\newcommand{\highlight}[1]{\begin{myquote} #1 \end{myquote}}
\usepackage{xcolor}
\usepackage{floatrow}
\floatsetup[figure]{capposition=top}
\floatsetup[table]{capposition=top}
\usepackage{sectsty}
\usepackage{titlesec}
\sectionfont{\color{section_font}}  
\subsectionfont{\color{subsection_font}}
\subsubsectionfont{\color{subsection_font}}
\usepackage{float}
\floatplacement{figure}{H}
\floatplacement{table}{H}
\usepackage{lipsum}

\usepackage[dvips,xetex]{graphicx}
\usepackage{ifpdf,mla}


\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\headheight}{13.59999pt}
\lhead[RO]{\textcolor{table_blue}{\small{Vias institute}}}
\rhead[RO]{\textcolor{table_blue}{\small{\Theme}}}

When I knit the PDF, I get the following error code:! LaTeX Error: Option clash for package graphicx.

I have added this part: \usepackage[dvips,xetex]{graphicx} \usepackage{ifpdf,mla} just recently, because I had another error before (! Package xkeyval Error: 03in' undefined in families Gin'.).

Any advice would be much appreciated! Regards, Freya

3
  • remove [dvips,xetex], that is unneeded and contradictory. – Ulrike Fischer Mar 11 at 8:09
  • I removed this, but now I get a different error. ! LaTeX Error: Option clash for package color. – Freya Slootmans Mar 11 at 8:20
  • 1
    the errors are due to code you have not shown, you are using the HTML color model without loading xcolor so you must already have loaded it somewhere then you load it again in the code that you have shown, delete the loading of color and xcolor here – David Carlisle Mar 11 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.