我正在班上写博士论文book
,并使用该fncychap
软件包来格式化章节标题。MWE 附在下面。我遇到的问题是我想要没有格式的奉献和前言(即和\chapter*{}
等\chapter*{Abstract}
)fncychap
。我尝试了堆栈中所有可用的资源,但无济于事。有人可以指导我如何实现这一点吗?以下是 MWE(对于任何问题,任何其他有用的提示也表示感谢,提前致谢!):
\documentclass[12pt, a4paper, openright]{book}
%\usepackage{emptypage}
\usepackage[Glenn]{fncychap} %Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{\clearpage{\pagestyle{empty}\origdoublepage}}
\let\cleardoublepage\clearemptydoublepage
\usepackage{mathptmx}
\usepackage{amscd}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{lipsum}
\usepackage{float}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{makecell}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage{mathpazo}
\usepackage[utf8]{inputenc}
\usepackage[bindingoffset=0.5in,
left=3cm,
right=3cm,
top=3cm,
bottom=3cm]{geometry}
\geometry{a4paper}
\usepackage{fancyhdr}
\pagestyle{plain}
\usepackage[dvipsnames]{xcolor}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
% \setcounter{secumdepth}{0}
\usepackage[backend=biber,bibencoding=utf8, style=numeric-comp, sorting=none]{biblatex}
\bibliography{Bibliography}
\usepackage{hyperref}
\hypersetup{
pdftoolbar=true,
pdfmenubar=true,
pdffitwindow=false,
pdfstartview={FitH},
pdfauthor={AB},
colorlinks=true,
linkcolor=MidnightBlue,
citecolor=MidnightBlue,
}
\usepackage[acronym]{glossaries}
\glsdisablehyper
\setglossarystyle{listgroup}
\makeglossaries
\newacronym{cmb}{CMB}{cosmic microwave background}
\usepackage[pdftex]{graphicx}
\usepackage{setspace}
\doublespacing
\usepackage{physics}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{subcaption}
\usepackage{pdfpages}
\usepackage{bm}
\usepackage{wrapfig}
\usepackage{adjustbox}
\usepackage{dcolumn}
\newtheorem{theorem}{Theorem}
\DeclareUnicodeCharacter{0301}{\'{e}}
\setlength{\headheight}{14.49998pt}
\begin{document}
\begin{titlepage}
\begin{center}
{\huge My thesis title}
\noindent
\rule{\textwidth}{0.4pt}
\begin{center}
\small{A dissertation submitted in partial fulfilment of the requirements for the degree of Doctor of Philosophy in Physics}
\end{center}
\vspace{1cm}
\includegraphics[width=.2\textwidth,keepaspectratio]{AUSLogo.png}
\\
\vspace{0.7cm}
{By \\ \large \textbf{Author Name}}\\
Unique Enrolment No.: XXX dated 27/01/2017\\
University Registration No.: XXX of 2016--17
\vspace{0.7cm}
{Under the supervision of \\\textbf{Dr. XXX} \\ Professor}
\vspace*{0.5cm}
Department of Physics\\ XXX School of Physical Sciences \\
XXX University\\
XXX--788011, XXX, India
\end{center}
\end{titlepage}
%\let\cleardoublepage\clearpage
\chapter*{}
\input{Chapters/Dedication}
\frontmatter
\chapter*{Acknowledgements}
\input{Chapters/Acknowledgements}
\chapter*{Abstract}
\input{Chapters/Abstract}
\tableofcontents
\listoffigures
\listoftables
\printglossary[type=\acronymtype, nonumberlist, title=List of Abbreviations, toctitle=List of Abbreviations]
\mainmatter
\chapter{Chapter 1}\chaptermark{Introduction}
\label{chap:one}
\input{Chapters/Chapter1}
\backmatter
\pagestyle{plain}
\end{document}
答案1
介绍
首先,由于您展示了一个很长的文档序言,并以合理的方式组织它,因此您会发现一些不一致之处。
首先加载包,可能按操作类型分组。只有在执行设置后:您的前言才会变得可维护,但目前还不是。
第一个主要不一致之处:mathptmx
和mathpazo
不能一起加载。加载字体包(尤其是当它们作用于数学字体时)会导致奇怪的问题,这是很常见的。
你真的需要吗?当它出现时,它是一个受欢迎的补充,但它生成的图表与 Xy-picamscd
并不相符。tikz-cd
加载fancyhdr
然后启动\pagestyle{plain}
只是在浪费时间。 该\bibliography
命令已被 弃用biblatex
。 该pdftex
选项不应用于graphicx
。 该指令
\DeclareUnicodeCharacter{0301}{\'{e}}
恐怕是错误的。如果您遇到组合锐音符出现的问题,请修复它们;使用该代码,序列“e+组合锐音符”将产生“eé”,这绝对不是您想要的。
最后,为什么要注释掉emptypage
并手动执行包所做的事情呢?
主要问题
现在主要的问题来了。既然你想使用 Glenn 章节样式(即使受到人身威胁我也不会这么做),我认为没有理由不让未编号的章节共享它。该软件包没有用于取消选择章节样式的工具。但你可以“手动”执行此操作:
% chapter header
% first save the unnumbered chapter style
\ExpandArgs{cc}\NewCommandCopy{latex@makeschapterhead}{@makeschapterhead}
\usepackage[Glenn]{fncychap}% are you really sure?
% revert
\ExpandArgs{cc}\RenewCommandCopy{@makeschapterhead}{latex@makeschapterhead}
为处理未编号章节标题的命令创建一个别名;然后加载可怕的包并使用该别名恢复以前的含义。
我还补充
% fncychap
\ChNameVar{\Large}
在设置部分:章节名称和编号的无衬线字体确实不合适。
重新格式化的代码
我还简化了标题页的格式。
\documentclass[12pt, a4paper, openright]{book}
%%% Packages
%\usepackage[utf8]{inputenc}% no longer needed
% pagination related
\usepackage{geometry}
\usepackage{emptypage}
\usepackage{fancyhdr}
\usepackage{setspace}
% math
\usepackage{amsmath}
\usepackage{bm}
\usepackage{amsthm}
\usepackage{physics}
% fonts
%\usepackage{mathpazo}
%\usepackage{amssymb}
\usepackage{newpxtext,newpxmath}
% general utilities
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage{pdfpages}
\usepackage{wrapfig}
\usepackage{adjustbox}
% chapter header
% first save the unnumbered chapter style
\ExpandArgs{cc}\NewCommandCopy{latex@makeschapterhead}{@makeschapterhead}
\usepackage[Glenn]{fncychap}% are you really sure?
% revert
\ExpandArgs{cc}\RenewCommandCopy{@makeschapterhead}{latex@makeschapterhead}
% captions
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{subcaption}
% tables
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{makecell}
\usepackage{dcolumn}
% bibliography
\usepackage[backend=biber,bibencoding=utf8, style=numeric-comp, sorting=none]{biblatex}
% glossaries and indices
\usepackage[acronym]{glossaries}
% miscellaneous
%\usepackage{lipsum}
%\usepackage{float}
% HYPERREF (last!)
\usepackage{hyperref}
%%% Settings related to packages
% geometry
\geometry{
%a4paper,
bindingoffset=0.5in,
headheight=14.5pt,
left=3cm,
right=3cm,
top=3cm,
bottom=3cm,
heightrounded,
}
% fancyhdr
%%% do something here
% fncychap
\ChNameVar{\Large}
% glossaries
\glsdisablehyper
\setglossarystyle{listgroup}
\makeglossaries
% hyperref
\hypersetup{
pdftoolbar=true,
pdfmenubar=true,
pdffitwindow=false,
pdfstartview={FitH},
pdfauthor={AB},
colorlinks=true,
linkcolor=MidnightBlue,
citecolor=MidnightBlue,
}
%%% FINAL TOUCHES
\doublespacing
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
%%% Bib data
\addbibresource{Bibliography.bib}
% theorems
\newtheorem{theorem}{Theorem}
% acronyms
\newacronym{cmb}{CMB}{cosmic microwave background}
\begin{document}
\begin{titlepage}
\centering
{\huge My thesis title\par}
\rule{\textwidth}{0.4pt}
{\small A dissertation submitted in partial fulfilment of the requirements
for the degree of Doctor of Philosophy in Physics\par}
\vspace{1cm}
\includegraphics[width=.2\textwidth,keepaspectratio]{AUSLogo.png}
\vspace{0.7cm}
{By \\ \large \textbf{Author Name}}\\
Unique Enrolment No.: XXX dated 27/01/2017\\
University Registration No.: XXX of 2016--17
\vspace{0.7cm}
Under the supervision of \\\textbf{Dr. XXX} \\ Professor
\vspace*{0.5cm}
Department of Physics\\ XXX School of Physical Sciences \\
XXX University\\
XXX--788011, XXX, India
\end{titlepage}
\chapter*{Dedication}
%\input{Chapters/Dedication}
\frontmatter
\chapter*{Acknowledgements}
%\input{Chapters/Acknowledgements}
\chapter*{Abstract}
%\input{Chapters/Abstract}
\tableofcontents
\listoffigures
\listoftables
\printglossary[
type=\acronymtype,
nonumberlist,
title=List of Abbreviations,
toctitle=List of Abbreviations
]
\mainmatter
\chapter{Introduction}
\label{chap:one}
%\input{Chapters/Chapter1}
%\backmatter
\end{document}
答案2
您的 MWE 几乎不够简单而且无法正常工作,但在注释掉所有不好的部分后,我能够使以下内容正常工作。
顺便说一句,您可以\\ \vspace(0.7cm)
用替换\\[0.7cm]
,至少在内部center
和某些其他环境中。
\documentclass[12pt, a4paper, openright]{book}
%\usepackage{emptypage}
\makeatletter
\let\normalshead=\@makeschapterhead
\usepackage[Glenn]{fncychap} %Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
\let\@makeschapterhead=\normalshead
\makeatother
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{\clearpage{\pagestyle{empty}\origdoublepage}}
\let\cleardoublepage\clearemptydoublepage
\usepackage{mathptmx}
\usepackage{amscd}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{lipsum}
\usepackage{float}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{makecell}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage{mathpazo}
\usepackage[utf8]{inputenc}
\usepackage[bindingoffset=0.5in,
left=3cm,
right=3cm,
top=3cm,
bottom=3cm]{geometry}
\geometry{a4paper}
\usepackage{fancyhdr}
\pagestyle{plain}
\usepackage[dvipsnames]{xcolor}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
% \setcounter{secumdepth}{0}
\usepackage[backend=biber,bibencoding=utf8, style=numeric-comp, sorting=none]{biblatex}
\bibliography{Bibliography}
\usepackage{hyperref}
\hypersetup{
pdftoolbar=true,
pdfmenubar=true,
pdffitwindow=false,
pdfstartview={FitH},
pdfauthor={AB},
colorlinks=true,
linkcolor=MidnightBlue,
citecolor=MidnightBlue,
}
\usepackage[acronym]{glossaries}
\glsdisablehyper
\setglossarystyle{listgroup}
\makeglossaries
\newacronym{cmb}{CMB}{cosmic microwave background}
\usepackage[pdftex]{graphicx}
\usepackage{setspace}
\doublespacing
\usepackage{physics}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{subcaption}
\usepackage{pdfpages}
\usepackage{bm}
\usepackage{wrapfig}
\usepackage{adjustbox}
\usepackage{dcolumn}
\newtheorem{theorem}{Theorem}
\DeclareUnicodeCharacter{0301}{\'{e}}
\setlength{\headheight}{14.49998pt}
\begin{document}
\begin{titlepage}
\begin{center}
{\huge My thesis title}
\noindent
\rule{\textwidth}{0.4pt}
\begin{center}
\small{A dissertation submitted in partial fulfilment of the requirements for the degree of Doctor of Philosophy in Physics}
\end{center}
\vspace{1cm}
\includegraphics[width=.2\textwidth,keepaspectratio]{AUSLogo.png}
\\
\vspace{0.7cm}
{By \\ \large \textbf{Author Name}}\\
Unique Enrolment No.: XXX dated 27/01/2017\\
University Registration No.: XXX of 2016--17
\vspace{0.7cm}
{Under the supervision of \\\textbf{Dr. XXX} \\ Professor}
\vspace*{0.5cm}
Department of Physics\\ XXX School of Physical Sciences \\
XXX University\\
XXX--788011, XXX, India
\end{center}
\end{titlepage}
%\let\cleardoublepage\clearpage
\chapter*{}
%\input{Chapters/Dedication}
\frontmatter
\chapter*{Acknowledgements}
%\input{Chapters/Acknowledgements}
\chapter*{Abstract}
%\input{Chapters/Abstract}
\tableofcontents
\listoffigures
\listoftables
\printglossary[type=\acronymtype, nonumberlist, title=List of Abbreviations, toctitle=List of Abbreviations]
\mainmatter
\chapter{Chapter 1}\chaptermark{Introduction}
\label{chap:one}
%\input{Chapters/Chapter1}
\backmatter
\pagestyle{plain}
\end{document}