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 came across this chapter style and borrowed the code (see MWE below).

The original code was using the font pbk; I want to use the libertine instead, since it is the font used throughout the thesis.

When I use the libertine the title font becomes thin, I want it to be thicker like the one by pbk or similar or:

How to make chapter title and number look nicer using libertine?

MWE Code

\documentclass{scrreprt}
\usepackage{lipsum}
%\usepackage{libertine}
\usepackage{tabularx}
\usepackage{xcolor,fix-cm}
\definecolor{numbercolor}{RGB}{150,20,0}

\makeatletter
\renewcommand\chapterheadstartvskip{\vskip50pt}

\newcommand\chaptitlefont{%
  \fontfamily{pbk}\fontseries{b}%
  \fontshape{n}\fontsize{25}{35}\selectfont\raggedright}

\newcommand\chapnumfont{%
  \fontfamily{pbk}\fontseries{bd}\fontshape{n}%
  \fontsize{1in}{0in}\selectfont\color{numbercolor}}

\renewcommand\chapterheadendvskip{\par\vskip2mm\hrule\vskip40pt}

\renewcommand*{\@@makechapterhead}[1]{\chapterheadstartvskip
  {%
    \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
    \normalfont\sectfont\nobreak\size@chapter{}%
    \if@chapterprefix
      \let\@tempa\raggedsection
    \else
      \let\@tempa\@hangfrom
    \fi
    \@tempa{\ifnum \c@secnumdepth >\m@ne%
          \if@chapterprefix
            \expandafter\size@chapterprefix
          \else
            \expandafter\size@chapter
          \fi
          \if@chapterprefix
            \size@chapterprefix{}\endgraf\nobreak\vskip.5\baselineskip
          \fi
      \fi
    }%
\begin{tabularx}{\textwidth}{Xl}
{\parbox[b]{\linewidth}{\chaptitlefont #1}}
& \raisebox{-15pt}{\chapnumfont\thechapter}%
\end{tabularx}%
 \nobreak\chapterheadendvskip
}%
}
\renewcommand*{\@@makeschapterhead}[1]{%
  \chapterheadstartvskip%
  {\normalfont\sectfont\nobreak\size@chapter{}%
    \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
    \raggedsection \interlinepenalty \@M 
\begin{tabularx}{\textwidth}{X}%
{\parbox[b]{\linewidth}{\chaptitlefont #1}%
\vphantom{\raisebox{-15pt}{\chapnumfont 1}}}
\end{tabularx}%
\par}%
  \nobreak\chapterheadendvskip%
}
\makeatother

\begin{document}
\tableofcontents
\chapter{Introduction}
\lipsum[1]
\chapter{Materials \& Methods}
\lipsum[2]
\chapter*{Curriculum Vitae}
\end{document}

Output: PBK
enter image description here

Output: Libertine
enter image description here

share|improve this question
    
It is hidden in the libertine documentation, that there is a \libertineSB command, for semibold usage of the font, so insert in your \chaptitlefont command. See page 4 of documentation, to be found here mirrors.ctan.org/fonts/libertine/doc/libertine.pdf –  Christian Hupfer Jun 11 at 10:18
    
I get no difference in the chapter title with or without libertine –  egreg Jun 11 at 10:40
    
@egreg I updated the code and output, can you try now pls? –  doctorate Jun 11 at 10:47
    
No change. What TeX distribution are you running? –  egreg Jun 11 at 10:49
    
@ChristianHupfer, but it is not clear for me in the manual how to apply \libertineSB in the MWE, any help? –  doctorate Jun 11 at 10:50

2 Answers 2

up vote 7 down vote accepted

The family name you should use is not libertine. Just change \fontfamily{pbk} into \rmfamily (this is because, by default, scrbook applies \sffamily to chapter titles).

\documentclass{scrreprt}
\usepackage{lipsum}
\usepackage{libertine}
\usepackage{tabularx}
\usepackage{xcolor,fix-cm}
\definecolor{numbercolor}{RGB}{150,20,0}

\makeatletter
\renewcommand\chapterheadstartvskip{\vskip50pt}

\newcommand\chaptitlefont{%
  \rmfamily\fontseries{b}%
  \fontshape{n}\fontsize{25}{35}\selectfont\raggedright}

\newcommand\chapnumfont{%
  \rmfamily\fontseries{b}\fontshape{n}%
  \fontsize{1in}{0in}\selectfont\color{numbercolor}}

\renewcommand\chapterheadendvskip{\par\vskip2mm\hrule\vskip40pt}

\renewcommand*{\@@makechapterhead}[1]{\chapterheadstartvskip
  {%
    \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
    \normalfont\sectfont\nobreak\size@chapter{}%
    \if@chapterprefix
      \let\@tempa\raggedsection
    \else
      \let\@tempa\@hangfrom
    \fi
    \@tempa{\ifnum \c@secnumdepth >\m@ne%
          \if@chapterprefix
            \expandafter\size@chapterprefix
          \else
            \expandafter\size@chapter
          \fi
          \if@chapterprefix
            \size@chapterprefix{}\endgraf\nobreak\vskip.5\baselineskip
          \fi
      \fi
    }%
\begin{tabularx}{\textwidth}{Xl}
{\parbox[b]{\linewidth}{\chaptitlefont #1}}
& \raisebox{-15pt}{\chapnumfont\thechapter}%
\end{tabularx}%
 \nobreak\chapterheadendvskip
}%
}
\renewcommand*{\@@makeschapterhead}[1]{%
  \chapterheadstartvskip%
  {\normalfont\sectfont\nobreak\size@chapter{}%
    \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
    \raggedsection \interlinepenalty \@M 
\begin{tabularx}{\textwidth}{X}%
{\parbox[b]{\linewidth}{\chaptitlefont #1}%
\vphantom{\raisebox{-15pt}{\chapnumfont 1}}}
\end{tabularx}%
\par}%
  \nobreak\chapterheadendvskip%
}
\makeatother

\begin{document}
\tableofcontents
\chapter{Introduction}
\lipsum[1]
\chapter{Materials \& Methods}
\lipsum[2]
\chapter*{Curriculum Vitae}
\end{document}

enter image description here

share|improve this answer
    
@doctorate,@egreg: I can confirm egreg's solution, the bold effect is definitely better than on my solution. –  Christian Hupfer Jun 11 at 12:02

I inserted \libertineSB after in the \chaptitlefont before \fontshape, but after it is the same.

However, I use pdflatex

\documentclass{scrreprt}
\usepackage{lipsum}
% For XeLaTeX use 
%\usepackage[type1]{libertine} instead
\usepackage{libertine}
\usepackage{tabularx}
\usepackage{xcolor,fix-cm}
\definecolor{numbercolor}{RGB}{150,20,0}

\makeatletter
\renewcommand\chapterheadstartvskip{\vskip50pt}

\newcommand\chaptitlefont{%
  \fontfamily{libertine}\fontseries{b}%
  \libertineSB% for example in here%%%%
  \fontshape{sc}\fontsize{25}{35}\selectfont\raggedright}

\newcommand\chapnumfont{%
  \fontfamily{libertine}\fontseries{b}\fontshape{sc}%
  \fontsize{1.0in}{0in}\selectfont\color{numbercolor}}

\renewcommand\chapterheadendvskip{\par\vskip2mm\hrule\vskip40pt}

\renewcommand*{\@@makechapterhead}[1]{\chapterheadstartvskip
  {%
    \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
    \normalfont\sectfont\nobreak\size@chapter{}%
    \if@chapterprefix
      \let\@tempa\raggedsection
    \else
      \let\@tempa\@hangfrom
    \fi
    \@tempa{\ifnum \c@secnumdepth >\m@ne%
          \if@chapterprefix
            \expandafter\size@chapterprefix
          \else
            \expandafter\size@chapter
          \fi
          \if@chapterprefix
            \size@chapterprefix{}\endgraf\nobreak\vskip.5\baselineskip
          \fi
      \fi
    }%
\begin{tabularx}{\textwidth}{Xl}
{\parbox[b]{\linewidth}{\chaptitlefont #1}}
& \raisebox{-15pt}{\chapnumfont\thechapter}%
\end{tabularx}%
 \nobreak\chapterheadendvskip
}%
}
\renewcommand*{\@@makeschapterhead}[1]{%
  \chapterheadstartvskip%
  {\normalfont\sectfont\nobreak\size@chapter{}%
    \setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
    \raggedsection \interlinepenalty \@M 
\begin{tabularx}{\textwidth}{X}%
{\parbox[b]{\linewidth}{\chaptitlefont #1}%
\vphantom{\raisebox{-15pt}{\chapnumfont 1}}}
\end{tabularx}%
\par}%
  \nobreak\chapterheadendvskip%
}
\makeatother

\begin{document}
\tableofcontents
\chapter{Introduction}
\lipsum[1]
\chapter{Materials \& Methods}
\lipsum[2]
\chapter*{Curriculum Vitae}
\end{document}

enter image description here

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.