介绍

介绍

这篇文章是一个由 3 部分组成的问题,我需要帮助。这些问题都与章节样式和子部分有关\documentclass{scrreprt}。我相信我能解决它们最终,我来向你寻求指导,以便学习并节省一点时间。

介绍

我是一个初出茅庐的 LaTeX 使用者,我已经使用 LaTeX 制作过简单的报告,对格式并不太在意。现在我正在写一篇博士论文,我希望它看起来符合我的选择。

期望结果

我希望我的章节实现的效果大致如下图所示。我希望在文档中实现的基本元素是:

  • 章节第一页如下所示,章节标题没有数字
  • 可以在章节标题前添加引文。(可能不难)
  • 每章的迷你目录
  • 超过\subsection目录中所包含的章节级别。

Thesis Desired Output Concept

问题 1:小节

我一直在网站上阅读,发现有人针对这个问题提出了解决方案,scrreprt比如在帖子中scrreprt - 在 \subparagraph 下添加级别;我读到过该titlesec软件包非常可定制,但我也读到过它会禁用/干扰某些KOMA-script宏(我不知道具体是哪些)。在我的案例中,最好实施什么来实现我想要的外观?

问题 2:设置章节外观和样式

根据问题 1 的答案,您能否帮助解释一下我该如何设置?

问题 3:迷你目录和引文

您能否建议如何在章节号和标题之间添加引文(我可能不会为每一章添加引文)。我想象,要制作一个迷你章节限制的目录只需要一个包,或者可能已经有一个功能了scrreprt

MWE 更新 10/02/2014

再次抱歉没有早点提供这些,这是我MWE的论文设置。我附上了我用的标题页和章节,Dedication目前Abstract这些内容还不错。

我已经实施了@Crissov建议的内容,但不幸的是,我无法minitoc生成或使章节格式与他的 MWE 中呈现的格式相匹配,而在我的案例中实施之前,MWE 确实有效。由于他的代码可以单独工作,但在我将其实施到我的代码中后就不行了,所以我包括了我意识到有点笨重的 MWE,但我犯的错误一定就在那里。

\documentclass[
DIV=11,
twoside,
headinclude=false,
titlepage=firstiscover,
abstract=true,
headsepline=true,
footsepline=true,
%headings=big
]{scrreprt}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=3cm]{geometry} %typearea has that nasty problem of double bottom margin so had to remove it
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{minitoc} 

\linespread{1.5}
\flushbottom

\iffalse % don’t use titlesec.sty with KOMA script classes
\usepackage{titlesec}
%% \titleformat{⟨command⟩}[⟨shape⟩]{⟨format⟩}{⟨label⟩}{⟨sep⟩}{⟨before⟩}[⟨after⟩]
\titleformat{name=\chapter}[display]
{\usekomafont{chapter}}
{\raggedleft\chaptertitlename\ {\textcolor{gray}{\fontsize{60}    {65}\selectfont\thechapter}}}
{20pt}{}[\minitoc]
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ToC DEPTH LEVEL
\setcounter{secnumdepth}{3} % number subsubsection
\setcounter{tocdepth}{3} % list subsubsection


\addtokomafont{chapterprefix}{\raggedleft}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PREFACE AND BODY STYLING
\def\preface{
    \pagenumbering{roman}
    \doublespacing
}

\def\body{
    \cleardoublepage
    \dominitoc
    \tableofcontents
    \linespread{1.5} %Clear double spacing from preface
    \pagenumbering{arabic}
    \pagestyle{headings}
}

\def\abstract{
    \begin{center}{
        \large\bf Abstract}
    \end{center}
    \normalsize
    \linespread{1.5}
    }{\cleardoublepage}
\def\endabstract{
  \par
}

\newenvironment{acknowledgements}{
   \cleardoublepage
    \begin{center}{
        \large \bf Acknowledgements}
    \end{center}
    \normalsize
    \linespread{1.5}
    }{\cleardoublepage}
\def\endacknowledgements{
  \par
}

\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TITLE PAGE
\titlehead{
    \Large \centering University of London \\
}
\subject{Department of Materials \\
}
\title{My PhD Thesis Title}
\author{Edoardo}
\date{
    \vskip 1cm
    \normalsize Submitted \\
    \Large 2014 \\
    \vskip 2cm
    \normalsize Supervisors: \\
    \Large Jim Bob \\
    John Doe \\
    \vskip 2cm
    \normalsize Submitted in part fulfilment of the requirements for the degree of \\
    Doctor of Philosophy in Materials
}

\dedication{Dedication here}
\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PREFACE
\preface
\addcontentsline{toc}{chapter}{Abstract}
\begin{abstract}

In this study we did a lot of things

\end{abstract}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ToC ToF ToT
\body
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTERS
\chapter{Introduction}

\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}

\minitoc % should be put here automatically


\section{Test of depth}

We are delving deeper into the unknown.


\subsection{Publications}

Many publications here.

\subsubsection{Text Mass}
Here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text, here goes lots and lots of text

\end{document}

