格式化目录

格式化目录

是否可以格式化目录中的章节和页码列表?我想删除粗体字体并将目录中的字体大小减小到 10pt。

我的 MWE 是:

\documentclass[12pt,english,british,twoside,openany]{scrbook}
\usepackage{fontspec}
\setmainfont{Gill Sans}
\usepackage{lettrine}
\usepackage[automark,headsepline=.25pt]{scrlayer-scrpage}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{graphicx}
\graphicspath{ {../img/} }
\usepackage{wrapfig}
\usepackage[british]{babel}
\pagestyle{scrheadings}
\addtokomafont{pageheadfoot}{\scshape}%changed to small caps in headers
%\addtokomafont{pagehead}{\normalsize}
\addtokomafont{pagehead}{\small}
%\addtokomafont{pagefoot}{\normalsize}
\addtokomafont{pagefoot}{\small}
  \addtokomafont{disposition}{\rmfamily} %for headings
 %\addtokomafont{disposition}
  \chead{Ben Francis}
  \ofoot{} %Author Name
  \ifoot{} % Chapter Number
\lehead{\pagemark}
\rohead{\pagemark}
\cohead{\mytitle}
\renewcommand\thepart{\Alph{part}}
\linespread{1.05}
\usepackage{hyphenat}
\tolerance=1000
\hyphenpenalty=1000
\renewcommand*{\partpagestyle}{empty}
\usepackage{geometry}
\geometry{paperwidth=5.06in,paperheight=7.81in,
%   verbose,
%   tmargin=0.75in,
%   bmargin=0.75in,
%   inner=0.75in,
%   outer=0.5in,
%   headheight=0.1in,
%   headsep=0.15in,
%   footskip=0.45in,
  twoside}
\newcommand{\mytitle}{Tears in the Rain} 
\newcommand{\emptx}[1]{\textit{#1}}

%\RedeclareSectionCommand[
%indent=.25in,
%font=\fontsize{45}{40}\selectfont\mdseries\mathilde
%font=\fontsize{15}{10}
%]{section}

%\setkomafont{section}{\fontsize{15}{20}\selectfont\fontspec{Gill Sans}}
%\setkomafont{subsection}{\small}
%\setkomafont{subsubsection}{\small}
%\setkomafont{paragraph}{\normalsize}
%\setkomafont{subparagraph}{\normalsize}

\widowpenalty=300
\clubpenalty=300

\setlength\parindent{8pt}

  \begin{document}
    \title{\mytitle}
    \author{}
    \date{}
  \frontmatter
\maketitle
\begin{titlepage}
  \begin{flushright}
      {\huge \mytitle}
      \par\end{flushright}{\huge \par}
\end{titlepage}

  \begin{titlepage}
  \noindent\includegraphics[width=4in,height=1.5in]{./titrbensig}
  \vspace*{0.5in}
  \begin{flushright}
      \Huge{Tears in the Rain}
    \par\end{flushright}{\Huge \par}

\clearpage
\thispagestyle{empty}

\begin{center}
    \emph{Copyright}
\end{center}
\begin{center}
    \textcopyright{ 2014 Ben Francis All rights reserved.}
\end{center}
\vspace*{0.5in}
\begin{center}
    \begin{minipage}[t]{0.5\paperwidth}
        No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form, or by any means;
        mechanical, electrical, photocopying, scanning, recording or
        otherwise, without prior written consent from the publishers. Every
        effort has been made to contact all copyright holders. The author and
        publisher will gladly rectify any omissions.
    \end{minipage}
\end{center}
\vspace*{0.5in}
\begin{center}
    ISBN:
\end{center}
\vspace*{0.2in}
\begin{center}
    A CIP Record for this book is available from the British
    Library.
\end{center}
\vspace*{0.1in}
\begin{center}
    Typeset in \LaTeXe
\end{center}
\end{titlepage}

\pagenumbering{gobble}% Remove page numbers (and reset to 1)
\tableofcontents

\addchap{PREFACE}
\input{./titr_pref.tex}     
\mainmatter
\addchap{ONE}
\input{./titr01.tex}
\end document

答案1

要将目录中章节条目的字体更改为\mdseries使用

\addtokomafont{chapterentry}{\mdseries}

要更改目录中所有条目的字体大小,您可以使用

\AfterTOCHead[toc]{\KOMAoptions{fontsize=10pt}}

如果在 LOF 或 LOT 等列表中也需要更改字体大小,请删除可选参数。如果 TOC 标题的大小也需要更改,请\BeforeTOCHead改用\AfterTOCHead

在此处输入图片描述

代码:

\documentclass[12pt,openany]{scrbook}
\usepackage{blindtext}% dummy text

\addtokomafont{disposition}{\rmfamily}
\addtokomafont{chapterentry}{\mdseries}

\AfterTOCHead[toc]{\KOMAoptions{fontsize=10pt}}

\begin{document}
\tableofcontents
\blinddocument
\blinddocument
\end{document}

答案2

由于我无法实际看到您的 MWE 的实际运行(您是在 XeTex 还是 LuaTeX 中编写的?)并且我也无法对您的问题发表评论,所以我将在这里回答。我建议您使用tocloftPeter Wilson 的软件包。

%% Control the fonts and formatting used in the table of contents.

\usepackage[titles]{tocloft}

%% Use Helvetica-Narrow Bold (size 10) for Chapter entries

\renewcommand{\cftchapfont}{%
  \fontsize{10}{13}\usefont{OT1}{phv}{bc}{n}\selectfont
}

相关内容