KOMA-Script 書中章節/參考書目/索引標題之間的差異

KOMA-Script 書中章節/參考書目/索引標題之間的差異

我正在使用 KOMA-Script Book,當涉及頁面頂部和文字底部之間的距離時,標題之間存在奇怪的差異。

我使用的是 LyX,因此索引和參考書目標題是自動產生的。章節標題是手動輸入的。

參考書目標題與章節標題的關係還不錯,但索引標題卻相差甚遠:

章節標題和索引標題之間的差異

筆記:添加紅線以幫助說明差異。

有沒有什麼方法可以專門移動索引標題,以便它與其他標題保持一致?

我檢查了我的序言,其中沒有任何內容會導致此問題。

提前感謝您提供的任何幫助。

更新:下面是一個最小的工作範例。請注意,由於該文件是在 LyX 中建立的,因此其中包含 LyX 特定的程式碼:

#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass scrbook
\begin_preamble
%% Paragraphs
\usepackage{parskip}
\setlength{\parskip}{3mm plus1mm minus1mm}

%% Links
\usepackage{hyperref}
\usepackage{xcolor}
\definecolor{Muted}{rgb}{0.200, 0.200, 0.200}
\hypersetup{
    pdfnewwindow=true,      % links in new PDF window
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor= Muted,          % color of internal links (change box color with linkbordercolor)
    citecolor= Muted,        % color of links to bibliography
    filecolor= Muted,      % color of file links
    urlcolor= Muted           % color of external links
}

%% Footnotes
\usepackage{perpage}
\MakePerPage{footnote}

%% Footnote Symbols
%% use daggers and double daggers as footnote symbols
%%
%% define which symbols are to be used
\makeatletter
\newcommand*{\myfnsymbolsingle}[1]{%
  \ensuremath{%
    \ifcase#1% 0
    \or % 1
      {\dagger }
    \or % 2
      \ddagger
    \or % 3  
      \dagger\dagger
    \or % 4   
      \ddagger\ddagger
    \or % 5
      \dagger\dagger\dagger
    \or % 6
      \ddagger\ddagger\ddagger
    \else % >= 7
      \@ctrerr  
    \fi
  }%   
}   
\makeatother
%% redefine the command for creating footnotes
\newcommand*{\myfnsymbol}[1]{%
  \myfnsymbolsingle{\value{#1}}%
}
%% multiply the symbols for iterations above the upper bound, if needed
\usepackage{alphalph}
\newalphalph{\myfnsymbolmult}[mult]{\myfnsymbolsingle}{}
\renewcommand*{\thefootnote}{%
  \myfnsymbolmult{\value{footnote}}%
}
%% add space between the footnote character and text in the footer
\usepackage{scrextend}
\deffootnote[1em]{1.5em}{1em}{%
        \textsuperscript{\thefootnotemark}~%
}

%% Bibliography
\usepackage[super,sort&compress]{natbib}
\setcitestyle{citesep={, }}

%% Fonts
\usepackage{fontspec}
\setmainfont[
BoldFont={Kaiti TC Bold},
ItalicFont={Baskerville Italic},
BoldItalicFont={Baskerville Bold Italic}
] {Kaiti TC}
\end_preamble
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "Kaiti SC"
\font_sans "default" "Kaiti SC"
\font_typewriter "default" "Baskerville"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts true
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize 12
\spacing single
\use_hyperref true
\pdf_title "Dao De Jing"
\pdf_author "Laozi, Firstname Lastname"
\pdf_subject "Chinese philosophy"
\pdf_keywords "philosophy, non-duality, nonduality, Chinese"
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks false
\pdf_backref false
\pdf_pdfusetitle true
\papersize custom
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date true
\justification true
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\paperwidth 6in
\paperheight 9in
\leftmargin 0.8in
\topmargin 0.8in
\rightmargin 0.6in
\bottommargin 0.8in
\headheight 0.1in
\headsep 0.3in
\footskip 0.3in
\secnumdepth -2
\tocdepth 0
\paragraph_separation indent
\paragraph_indentation 0pt
\quotes_language english
\papercolumns 1
\papersides 2
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Title
Title
\end_layout

\begin_layout Author

\size small
Author
\end_layout

\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout

%% add spacing above the Index entry in the TOC
\end_layout

\begin_layout Plain Layout


\backslash
addtocontents{toc}{
\backslash
vspace{20pt}}
\end_layout

\end_inset


\end_layout

\begin_layout Chapter
Introduction
\end_layout

\begin_layout Part
Part 1
\end_layout

\begin_layout Chapter*
Chapter 1
\end_layout

\begin_layout Standard
This is text with an index entry at the end.
\begin_inset Index idx
status collapsed

\begin_layout Plain Layout
index entry
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
addtocontents{toc}{
\backslash
vspace{18pt}}
\end_layout

\end_inset


\end_layout

\begin_layout Chapter
Glossary
\end_layout

\begin_layout Labeling
\labelwidthstring 00.00.0000

\family typewriter
\series bold
example 
\family default
\series default
This is example text.
\end_layout

\begin_layout Standard
\begin_inset Newpage newpage
\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
raggedright
\end_layout

\begin_layout Plain Layout


\backslash
addcontentsline{toc}{chapter}{Bibliography} %% show in TOC
\end_layout

\end_inset


\end_layout

\begin_layout Bibliography
\begin_inset CommandInset bibitem
LatexCommand bibitem
label "1"
key "Item-1"

\end_inset

Bibliography item 1
\end_layout

\begin_layout Standard
\begin_inset CommandInset index_print
LatexCommand printindex
type "idx"

\end_inset


\end_layout

\end_body
\end_document

我透過 LyX 中的 XeTeX 產生了 .pdf,它確實導致了與我提到的相同的問題。

此外,以下是同一文件的 .tex 匯出:

%% LyX 2.2.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,english]{scrbook}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Kaiti SC}
\setsansfont[Mapping=tex-text]{Kaiti SC}
\setmonofont{Baskerville}
\usepackage[paperwidth=6in,paperheight=9in]{geometry}
\geometry{verbose,tmargin=0.8in,bmargin=0.8in,lmargin=0.8in,rmargin=0.6in,headheight=0.1in,headsep=0.3in,footskip=0.3in}
\setcounter{secnumdepth}{-2}
\setcounter{tocdepth}{0}
\setlength{\parindent}{0pt}
\usepackage{makeidx}
\makeindex
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{pdftitle={Dao De Jing},
 pdfauthor={Laozi, Firstname Lastname},
 pdfsubject={Chinese philosophy},
 pdfkeywords={philosophy, non-duality, nonduality, Chinese}}

