1

My question: Is it possible for the TOC to produce output using the Mathilde font?

At present the TOC produces output as:

          Contents

Falling.....................1
Rising......................5 

The Chapter Subheadings are produced from the following code:

\RedeclareSectionCommand[
font=\fontsize{45}{40}\selectfont\mdseries\mathilde
font=\fontsize{20}{15}
]{section}

\setkomafont{section}{\fontsize{35}{30}\selectfont\fontspec{mathilde}}

This is an MWE of the problem:

\documentclass[12pt,english,british,twoside,openany,headings=small]{scrbook}

\usepackage{ms_mystyles}
\usepackage{fontspec}
\setmainfont{Palatino}

\RedeclareSectionCommand[tocindent=0pt]{section}
\RedeclareSectionCommand[tocstyle=gobble]{chapter}

\renewcommand{\sectionmark}[1]{ \markright{#1}{} }

\RedeclareSectionCommand[ font=\fontsize{45} {40}\selectfont\mdseries\mathilde font=\fontsize{20}{15} ]{section}

   \setkomafont{section}{\fontsize{35}{30}\selectfont\fontspec{mathilde}}
 \begin{document}

        \tableofcontents

        \addchap{Tryout}
        \addsec{Simple Heading}
    \mainmatter
    \addchap{ONE}
    \addsec{Falling}
    \input{Some text}
        \end{document}
1
  • Why you try to change the fontsize of your "Chapter Subheadings" first to 45pt, then to 20pt (there is also a comma missing before the second font option) and then to 35pt? – esdd Sep 4 '16 at 6:46
3

If the section entries in TOC should use Mathilde font:

\newfontfamily\mathilde{Mathilde}

\RedeclareSectionCommand
  [
    font=\fontsize{35}{30}\selectfont\mdseries\mathilde,
    tocindent=0pt,
    tocentryformat=\mathildeintoc,
    %tocpagenumberformat=\mathildeintoc% if pagenumbers should also use mathilde
  ]{section}
\newcommand\mathildeintoc[1]{{\mathilde#1}}

enter image description here

Note that this needs KOMA-Script version 3.20 or newer.

Code:

\documentclass
  [12pt,open=any,headings=small]
  {scrbook}[2016/05/10]% needs version 3.20 or newer

\usepackage{lipsum} % to show dummy text 

\usepackage{fontspec}
\setmainfont{Palatino Linotype}
\newfontfamily\mathilde{Mathilde}

\RedeclareSectionCommand[tocstyle=gobble]{chapter}
\RedeclareSectionCommand
  [
    font=\fontsize{35}{30}\selectfont\mdseries\mathilde,
    tocindent=0pt,
    tocentryformat=\mathildeintoc,
    %tocpagenumberformat=\mathildeintoc% if pagenumbers should also use mathilde
  ]{section}
\newcommand\mathildeintoc[1]{{\mathilde#1}}

\begin{document}
\frontmatter
\tableofcontents
\addchap{Tryout}
\addsec{Simple Heading}
\mainmatter
\addchap{ONE}
\addsec{Falling}
\lipsum[1-50]
\end{document}

If all section, subsection, subsubsection etc. entries in TOC should use Mathilde Font

\AfterTOCHead[toc]{\mathilde}

Note that this does not change the font of chapter entries and the font of the pagenumbers for all entry levels.

\documentclass
  [12pt,open=any,headings=small]
  {scrbook}[2016/05/10]% needs version 3.20 or newer

\usepackage{lipsum} % to show dummy text 

\usepackage{fontspec}
\setmainfont{Palatino Linotype}
\newfontfamily\mathilde{Mathilde}

\RedeclareSectionCommand[tocstyle=gobble]{chapter}% needs version 3.20 or newer
\RedeclareSectionCommand
  [
    font=\fontsize{35}{30}\selectfont\mdseries\mathilde,
    tocindent=0pt
]{section}

\AfterTOCHead[toc]{\mathilde}
\begin{document}
\frontmatter
\tableofcontents
\addchap{Tryout}
\addsec{Simple Heading}
\mainmatter
\addchap{ONE}
\addsec{Falling}
\lipsum[1-50]
\end{document}

The result is the same as above.

1
  • esdd - Thank you very much indeed for your very informative and useful answer. Mike – Mike Sep 4 '16 at 17:47

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.