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}
2
  • You should put zebratitle into the \extratitle as it changes the font sizes.
    – TeXnician
    Commented Mar 18, 2017 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
    Commented Mar 18, 2017 at 12:28

1 Answer 1

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}
2
  • @Schweinebacke I've updated the most points, but I do not think the \par is actually necessary.
    – TeXnician
    Commented Mar 21, 2017 at 8:14
  • Yes, after the changes it is indeed not necessary. Commented Mar 21, 2017 at 8:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .