Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following code:

\documentclass[a4paper,landscape,12pt,oneside]{scrbook}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{xcolor}
\usepackage[pdfborder={0 0 0}, breaklinks=true, pdftex=true, raiselinks=true]{hyperref}

\begin{document}
\color{red}
\title{MainTitle}
\author{"author"}
\subject{Subject} \publishers{Publisher}
\titlehead{Publisher\\City}
\maketitle
\end{document}

I can set colors of everything except the subject and the title to red. Can somebody give me a tip on how to set the size of the text and the font color of the title and subject too, please?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Use \addtokomafont for title and subject.

\documentclass[a4paper,landscape,12pt,oneside]{scrbook}

\usepackage{xcolor}
\addtokomafont{subject}{\color{red}}
\addtokomafont{title}{\color{red}}

\begin{document}
\color{red}
\title{MainTitle}
\author{"author"}
\subject{Subject} \publishers{Publisher}
\titlehead{Publisher\\City}
\maketitle
\end{document}
share|improve this answer

The KOMA-Script package provides the commands \setkomafont and \addtokomafont to modify the font of certain elements.

I expanded your example with two \addtokomafont directives which make the title and subject go red:

\documentclass[a4paper,landscape,12pt,oneside]{scrbook}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{xcolor}
\usepackage[pdfborder={0 0 0}, breaklinks=true, pdftex=true, raiselinks=true]{hyperref}

\addtokomafont{title}{\color{red}}
\addtokomafont{subject}{\color{red}}

\begin{document}
\color{red}
\title{MainTitle}
\author{"author"}
\subject{Subject} \publishers{Publisher}
\titlehead{Publisher\\City}
\maketitle
\end{document}

The syntax and working principle of the commands as well as what styles are influenced by them is explained in the KOMA-Script manual, just search for "addtokomafont" or "setkomafont".

By the way: you could also use this mechanism to set your other titlepage information to red instead of doing it by the \color{red} command in the text.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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