\makeatletter
\@ifundefined{date}{}{\date{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%% Paragraphs
\usepackage{parskip}
\setlength{\parskip}{3mm plus1mm minus1mm}

%% Links
\usepackage{hyperref}
\usepackage{xcolor}
\definecolor{Muted}{rgb}{0.200, 0.200, 0.200}
\hypersetup{
    pdfnewwindow=true,      % links in new PDF window
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor= Muted,          % color of internal links (change box color with linkbordercolor)
    citecolor= Muted,        % color of links to bibliography
    filecolor= Muted,      % color of file links
    urlcolor= Muted           % color of external links
}

%% Footnotes
\usepackage{perpage}
\MakePerPage{footnote}

%% Footnote Symbols
%% use daggers and double daggers as footnote symbols
%%
%% define which symbols are to be used
\makeatletter
\newcommand*{\myfnsymbolsingle}[1]{%
  \ensuremath{%
    \ifcase#1% 0
    \or % 1
      {\dagger }
    \or % 2
      \ddagger
    \or % 3  
      \dagger\dagger
    \or % 4   
      \ddagger\ddagger
    \or % 5
      \dagger\dagger\dagger
    \or % 6
      \ddagger\ddagger\ddagger
    \else % >= 7
      \@ctrerr  
    \fi
  }%   
}   
\makeatother
%% redefine the command for creating footnotes
\newcommand*{\myfnsymbol}[1]{%
  \myfnsymbolsingle{\value{#1}}%
}
%% multiply the symbols for iterations above the upper bound, if needed
\usepackage{alphalph}
\newalphalph{\myfnsymbolmult}[mult]{\myfnsymbolsingle}{}
\renewcommand*{\thefootnote}{%
  \myfnsymbolmult{\value{footnote}}%
}
%% add space between the footnote character and text in the footer
\usepackage{scrextend}
\deffootnote[1em]{1.5em}{1em}{%
        \textsuperscript{\thefootnotemark}~%
}

%% Bibliography
\usepackage[super,sort&compress]{natbib}
\setcitestyle{citesep={, }}

%% Fonts
\usepackage{fontspec}
\setmainfont[
BoldFont={Kaiti TC Bold},
ItalicFont={Baskerville Italic},
BoldItalicFont={Baskerville Bold Italic}
] {Kaiti TC}

\makeatother

\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\begin{document}

\title{Title}

\author{{\small{}Author}}

\maketitle
\tableofcontents{}

%% add spacing above the Index entry in the TOC
\addtocontents{toc}{\vspace{20pt}}

\chapter{Introduction}

\part{Part 1}

\chapter*{Chapter 1}

This is text with an index entry at the end.\index{index entry}

\addtocontents{toc}{\vspace{18pt}}

\chapter{Glossary}
\begin{labeling}{00.00.0000}
\item [{\texttt{\textbf{example}}}] This is example text.
\end{labeling}
\newpage{}

\raggedright
\addcontentsline{toc}{chapter}{Bibliography} %% show in TOC
\begin{thebibliography}{1}
\bibitem[1]{Item-1}Bibliography item 1
\end{thebibliography}
\printindex{}
\end{document}

答案1

如果將「索引」新增\usepackage{idxlayout}至序言中,「索引」的標題將以與其他章節相同的方式定位

在此輸入影像描述

%% LyX 2.2.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,english]{scrbook}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Kaiti SC}
\setsansfont[Mapping=tex-text]{Kaiti SC}
\setmonofont{Baskerville}
\usepackage[paperwidth=6in,paperheight=9in]{geometry}
\geometry{verbose,tmargin=0.8in,bmargin=0.8in,lmargin=0.8in,rmargin=0.6in,headheight=0.1in,headsep=0.3in,footskip=0.3in}
\setcounter{secnumdepth}{-2}
\setcounter{tocdepth}{0}
\setlength{\parindent}{0pt}
\usepackage{makeidx}
\makeindex
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
 {hyperref}
\hypersetup{pdftitle={Dao De Jing},
 pdfauthor={Laozi, Firstname Lastname},
 pdfsubject={Chinese philosophy},
 pdfkeywords={philosophy, non-duality, nonduality, Chinese}}

\makeatletter
\@ifundefined{date}{}{\date{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%% Paragraphs
\usepackage{parskip}
\setlength{\parskip}{3mm plus1mm minus1mm}

%% Links
\usepackage{hyperref}
\usepackage{xcolor}
\definecolor{Muted}{rgb}{0.200, 0.200, 0.200}
\hypersetup{
    pdfnewwindow=true,      % links in new PDF window
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor= Muted,          % color of internal links (change box color with linkbordercolor)
    citecolor= Muted,        % color of links to bibliography
    filecolor= Muted,      % color of file links
    urlcolor= Muted           % color of external links
}

%% Footnotes
\usepackage{perpage}
\MakePerPage{footnote}

%% Footnote Symbols
%% use daggers and double daggers as footnote symbols
%%
%% define which symbols are to be used
\makeatletter
\newcommand*{\myfnsymbolsingle}[1]{%
  \ensuremath{%
    \ifcase#1% 0
    \or % 1
      {\dagger }
    \or % 2
      \ddagger
    \or % 3  
      \dagger\dagger
    \or % 4   
      \ddagger\ddagger
    \or % 5
      \dagger\dagger\dagger
    \or % 6
      \ddagger\ddagger\ddagger
    \else % >= 7
      \@ctrerr  
    \fi
  }%   
}   
\makeatother
%% redefine the command for creating footnotes
\newcommand*{\myfnsymbol}[1]{%
  \myfnsymbolsingle{\value{#1}}%
}
%% multiply the symbols for iterations above the upper bound, if needed
\usepackage{alphalph}
\newalphalph{\myfnsymbolmult}[mult]{\myfnsymbolsingle}{}
\renewcommand*{\thefootnote}{%
  \myfnsymbolmult{\value{footnote}}%
}
%% add space between the footnote character and text in the footer
\usepackage{scrextend}
\deffootnote[1em]{1.5em}{1em}{%
        \textsuperscript{\thefootnotemark}~%
}

%% Bibliography
\usepackage[super,sort&compress]{natbib}
\setcitestyle{citesep={, }}

%% Fonts
\usepackage{fontspec}
\setmainfont[
BoldFont={Kaiti TC Bold},
ItalicFont={Baskerville Italic},
BoldItalicFont={Baskerville Bold Italic}
] {Kaiti TC}

\makeatother

\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage{english}

\usepackage{idxlayout}
\begin{document}

\title{Title}

\author{{\small{}Author}}

\maketitle
\tableofcontents{}

%% add spacing above the Index entry in the TOC
\addtocontents{toc}{\vspace{20pt}}

\chapter{Introduction}

\part{Part 1}

\chapter*{Chapter 1}

This is text with an index entry at the end.\index{index entry}

\addtocontents{toc}{\vspace{18pt}}

\chapter{Glossary}
\begin{labeling}{00.00.0000}
\item [{\texttt{\textbf{example}}}] This is example text.
\end{labeling}
\newpage{}

\raggedright
\addcontentsline{toc}{chapter}{Bibliography} %% show in TOC
\begin{thebibliography}{1}
\bibitem[1]{Item-1}Bibliography item 1
\end{thebibliography}
\printindex{}
\end{document}

相關內容