4

In pdf export the AvantGarde font is used a lot for heads and subheads. I would like to use a modern font like Helvetica. Is it possible to just exchange AvantGarde with Helvetica.

If possible I would like to just change the conf.py file (latex preamble).

  • Does this question work for you? The default set-up of sphinx uses the standard latex classes, and the titlesec package works for those. – Andrew Swann Jan 02 '13 at 11:30
  • I found out that Sphinx uses fancychap, Bjarne style by default. Once I use /titleformat as suggested I use all the formating. – tired_of_nitpickers Jan 02 '13 at 19:48
  • Better late than never. Welcome to TeX.sx! More information on this site can be seen in the faq and the Unofficial TeX-SX FAQ http://meta.tex.stackexchange.com/q/1144/19384 as well as the markdown help http://tex.stackexchange.com/editing-help. Welcome to the community! – Peter Jansson Jan 02 '13 at 21:46
  • \usepackage{sectsty} \allsectionsfont{\fontfamily{BebasNeue}\selectfont} ...this does almost what I want. But it does not change the chapter heading. I suspect this has something to do with \pagestyle{fancy}. Any suggestions on how to approach this situation? – tired_of_nitpickers Jan 02 '13 at 23:43
  • Have a look at the documentation for fncychap. There you will see the formatting is controlled by \ChNameVar etc. The first example "Sonny" shows how to switch various parts to sansserif; the other examples should also be useful. – Andrew Swann Jan 03 '13 at 09:58

1 Answers1

3

The sphinx latex output uses facychap Bjarne style by default (see comments to question). I did not like the default layout, especially the fonts did not suite my book. Once I found out how to modify facychap I was able to make the layout changes to the preamble (in conf.py). Here is what I did:

% load BebasNeue font
\pdfmapfile{lcdftools.map}

% use BebasNeue font for headings
\titleformat{\section}
  {\fontfamily{BebasNeue}\selectfont\LARGE}
  {\thesection}{1em}{}
\titleformat{\subsection}
  {\fontfamily{BebasNeue}\selectfont\large}
  {\thesubsection}{1em}{}

% modifications to the the part page
\makeatletter
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
  \refstepcounter{part}%
  \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
\else
  \addcontentsline{toc}{part}{#1}%
\fi
\markboth{}{}%
{\centering
 \interlinepenalty \@M
 \normalfont
 \ifnum \c@secnumdepth >-2\relax
   \fontfamily{BebasNeue}\selectfont\huge \partname\nobreakspace\thepart
   \par
   \vskip 20\p@
 \fi
 \fontfamily{BebasNeue}\selectfont\Huge \bfseries #2\par}%
\@endpart}
\makeatother

% modifications to fncychap style Bjarne
\ChNameVar{\raggedleft\normalsize\fontfamily{BebasNeue}\selectfont}
\ChNumVar{\raggedleft\normalsize\fontfamily{BebasNeue}\selectfont}
\ChTitleVar{\raggedleft\huge\fontfamily{BebasNeue}\selectfont}
\makeatletter
\renewcommand\DOCH{%
  \mghrulefill{\RW}\par\nobreak
  \CNV\FmN{\@chapapp}\space \CNoV\thechapter\par\nobreak 
  \vskip -1\baselineskip\vskip 5pt
  \mghrulefill{\RW}\par\nobreak
  \vskip 20\p@
  }
\makeatother