
TOCを太字にしchapter
て表示したいと思います。 -Script プロトタイプを使用しています 。目次は次のようになります。section
Table of Contents
KOMA
セクションを太字で書くように定義しましたが、目次では太字で表示されません。さらに、章は別のフォントで表示されます。なぜかご存知ですか?
目次を次のように含めます。
\begingroup
\changefont{phv}{m}{n}
\tableofcontents
\endgroup
クラス ファイルは次のようになります。
\addtokomafont{chapter}{\fontfamily{phv}\fontsize{14}{14}\bfseries}
\addtokomafont{section}{\fontfamily{phv}\normalsize\bfseries}
\addtokomafont{subsection}{\fontfamily{phv}\normalsize\mdseries}
\renewcommand{\cftchappagefont}{\fontfamily{phv}\bfseries}
\renewcommand{\cftchapfont}{\fontfamily{phv}\bfseries}
\renewcommand{\cftsecpagefont}{\fontfamily{phv}}
\renewcommand{\cftsubsecpagefont}{\fontfamily{phv}}
\renewcommand{\cftsecfont}{\fontfamily{phv}}
\renewcommand{\cftsubsecfont}{\fontfamily{phv}}
\renewcommand*{\chapterpagestyle}{empty}
\def\@dottedtocline#1#2#3#4#5{%
\ifnum #1>\c@tocdepth \else
\vskip \z@ \@plus.2\p@
{\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent #2\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima #3\relax
\advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
{#4}\nobreak
\leaders\hbox{\rmfamily\mdseries$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
mu$}\hfill
\nobreak
\hskip-.2em
\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
\par}%
\fi}
\renewcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\if@tocleft
\ifx\toc@l@number\@empty\else
\setlength\@tempdima{0\toc@l@number}%
\fi
\fi
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\vspace{-\baselineskip}
\leavevmode \sectfont
\advance\leftskip\@tempdima
\hskip -\leftskip
\@dottedtocline{0}{\z@}{1.3em}{\textbf{#1}}{{\changefont{phv}{m}{u}#2}}
\penalty\@highpenalty
\endgroup
\fi
}
答え1
これは解決策や実際の回答として意図されたものではなく、違いを示すために投稿されています(したがって、投票する必要はありません ;-))
\documentclass{scrbook}
% Other stuff
\begin{document}
\tableofcontents
\chapter{Einleitung}
% Text to come...
\chapter{Begriffe}
\section{Definitionen von Einkommen}
% Now with *bold* toc - entry!!! %
\section[\textbf{Definitionen von Einkommensrisiko}]{Definitionen von Einkommensrisiko}
\end{document}
時間がなかったため、サブセクションを省略しました。
こんな感じです
答え2
KOMA スクリプトのマニュアルでは、toc サブセクションでインターフェイス全体を説明しています。では、次のように記述するのはどうでしょうか\addtokomafont{sectionentry}{\bfseries}
。残りは忘れてください...