然而,我发现有一种方法可以在章节之后使用{after}命令行的一部分放置引用(如果需要) \titleformat,如下所示:

\titleformat{name=\chapter}[display]
  {\usekomafont{chapter}}
  {\raggedleft\chaptertitlename\ {\textcolor{gray}{\fontsize{60}{65}\selectfont\thechapter}}}
  {20pt}{\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}}

我需要解决的是如何将\dictum每个章节的特定部分链接到我之后可以编写的部分\chapter{chapter}......

答案1

部分回答,因为我最近在尝试类似的东西。更新了@speravir 的建议和两个丑陋的解决方案,即\dictum在前缀章节号和章节标题之间放置。

\documentclass[
  headings=big,
  chapterprefix=true%% like in standard class "report"
]{scrreprt}
%\usepackage[T1]{fontenc}%% pdflatex
\usepackage{fontspec}%% xelatex
\usepackage{xcolor}
\usepackage{graphicx}

%% partial TOCs after chapter title
\usepackage[]{minitoc}
\setcounter{secnumdepth}{3} % number subsubsections
\setcounter{tocdepth}{3} % list subsubsections
\mtcsetdepth{minitoc}{2}% ~ \setcounter{minitocdepth}{2}
\mtcsetfont{minitoc}{*}{\usekomafont{chapterentry}}
\mtcsetfont{minitoc}{section}{\usekomafont{chapterentry}\bfseries} 
\mtcsetfont{minitoc}{subsection}{\usekomafont{chapterentry}} 
\mtcsettitle{minitoc}{\relax}% remove “Contents”
\mtcsetoffset{minitoc}{-3.5em}% don’t know the appropriate length
\mtcsetrules{minitoc}{off}
\mtcsetpagenumbers{minitoc}{on}% default anyway
%\mtcsetfeature{minitoc}{before|after|open|close|pagestyle}{command} 

%% layout of chapter title by @Speravir
\addtokomafont{chapterprefix}{\raggedleft}
\renewcommand*{\chapterformat}{%
\mbox{\chapappifchapterprefix{\nobreakspace}%
\scalebox{5}{\color{gray}\thechapter\autodot}\enskip}%
}

%% put dictum between chapter number (with prefix) and title
%% \setdictum[⟨source⟩]{⟨quote⟩} -- before \chapter
\iftrue % change to \iffalse to test different approach
%% hacky approach
\newcommand\getdictum{\relax}
\newcommand\setdictum[2][]{\renewcommand\getdictum{\dictum[#1]{#2}}}
\usepackage{etoolbox}
\makeatletter
%% \patchcmd{⟨command⟩}{⟨search⟩}{⟨replace⟩}{⟨success⟩}{⟨failure⟩}
\patchcmd{\@@makechapterhead}{\size@chapterprefix{}}{\size@chapterprefix{}{\vskip 1em\getdictum}}{}{}
\makeatother
\else
% 
\newcommand\setdictum[2][]{%
  \setchapterpreamble[ol][0.5\textwidth]{\vskip 5em\dictum[#1]{#2}}%
}
\fi

\begin{document}
\dominitoc
\faketableofcontents

\setcounter{chapter}{6}\setcounter{page}{199}

\setdictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}
\chapter{Conclusions}

\minitoc

\section{Summary of Achievements}
Text goes here
\newpage\setcounter{page}{212}
\subsection{Papers Submitted}
\subsubsection{I want to go into the TOC}
\end{document}

答案2

除了 Crissov 的回答之外:

我使用了他的 MWE 并重新定义了该\addtokomafont{chapterprefix}命令(如下所示 - 通常将同一主题的定义尽可能放在一起很有用)\chapterformat(原始定义显示在文档中)。我添加了颜色变化定义和\scalebox来自graphicx

\renewcommand*{\chapterformat}{%
\mbox{\chapappifchapterprefix{\nobreakspace}%
\scalebox{3}{\color{gray}\thechapter\autodot}\enskip}}

我还加载了它,fontenc只是为了摆脱字体警告。总的来说:

\documentclass[
headings=big,
chapterprefix=true% like in standard class "report"
]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{minitoc}
\setcounter{secnumdepth}{3} % number subsubsections
\setcounter{tocdepth}{3} % list subsubsections

\addtokomafont{chapterprefix}{\raggedleft}

\renewcommand*{\chapterformat}{%
\mbox{\chapappifchapterprefix{\nobreakspace}%
\scalebox{3}{\color{gray}\thechapter\autodot}\enskip}}

\begin{document}
\dominitoc
\tableofcontents

\setcounter{chapter}{6}\setcounter{page}{199}

\chapter{Conclusions}
\dictum[Sun Tzu]{If you know the enemy and you know yourself %\\
you need not fear the results of a hundred battles.}

\minitoc

\section{Summary of Achievements}
Text goes here
\newpage\setcounter{page}{212}
\subsection{Papers Submitted}
\subsubsection{I want to go into the TOC}
\end{document}

输出如下:

Screenshot of example

相关内容