1

i am trying to create my first custom latex class based on KOMA and i can't figure out how to define/use custom colors in that context.

My goal is to have a colorized title. The problem is that when i use a custom defined color, the title (or any other text for that matter) becomes invisible (but it is there!).

I have been searching for the solution to this problem for hours without success and i have no idea of what might be wrong here.

Here is a minimum working example:

% File: 'myclass.cls'    
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myclass}        
\RequirePackage{xcolor}
\definecolor{mycolor}{rgb}{40,40,40}
\LoadClass{scrartcl}
\renewcommand*{\maketitle}{
    \begin{center}
        \Large
        \color{mycolor}
        \@title   % <-- invisible
    \end{center}
    \pagebreak
}
\endinput

% File: textfile.tex
\documentclass{myclass}    
\usepackage{lipsum}
\title{mytitle}
\begin{document}
    \maketitle
    \lipsum[1]
\end{document}

Thanks.

0
3

Use RGB (which accepts parameters between 0 and 255) instead of rgb (which requires parameters between 0 and 1). See p.10, xcolor manual, v2.11.

0

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.