Graphics, Figures & TablesHaving trouble with Package xcolor

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
csma
Posts: 2
Joined: Wed Sep 08, 2021 12:10 am

Having trouble with Package xcolor

Post by csma »

Hello,

I am struggling with xcolor Package. I am using texmaker right now.

Below is the sample code.

Code: Select all

%---------------------------------------------------------------------------------
\documentclass[aspectratio=169,10pt,xcolor={usenames,dvipsnames}]{beamer}


%---------------------------------------------------------------------------------
\mode<presentation>
{
  \usetheme{default}
  \definecolor{myblue}{RGB}{20,60,255} % UBC Blue (primary)
  \definecolor{Black}{RGB}{0,0,0}
  \definecolor{myred}{RGB}{255,40,20}
  \definecolor{mygreen}{RGB}{40,210,20}

  \usecolortheme[named=Black]{structure}
  %\usefonttheme{metropolis}
  \usefonttheme{professionalfonts}
  %\setbeamerfont{title}{family=\rmfamily\selectfont}
  %\setbeamerfont{frametitle}{series=\bfseries,family=\rmfamily\selectfont}
  %\setbeamerfont{section}{series=\bfseries,parent=structure}
  \setbeamertemplate{navigation symbols}{}
  \setbeamertemplate{caption}[numbered]
  \setbeamertemplate{itemize items}{\small$\bullet$}
  \setbeamersize{text margin left=10pt,text margin right=10pt}
  \setbeamertemplate{footline}{%
       \raisebox{5pt}{\makebox[\paperwidth]{\makebox[10pt]{\hspace{8em}\scriptsize \textcolor{black!70}{Ma}} \hfill \makebox[10pt]{\scriptsize \textcolor{black!70}{\insertframenumber}}}}
       }
  \setbeamertemplate{frametitle}{%
       \vspace{5pt}
 	   \usebeamerfont{frametitle}\large\insertframetitle%
 	   \vphantom{g}
 	   \vspace{5pt}
 	   \hrule%
 	   \par
 	   }
}

%---------------------------------------------------------------------------------
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{booktabs}
\usepackage{xcolor}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{subcaption}
\usepackage{appendixnumberbeamer}
\usepackage{lmodern}
\usepackage{setspace}
\usepackage{natbib}
\usepackage{makecell}
\usepackage[export]{adjustbox}
\usepackage[usestackEOL]{stackengine}
\usepackage{caption}
\usepackage{epsfig}
\usepackage{epstopdf}
%\usepackage{graphicx,epstopdf}
\epstopdfsetup{update}
\DeclareGraphicsExtensions{.ps}
\epstopdfDeclareGraphicsRule{.ps}{pdf}{.pdf}{ps2pdf -dEPSCrop -dNOSAFER #1 \OutputFile}


\newcommand\cites[1]{\citeauthor{#1}'s\ (\citeyear{#1})}
\newcommand\hcancel[2][black]{\setbox0=\hbox{$#2$}%
\renewcommand{\figurename}{ }
\rlap{\raisebox{.45\ht0}{\textcolor{#1}{\rule{\wd0}{0.75pt}}}}#2}
%\usepackage[T1]{fontenc}

% Below is for quotation
\usepackage[style=british]{csquotes}
\def\signed #1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip1em
  \hbox{}\nobreak\hfill #1%
  \parfillskip=0pt \finalhyphendemerits=0 \endgraf}}
\newsavebox\mybox
\newenvironment{aquote}[1]
  {\savebox\mybox{#1}\begin{quote}\openautoquote\hspace*{-.7ex}}
  {\unskip\closeautoquote\vspace*{1mm}\signed{\usebox\mybox}\end{quote}}

%---------------------------------------------------------------------------------

%=================================================================================
% Document Start
%=================================================================================
\begin{document}

%---------------------------------------------------------------------------------
\begin{frame}[t]{Test}
\vspace{0.2cm}
\begin{itemize}
    \item[]<1-> \textbf{\textcolor{RoyalBlue}{Test}}
\end{itemize}        
\end{frame}



\end{document}
This gives me an error as follows.
! Package xcolor Error: Undefined color `RoyalBlue'.

However, when I run the same thing with different computer, it works well...

So I was wondering if this is an issue with my computer or the code.

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Having trouble with Package xcolor

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

The example compiles fine here as well. Can you post your .log file here, as attachment?

Stefan
LaTeX.org admin
csma
Posts: 2
Joined: Wed Sep 08, 2021 12:10 am

Having trouble with Package xcolor

Post by csma »

Thank you for your answer.
I just re install every program and now it works. I guess there was some issue with the installation...

Thanks!
Post Reply