classicthesis 中的自定义标题

classicthesis 中的自定义标题

我正在尝试使用像这样的自定义标题。我正在使用 classicthesis。我使用 fancyhdr,但它给了我错误。我也试过这个关联但没有运气。这是我的代码。

% **************************************************************************************************************
% A Classic Thesis Style
% An Homage to The Elements of Typographic Style
%
% Copyright (C) 2007 Andr� Miede http://www.miede.de
%
% If you like the style then I would appreciate a postcard. My address 
% can be found in the file ClassicThesis.pdf. A collection of the 
% postcards I received so far is available online at 
% http://postcards.miede.de
%
% License:
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; see the file COPYING.  If not, write to
% the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
% Boston, MA 02111-1307, USA.
%
% **************************************************************************************************************
% Note:
%    * You must not use "u etc. in strings/commands that will be spaced out (use ü or real umlauts instead)
%    * Chapters must be marked with the \myChapter{Foo} command (sorry for the inconvenience at this point)
%    * New enumeration (small caps): \begin{aenumerate} \end{aenumerate}
%    * For margin notes: \graffito{}
%    * Do not use bold fonts in this style, it is designed around them
%    * Use tables as in the examples
%    * See classicthesis-ldpkg.sty for useful commands
% **************************************************************************************************************
% To Do:
%    * support a List of Listings that looks like the other lists
% **************************************************************************************************************
\documentclass[ %twoside,
                openright,titlepage,fleqn,%1headlines,% 
                pointlessnumbers,headinclude,BCOR5mm,%
                %10pt,a4paper,footinclude,cleardoubleempty,abstractoff % <--- obsolete, remove (todo)
                ]{scrreprt}
% ********************************************************************
% KOMA-Script setup (new, see commented line above)
% ********************************************************************
\KOMAoptions{%
    paper=letter,%
    fontsize=12pt,%
    cleardoublepage=empty,%
    footinclude=false,%
    abstract=false%
}



% ********************************************************************
% Development Stuff
% ********************************************************************
%\listfiles
%\usepackage[l2tabu, orthodox, abort]{nag}
%\usepackage[warning, all]{onlyamsmath}

\newcommand{\zerod}{0\textsc{d}\xspace}
\newcommand{\oned}{1\textsc{d}\xspace}

\newcommand{\degree}{\ensuremath{^\circ}}

\usepackage{multirow}
\usepackage{setspace}
\usepackage{lscape}
\usepackage{wrapfig}
\usepackage{enumitem}



% ********************************************************************
% Re-usable information
% ********************************************************************
\newcommand{\myTitle}{Integrating Comments in Video Tutorials\xspace}
\newcommand{\myDegree}{Master of Science\xspace}
\newcommand{\myName}{Samiul Alam Anik\xspace}
\newcommand{\myProf}{Dr. Andrea Bunt\xspace}
\newcommand{\myOtherProf}{Put name here\xspace}
\newcommand{\mySupervisor}{Put name here\xspace}
\newcommand{\myFaculty}{Put data here\xspace}
\newcommand{\myDepartment}{Department of Computer Science\xspace}
\newcommand{\myUni}{\protect{University of Manitoba}\xspace}
\newcommand{\myLocation}{Winnipeg, Manitoba, Canada\xspace}
%\newcommand{\myTime}{December 2011\xspace}
%\newcommand{\myVersion}{Version 1.0\xspace}
%*******************************************************
% Packages with options that might require adjustments
%*******************************************************
\usepackage[latin1]{inputenc} 
\usepackage[ngerman,american]{babel}           
\usepackage[square,numbers]{natbib} 
%*******************************************************
\usepackage{classicthesis-ldpkg} 
\usepackage{fancyhdr}

\fancyfoot{}
\fancyhead[RO,LE]{\thepage}
\fancyhead[LO]{\leftmark}
\fancyhead[RE]{\rightmark}


%*******************************************************
% Options for classicthesis.sty:
% tocaligned eulerchapternumbers drafting linedheaders listsseparated
% subfig nochapters beramono eulermath parts minionpro pdfspacing
\usepackage[eulerchapternumbers,%drafting, %eulermath,%pdfspacing,parts,%
            subfig,beramono]{classicthesis}
