Text FormattingDifferent Font for Headings to Body Font

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
eNino
Posts: 1
Joined: Tue Dec 27, 2011 11:47 pm

Different Font for Headings to Body Font

Post by eNino »

Hi,

I'm using XeTeX and want to have Arial font for my titles (chapter, section, subsection) to the body text of Georgia. I can do this in plain LaTeX by using sectsty. But how do I get it to work in XeTeX, please?

Thanks,
eNino

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Different Font for Headings to Body Font

Post by localghost »

In each case I would prefer titlesec to sectsty because it is much more capable. It manages not only the formatting of headings. The below code works fine for me.

Code: Select all

\documentclass[11pt]{report}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{geometry}
\usepackage[raggedright,bf,sf]{titlesec}
\usepackage{lipsum}

\setmainfont[Ligatures=TeX]{Georgia}
\setsansfont[Ligatures=TeX]{Arial}
\setmainlanguage{english}

\begin{document}
  \chapter{Foo}
    \lipsum[1]

    \section{Bar}
      \lipsum[2]
\end{document}

Thorsten
Post Reply