我正在撰写论文,并希望在正文(论文摘要,包括章节和参考书目)后附上研究论文的章节缩略图。
我想:
- 加载并使用“thumbs”包,没有任何警告或错误
- 每个拇指使用巨大的罗马数字,最好通过自动化
- 将罗马数字与拇指中心对齐
- 仅在特定页面上显示缩略图(例如,对于每个附加的论文,在 \chapter*{} 页面或之前的页面上,但仅限于奇数页)
我的文档中出现的错误:
LaTeX Error: Can be used only in preamble. bu2.aux, 86
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.86 \newlabel
{pagesLTS.arabic.local}{{}{46}{}{page.46}{}}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
和这个:
Package undolabl Error: Label `pagesLTS.arabic.local' shall be overridden
我已经制作了最小的工作示例来排除错误,这样我只收到警告:
Package undolabl Warning: Label `pagesLTS.arabic' overridden on input line 165.
它们似乎与所有部分(部分、章节等)相关。
查看结果图片。尺寸还行,但我还没搞清楚如何将数字显示为罗马数字,以及如何控制数字。我现在已经将其硬编码为“I”或“II”,这样就没问题了。我也在努力将字母居中。
另请参见最后一张图片以了解期望的输出,也就是我想要实现的目标。
梅威瑟:
\documentclass[12pt]{book}
\usepackage{parskip}
\usepackage{setspace}
\onehalfspacing
\setlength{\parindent}{0em}
\usepackage[paper = a4paper,
%To be shrunk to 80% when printed
twoside, %Two-side mode, switches margins on
bindingoffset = 2mm,
%Offset for binding side of page
hmargin = 25mm,
%Left and right margin
vmargin = 25mm,
%Top and bottom margin
dvipdfm]
{geometry}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{gensymb}
\usepackage{amsmath}
\usepackage{natbib}
\usepackage{bibunits}
\renewcommand\bibname{References}
% Change name of Bibliography to References
\renewcommand{\bibsection}{\section*{\bibname}}
% Bibliography as a section without numbering
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{makecell}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage[fontsize=13pt]{scrextend}
\usepackage[scaled]{helvet}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\sffamily\huge\bfseries}
{\chaptertitlename\ \thechapter}{1em}{\setstretch{1}}
\titleformat{\section}
{\normalfont\sffamily\Large\bfseries}
{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\sffamily\large\bfseries}
{\thesubsection}{1em}{}
% Each \part in TOC introduced by "Part x"
\makeatletter
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}{\partname~\thepart\hspace{1em}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
\markboth{}{}%
{\centering
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >-2\relax
\huge\bfseries \partname\nobreakspace\thepart
\par
\vskip 20\p@
\fi
\Huge \bfseries #2\par}%
\@endpart}
\makeatother
% Remove "Chapter x" from each \chapter
\makeatletter
\def\@makechapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont\fontfamily{phv}
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
%\huge\bfseries \@chapapp\space \thechapter
\Huge\bfseries \thechapter.\space%
%\par\nobreak
%\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother
% New command for changing tocdepth mid-document (for attached papers)
\newcommand{\changelocaltocdepth}[1]{%
\addtocontents{toc}{\protect\setcounter{tocdepth}{#1}}%
\setcounter{tocdepth}{#1}%
}
\usepackage[colorlinks,
citecolor=black,
linkcolor=black,
urlcolor=black,
]{hyperref}
\newcommand{\aref}[1]{\autoref{#1}}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\headheight}{15pt}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[LE,RO]{\sffamily \thepage}
\fancyhead[LO]{\sffamily \rightmark}
\fancyhead[RE]{\sffamily \leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\fancypagestyle{plain}{
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
}
\hyphenpenalty=10
\tolerance=1000
\title{
{\huge \textbf{Main title}}\\
\text{Subtitle}
\author{
\textbf{First-name Last-name}\vspace{2cm}\\
Thesis \\
Uni name\vspace{2.5em} \\
}
\date{}
}
\usepackage[letterspace=-45]{microtype}
\usepackage[height={=0.33\paperheight}, width=2cm]{thumbs}
\usepackage{lipsum}
\pagenumbering{arabic}
\begin{document}
\maketitle
\newpage
\mbox{}
\thispagestyle{empty}
\frontmatter
%\include{0-scientific_environment}
%\include{0-acknowledgements}
%\include{0-abstract}
%\include{0-listofpublications}
\singlespacing
\tableofcontents
\onehalfspacing
\mainmatter
%
%% Main chapters (example under)
%
%\begin{bibunit}[ACM-Reference-Format]
\chapter{Intro}
\lipsum
\section{More}
\lipsum
\chapter{Background}
\lipsum
%\addcontentsline{toc}{chapter}{References}
%\putbib[references.bib]
%\end{bibunit}
\setcounter{chapter}{0}
\setcounter{section}{0}
\setcounter{table}{0}
\setcounter{secnumdepth}{3}
\changelocaltocdepth{3}
% Includes subsubsection in TOC
%
% Paper 1
%
\chapter*{\Large\selectfont{\textcolor{darkgray}{Paper I}} \\ Name of paper} \addthumb{}{\textls{{\fontsize{40}{60}\selectfont \bfseries{I}}}}{white}{darkgray}
\addcontentsline{toc}{chapter}{Paper I -- Name of paper}
\renewcommand\thesection{\arabic{section}}
%\begin{bibunit}[ACM-Reference-Format]
%\input{papers/paperi/paper-master}
%\let\cleardoublepage\clearpage
%\addcontentsline{toc}{section}{References}
%\putbib[references]
%\end{bibunit}
%\includepdf[pages={1-}]{papers/paperii.pdf}
\lipsum
%\setcounter{chapter}{0}
%\setcounter{section}{0}
%\setcounter{table}{0}
% Paper 2 etc.
\chapter*{\Large\selectfont{\textcolor{darkgray}{Paper II}} \\ Name of paper} \addthumb{}{\textls{{\fontsize{40}{60}\selectfont \bfseries{II}}}}{white}{darkgray}
\addcontentsline{toc}{chapter}{Paper I -- Name of paper}
\renewcommand\thesection{\arabic{section}}
% and so forth
\end{document}
答案1
我整理了一下你的代码,但我无法摆脱错误消息,也无法激活
\renewcommand{\cftchapnumwidth}{5em}%
\renewcommand{\cftchappresnum}{Paper~}%
在第一篇论文之前,
\usepackage{tocloft,etoolbox}
一开始。
这是您开头的章节标题:
\titleformat{\chapter}%[display]
{\normalfont\sffamily\Huge\bfseries}
{%\chaptertitlename\
\thechapter.}{1em}{\setstretch{1}}%
这是您论文的章节标题:
\renewcommand\thechapter{\Roman{chapter}}%
\titleformat{\chapter}[display]
{\sffamily\bfseries\Large}{\selectfont\textcolor{darkgray}{Paper\space\thechapter}}{0.25\baselineskip}{} %
这是你的拇指的定义:
\usepackage[height={0.33\paperheight},width={2cm},eventxtindent={-2mm}]{thumbs}
\newcommand\mythumb{\addthumb{}{\textls{{\fontsize{40}{60}\selectfont \bfseries{\hfill\thechapter\hfill}}}}{white}{darkgray}}%
您可以通过以下方式申请:
\chapter{Name of Paper}\mythumb