%*******************************************************            
%\usepackage[section,below]{placeins} <--- not everybody wants this
%\usepackage[all]{hypcap} <--- does not work with MiKTeX 2.6
% ********************************************************************
% Language/strings for backrefs (change here, thanks, Lorenzo)
%*******************************************************
%\renewcommand{\backrefnotcitedstring}{\relax}%(Not cited.)
%\renewcommand{\backrefcitedsinglestring}[1]{(Citato a pagina~#1.)}
%\renewcommand{\backrefcitedmultistring}[1]{(Citato alle pagine~#1.)}
%\renewcommand{\backreftwosep}{ e~}
%\renewcommand{\backreflastsep}{ e~}
% ********************************************************************
% Setup and Finetuning
%*******************************************************
\newlength{\abcd} % for ab..z string length calculation
\newcommand{\myfloatalign}{\centering} % how all the floats will be aligned
\setlength{\extrarowheight}{3pt} % increase table row height
\usepackage{titlesec}


\titlespacing*{\section} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\titlespacing*{\subsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\subsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\paragraph} {0pt}{3.25ex plus 1ex minus .2ex}{1em}
\titlespacing*{\subparagraph} {\parindent}{3.25ex plus 1ex minus .2ex}{1em}
\setlength{\parindent}{0pt}
\renewcommand{\bottomtitlespace}{0.25\textheight}

%69 char/line in 12pt palantino = 32pica = 360pt

%1:1.8 ratio results in height of 648
\areaset[5mm]{360pt}{723pt} % 648 + 33 head + 42 head \the\footskip

%1:1.618 ratio results in height of 582
%\areaset[5mm]{360pt}{657pt} % 582 + 33 head + 42 head \the\footskip

\setlength{\marginparwidth}{7em}%
\setlength{\marginparsep}{2em}%
\typearea[current]{last}





\usepackage[left=1.25in,
        right= 1.25in,
        top=1in,
        bottom=1in]{geometry}
%%% change description label to italics
\renewcommand{\descriptionlabel}[1]{\hspace*{\labelsep}\textit{#1}}   % spacedlowsmallcaps textit textsc 

% ********************************************************************
% Captions look and feel
%*******************************************************
\captionsetup{format=hang,font=small}
% ********************************************************************
% Where to look for graphics
%*******************************************************
%\graphicspath{{gfx/}{misc/}} % considered harmful according to l2tabu
% ********************************************************************
% Hyperreferences
%*******************************************************
\hypersetup{%
    colorlinks=true, linktocpage=true, pdfstartpage=1, pdfstartview=FitV,%
    breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,%
    plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,%
    hypertexnames=true, pdfhighlight=/O,%hyperfootnotes=true,%nesting=true,%frenchlinks,%
    urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webgreen, %pagecolor=RoyalBlue,%
    % uncomment the following line if you want to have black links (e.g., for printing)
    urlcolor=Black, linkcolor=Black, citecolor=Black, %pagecolor=Black,%
    pdftitle={\myTitle},%
    pdfauthor={\textcopyright\ \myName, \myUni, \myDepartment},%
    pdfsubject={},%
    pdfkeywords={},%
    pdfcreator={pdfLaTeX},%
    pdfproducer={LaTeX with hyperref and classicthesis}%
}
%********************************************************************
% Hyphenation
%*******************************************************
%\hyphenation{put special hyphenation here}
\hyphenation{con-cern-ed}

% ********************************************************************
% GO!GO!GO! MOVE IT!
%*******************************************************

\begin{document}
\frenchspacing
\raggedbottom
\selectlanguage{american} % american ngerman
%\renewcommand*{\bibname}{new name}
%\setbibpreamble{}
\pagenumbering{roman}
\pagestyle{plain}
%********************************************************************
% Frontmatter
%*******************************************************
%\include{FrontBackmatter/Titlepage}
%\cleardoublepage\include{FrontBackmatter/Dedication}
%\cleardoublepage\include{FrontBackmatter/Abstract}
%\cleardoublepage\include{FrontBackmatter/Publication}
%\cleardoublepage\include{FrontBackmatter/Acknowledgments}
%\pagestyle{scrheadings}
%\cleardoublepage\include{FrontBackmatter/Contents}
%********************************************************************
% Mainmatter
%*******************************************************
\pagenumbering{arabic}
% use \cleardoublepage here to avoid problems with pdfbookmark
\doublespacing
%\onehalfspacing
% \include{Chapters/QualitativeAnalysis}

\include{Chapters/SystemDescription}

\singlespacing
% ********************************************************************
% Backmatter
%*******************************************************
\appendix
\include{Appendix/Appendix}

%********************************************************************
% Other Stuff in the Back
%*******************************************************
\bibliographystyle{plain}
\bibliography{Bibliography} \addcontentsline{toc}{chapter}{\bibname}




%\include{FrontBackmatter/Bibliography}
%\cleardoublepage\include{FrontBackMatter/Colophon}
%\cleardoublepage\include{FrontBackMatter/Declaration}
% ********************************************************************
% Game Over: Restart, Restore or Quit?
%*******************************************************
\end{document}

enter image description here

答案1

请注意以下几点。

  • 如果你使用几何学那么所有的\areaset东西都是毫无意义的,就像课程和课程的设置一样经典论文
  • 两者都不标题安全也不花式高清建议与 KOMA 类一起使用。使用它们会破坏类和协作包的各种功能。
  • 不建议将段落缩进设置为零。如果你出于某些奇怪的原因必须这样做,那么可以使用类似帕斯基普但我无法想象这适合写论文。
  • 我不知道在哪里可以找到classicthesis-ldpkg

这是一个相对简单的例子,源自 MWE 的简化形式,演示了如何使用 KOMA 的scrlayer-scrpage设置问题中显示的页眉和页脚。

\usepackage{scrlayer-scrpage}

实际上,页脚并未显示,但我认为页码不应该出现在页眉之外的默认位置。

headsepline用于包选项中以获取标题下的行。\addtokomafont{}{}用于将标题设置为斜体,而不是倾斜字体。

\addtokomafont{pageheadfoot}{\itshape}

scrheadings提供的页面样式scrlayer-scrpage用于创建自定义标题。

\pagestyle{scrheadings}

由于我们使用此选项,我们需要告诉 KOMA 哪些部分应该创建“标记”。在我们的例子中,我们希望章节这样做。

\automark[chapter]{chapter}

页眉本身使用类和包命令进行配置,用于设置内部、外部和中心页眉和页脚。

\ihead{\headmark}

\headmark比乱搞\leftmark和搞乱要容易得多,\rightmark因为我们所有的标题都是相同的。这将设置内部标题。

\chead{}

标记章节会设置中心标题,所以让我们将其删除。

\ohead[\pagemark]{\pagemark}

\pagemark在外部标题中设置页码。

我们不想要中锋。

\cfoot[]{}

我们想要改变章节编号的格式,默认情况下它只是一个数字,所以我们在末尾添加章节部分的名称以及冒号和空格。

\renewcommand*\chaptermarkformat{\chaptername{} \thechapter:\quad}

结果如下:

Kantian headers

完整代码:

\documentclass[openright,titlepage,fleqn,pointlessnumbers,headinclude,headsepline,BCOR5mm]{scrreprt}
\KOMAoptions{%
    paper=letter,%
    fontsize=12pt,%
    cleardoublepage=empty,%
    footinclude=false,%
    abstract=false,%
}
\usepackage[utf8]{inputenc}
\usepackage{scrlayer-scrpage}
\areaset[5mm]{360pt}{723pt} % 648 + 33 head + 42 head \the\footskip
\setlength{\marginparwidth}{7em}%
\setlength{\marginparsep}{2em}%
\typearea[current]{last}
\automark[chapter]{chapter}
\ihead{\headmark}
\chead{}
\ohead[\pagemark]{\pagemark}
\cfoot[]{}
\renewcommand*\chaptermarkformat{\chaptername{} \thechapter:\quad}
\pagestyle{scrheadings}
\addtokomafont{pageheadfoot}{\itshape}
\usepackage{kantlipsum}

\begin{document}
\pagenumbering{arabic}
\chapter{Kant}
\kant[1-5]
\section{More Kant}
\kant[6-10]
\section{Yet More Kant}
\kant[11-15]
\chapter{Further Kant}
\kant[16-20]
\end{document}

相关内容