Text FormattingChange font in TOC

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
schwarz
Posts: 4
Joined: Mon Oct 24, 2016 3:49 pm

Change font in TOC

Post by schwarz »

Hallo,

my scrbook is divided in two parts with same content. The first part is written in Sütterlin, the second one in latin font. Is there the possibility to change the font in the TOC? I know this is not a normal case and would only be a nice-to-have.

Another question: What parameter do I have to change for bigger characters in Sütterlin (see line 5)? Are there also bold letters?

Thanks for your help

Regards,
schwarz

Code: Select all

\documentclass[12pt,% Schriftgröße
pdftex,	% benutze PDFLaTeX
]{scrbook}

\usepackage{suetterl}
\DeclareFontShape{T1}{suetterl}{m}{n}{<->s*[0.8]suet14}{\fontdimen5\font=0.5\fontdimen6\font}
% see http://www.mrunix.de/forums/showthread.php?73448-Schriftart-f%FCr-das-ganze-Dokument
\usepackage[T1]{fontenc}% europäischer Zeichensatz
\usepackage[latin1]{inputenc}% Zeichenkodierung
\usepackage[german,ngerman]{babel}% neue deutsche Rechtschreibung, wichtig für Umlaute und Trennungsregeln

\newcommand{\inhalt}{%
Das ist mein Text, einmal in Sütterlin und einmal in lateinischer Schrift.
}

\begin{document}

\tableofcontents

{\selectlanguage{german}	% alte deutsche Rechtschreibung für Sütterlin
\setkomafont{disposition}{\suetterlin}
\suetterlin
\addpart{Die Abschrift in Sütterlin}
\inhalt
}
\addpart{Die Abschrift in lateinischer Schrift}
\inhalt

\end{document}

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Change font in TOC

Post by Johannes_B »

To be honest, i would ask this questin on a german forum like goLaTeX or a Q&A site like TeXwelt.

The KOMA-script experts are there, and more people than on an english speaking site that actually knw Sütterlin.
You can (should) crosslink the posts, so that somebody here can find a solution on a german site.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Change font in TOC

Post by Stefan Kottwitz »

You insert add a font command to the table of contents by using \addtocontents at that place in the document.

Take a look at this example, compile two times:

Code: Select all

\documentclass{article}
\begin{document}
\tableofcontents
\section{One}
\addtocontents{toc}{\itshape}
\section{Two}
\end{document}
Stefan
LaTeX.org admin
schwarz
Posts: 4
Joined: Mon Oct 24, 2016 3:49 pm

Change font in TOC

Post by schwarz »

Thanks,

now I got it. I had to use the alpha-packet tocstyle, here is my solution. The only problem is that the spaces between the dots are smaller, so they end earlier than the dots of the normal font. Like this:

Code: Select all

Content1 (in suetterlin).....         3
Content2 (in normal font). . . . . .  7
I think it occurs because there is no \bfseries in suetterlin. If anybody has a solution it would be great, but I could also live with it.

Code: Select all

\documentclass[12pt,% Schriftgröße
pdftex,	% benutze PDFLaTeX
]{scrbook}
\usepackage{suetterl}
\DeclareFontShape{T1}{suetterl}{m}{n}{<->s*[1.0]suet14}{\fontdimen5\font=0.5\fontdimen6\font}
% see http://www.mrunix.de/forums/showthread.php?73448-Schriftart-f%FCr-das-ganze-Dokument
\usepackage[T1]{fontenc}% europäischer Zeichensatz
\usepackage[latin1]{inputenc}% Zeichenkodierung
\usepackage[german,ngerman]{babel}% neue deutsche Rechtschreibung, wichtig für Umlaute und Trennungsregeln

\usepackage{tocstyle}

\newcommand{\inhalt}{%
Das ist mein Text, einmal in Sütterlin und einmal in lateinischer Schrift.
}

\begin{document}

\tableofcontents

{\selectlanguage{german}	% alte deutsche Rechtschreibung für Sütterlin
\setkomafont{disposition}{\suetterlin}
\addtocontents{toc}{\suetterlin}
\suetterlin
\addpart{Die Abschrift in Sütterlin}
\inhalt
}
\addtocontents{toc}{\usekomafont{disposition}}
\addpart{Die Abschrift in lateinischer Schrift}
\inhalt

\end{document}
In my original document I had to replace the line where I set back the original style because of an error with \let in *.toc:

Code: Select all

%\addtocontents{toc}{\usekomafont{disposition}}
\addtocontents{toc}{\sffamily \bfseries}
Post Reply