1

Related question: Change Font in KOMA \extratitle Command

KOMA scrbook class. I'd like to change the size of the font on the half-title page, which is created by the \extratitle command.

I only want the font size change to apply to the half-title page and not in the rest of the document. I thought I could do this by creating a new environment but this does not seem to work.

Here is a MWE:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode


\documentclass{scrbook}


\usepackage{xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Hoefler Text}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
\setmonofont[Scale=MatchLowercase]{Andale Mono}

%\usepackage{moresize}  Can't get anything larger than HUGE
%\usepackage{relsize} scaling at 5x had no effect


 \begin{document}

 \newenvironment{zebratitle}{\changefontsizes{36pt}{\Huge}}

 \newfontfamily\myfunt[Ligatures=TeX]{Papyrus}

  \begin{zebratitle}
  \extratitle{\vspace*{5\baselineskip}

  \begin{center}\textbf{\Huge \myfunt Great Title}\end{center}} 

  \end{zebratitle}

  \title{Great Title}
  \author{The Author}
  \date{}
  \maketitle
   \end{document}
  • You should put zebratitle into the \extratitle as it changes the font sizes. – TeXnician Mar 18 '17 at 7:32
  • You could define a new font element extratitle in the preamble: \newkomafont{extratitle}{<font settings >}. Then this can be used in \extratitle{\usekomafont{extratitle} <your extratitle>}. – esdd Mar 18 '17 at 12:28
2

Your code has two problems:

  • The \changefontsizes command takes only one argument. Your group with only \Huge does nothing at all.
  • The \extratitle command is not affected by a group around it and prints only what is inside its argument. So you have to put zebratitle into \extratitle.

Update: Thanks to Schweinebacke I reworked the code and corrected the following:

  • Your environment definition of zebratitle misses the ending part.
  • This definition as well as the \newfontfamily should be moved to the preamble.
  • Your center environment is now included into zebratitle.
  • And your manual vertical skipping is replaced by automatic centering.
  • Last, but not least, there's now \bfseries instead of \textbf and I removed the group causing strange \baselineskip.

This works:

\documentclass{scrbook}

\usepackage{xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}

\newenvironment{zebratitle}{\begin{center}\changefontsizes{36pt}}{\end{center}}
\newfontfamily\myfunt[Ligatures=TeX]{Papyrus}

\begin{document}

  \extratitle{
    \begin{zebratitle}
        \vspace*{\fill}
        \Huge\bfseries\myfunt Great Title
        \vfill
    \end{zebratitle}
  } 

  \title{Great Title}
  \author{The Author}
  \date{}
  \maketitle
\end{document}
  • @Schweinebacke I've updated the most points, but I do not think the \par is actually necessary. – TeXnician Mar 21 '17 at 8:14
  • Yes, after the changes it is indeed not necessary. – Schweinebacke Mar 21 '17 at 8:15

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.