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 used fontspec to style all of my headers with a new font with:

% Specify different font for section headings
\newfontfamily\headingfont[]{Gill Sans}
\titleformat*{\section}{\LARGE\headingfont}
\titleformat*{\subsection}{\Large\headingfont}
\titleformat*{\subsubsection}{\large\headingfont}

Now I want to style my document title to use Gill Sans as well since it would match the style of the rest of the document. How do I do this?

share|improve this question
2  
It depends on the class used: KoMa classes probably have their method for managing the font for the title, the standard classes don't. The solution depends also on what you want precisely: only the title or the whole title block? –  egreg May 18 '11 at 7:50

1 Answer 1

up vote 10 down vote accepted

For the standard document classes you can use the titling package to do this:

\documentclass{article}
\usepackage{titlesec}
\usepackage{titling}
\usepackage{fontspec}
% Specify different font for section headings
\newfontfamily\headingfont[]{Gill Sans}
\titleformat*{\section}{\LARGE\headingfont}
\titleformat*{\subsection}{\Large\headingfont}
\titleformat*{\subsubsection}{\large\headingfont}
\renewcommand{\maketitlehooka}{\headingfont}
\author{An author}
\title{The title of the article}
\date{\today}
\begin{document}
\maketitle
\section{A section}
\subsection{A subsection}
\subsubsection{A subsubsection}
\end{document}

output of code

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.