3

I'd like to use the scrbook class and included the Gyre Heros font but for some reason does it not lead to the desired output (i.e. it quite different from the output that created by the book class) instead it seams to create an ugly bitmap font, why?

\documentclass[fontsize=12pt,                   
                         open=right,                
                         twoside = true,
                         a4paper,               
                         parskip=half,      
                         listof=totoc,      
                         fleqn,                 
                         ngerman,
                         headinclude=true,
                         footinclude=false,
                         captions=tableheading,
                         numbers=noenddot,
                         headings=big,
                         chapterprefix=false]   % 
                        {scrbook}  %vs book

 \usepackage[T1]{fontenc}           % Wahl des Fonts, bzw.
 \usepackage[utf8]{inputenc}    % Zeichkodierung , Umlaute \usepackage{}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{setspace}

\usepackage[bitstream-charter]{mathdesign}

%headings
\usepackage{titlesec} 
\titleformat{\section}[hang]{
    \usefont{T1}{qhv}{b}{n}\selectfont} % "qhv" - TeX Gyre Heros, "b" - bold
    {} 
    {0em}
    {\hspace{-0.4pt}\Large \thesection\hspace{0.6em}}

\usepackage{sectsty}
\chapterfont{\usefont{T1}{qhv}{b}{n}\selectfont\huge}
% % % % % % % % % % %


 \begin{document}
\onehalfspacing 
\chapter{Neues Kapitel}
\blindtext[1]
\section{Neue Section}
\blindtext[1]
\subsection{Neue Section}
\blindtext[1]

\chapter{Neues Kapitel}
\blindtext[1]
\section{Neue Section}
\blindtext[1]
\subsection{Neue Section}
\blindtext[1]

\end{document}

enter image description here

enter image description here

enter image description here

  • 1
    \usepackage{lmodern} before mathdesign fixes it (altough the font is sightly different). – Manuel Sep 16 '14 at 21:15
  • Probably because you do not have the bitstream-charter font correctly installed. – Sveinung Sep 16 '14 at 21:32
  • Also, opposite to the standard class, KOMA-script use sans-serif font in the headings. If the body text looks OK, you can try \renewcommand{\familydefault}{\sfdefault}. If charter is installed, you will have that font in the headings too. – Sveinung Sep 16 '14 at 21:42
  • 1
    @Sveinung From the image, the bitmap fonts are the sans serif family. – Manuel Sep 16 '14 at 21:48
  • If I compile that code, I get all type1 fonts. The headings are quite different from both of the examples posted. If you look in the output from LaTeX, you should see messages telling you if any fonts were not found and, at the end, a full list of the fonts which were used in the document. – cfr Sep 16 '14 at 22:12
4

You're doing things more complicated than they should be. The package titlesec shouldn't be used with KOMA-Script classes and sectsty is not to be used along with titlesec (nor with KOMA-Script classes).

If you want to change the appearance of the chapter header font, just do

\setkomafont{chapter}{<font specifications>}

In order that TeX Gyre Heros is used as the sans serif font, just do

\usepackage[scale]{tgheros}

In the example I omitted the irrelevant document class options.

\documentclass[
  fontsize=12pt,
]{scrbook}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage[bitstream-charter]{mathdesign}
\usepackage[scale]{tgheros}    

\begin{document}

\chapter{Neues Kapitel}
\section{Neue Section}
\subsection{Neue Section}

\blindtext[1]

\end{document}

enter image description here

Whether Helvetica matches Charter is a matter of opinion. I don't think they match.

Why did you get bitmapped fonts? Because you didn't set correctly the sans serif family document wide, but only locally in a couple of places. Moreover you're missing the CM-Super font package, so the default T1-encoded sans serif font is only available as bitmap.

  • Well, what font would you recommend for the headlines instead of Tex Gyre Heros ? Thanks for the tipp with cm-super. – jlk Sep 16 '14 at 23:03
  • @harryhaller Use charterin the headlines too. – Sveinung Sep 17 '14 at 6:14

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.