0

So I get this Package xcolor Error but I'm already using the color package which should include the color black but I still get this message.

I've tried multiple other solutions on this forum already but they were no good. The weird thing is that the pdf turns out fine while I still get the Error in the log.

Also this is the first time I'm using this forum so please bear with me.

Code:

\documentclass{beamer}
\usetheme{CambridgeUS}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[german]{babel}
\usepackage{pdfpages}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{dsfont}
\usepackage{bm}

\definecolor{UBCblue}{rgb}{0.04706, 0.13725, 0.26667}
\definecolor{UBCgrey}{rgb}{0.3686, 0.5255, 0.6235}

\setbeamercolor{palette primary}{bg=UBCblue,fg=white}
\setbeamercolor{palette secondary}{bg=UBCblue,fg=white}
\setbeamercolor{palette tertiary}{bg=UBCblue,fg=white}
\setbeamercolor{palette quaternary}{bg=UBCblue,fg=white}
\setbeamercolor{title}{parent=palette secondary}
\setbeamercolor{frametitle}{fg=UCBblue}
\setbeamercolor{structure}{fg=UBCblue}
\setbeamercolor{section in toc}{fg=UBCblue}
\setbeamercolor{subsection in head/foot}{bg=UBCgrey,fg=white}

\title[Abbildungsfehler von Linsen und Objektiven]{Abbildungsfehler}
\subtitle{von sphärischen Linsen und Objektiven}
\author{Muller, Mittmann, Kotur, Ling}

\setbeamertemplate{section in toc}[square]
\setbeamerfont{section in toc}{series=\bfseries}
\setbeamertemplate{subsection in toc}[square]

\setbeamertemplate{blocks}[default]
\setbeamercolor{block title}{bg=black !10}
\setbeamercolor{block body}{bg=black !5}

\begin{document}

\AtBeginSubsection[] 
{
    \begin{frame}
    \frametitle{Inhalt}
    \tableofcontents[currentsection,currentsubsection]
\end{frame}
}

\begin{frame} 
    \titlepage
\end{frame}

\begin{frame}

    \frametitle{Inhalt}
    \tableofcontents[pausesections,pausesubsections]

\end{frame}

\begin{frame}
    \frametitle{Abbildungsfehler}
    \begin{block}{Monochromatische Abbildungsfehler}
        Alle Abbildungsfehler, die bei einfarbigem Licht auftreten. Monochromatisch = einfarbig, gleiche Wellenlänge
    \end{block}

    \pause

    \begin{block}{Chromatische Abbildungsfehler}
        Alle Abbildungsfehler, die bei Mischlicht auftreten. Mischlicht = mehrfarbig, unterschiedliche Wellenlänge
    \end{block}
\end{frame}

\section{Monochromatische Abbildungsfehler}

\subsection{sphärische Aberration}
\begin{frame}
    Nicht alle Lichtlinien treffen sich an einem Punkt, -> sphärische Aberration entsteht.
\end{frame}

\subsection{Koma}
\begin{frame}
    Inhalt...
\end{frame}

\subsection{Astigmatismus}
\begin{frame}
    Inhalt...
\end{frame}

\subsection{Bildfeldwölbung}
\begin{frame}
    Inhalt...
\end{frame}

\subsection{Verzeichnung}
\begin{frame}
    Inhalt...
\end{frame}


\section{Chromatische Aberrationen}

\subsection{Farblängsfehler}
\begin{frame}
    Inhalt...
\end{frame}

\subsection{Farbquerfehler}
\begin{frame}
    Inhalt...
\end{frame}

\end{document}
1
  • Welcome to TeX.SX! No need to load the packages graphicx and xcolor they are loaded by beamer. A minimal document doesn't produce this error: \documentclass[]{beamer} \begin{document} \color{black}foo \end{document}
    – Skillmon
    Nov 12 '17 at 12:49
6

First color error

The first error message is:

! Package xcolor Error: Undefined color `UCBblue'.

It is caused by a misspelling:

\setbeamercolor{frametitle}{fg=UCBblue}

because the color is defined

\definecolor{UBCblue}{rgb}{0.04706, 0.13725, 0.26667}

with the name UBCblue instead of UCBblue.

Second color error

! Package xcolor Error: Undefined color `black '.

Notice the space at the end of the color name. It is caused by:

\setbeamercolor{block title}{bg=black !10}
\setbeamercolor{block body}{bg=black !5}

The color black␣ with the space at the end is not a standard color or defined in the document. Removing the space fixes the issue:

\setbeamercolor{block title}{bg=black!10}
\setbeamercolor{block body}{bg=black!5}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.