整篇论文的编译失败被缩小到下面的这个 MWE。由于某种原因,MWE 无法编译,日志文件如下:
平均能量损失
此 MWE 与此相关邮政和这个邮政这是成功编译在将 TexLive 更新至 2014 版后,其他用户或机器不再能使用它,但我的机器上就不再能使用它了。
\documentclass[paper=a4, twoside=semi]{scrbook} % A4 is 210mm x 297mm
\usepackage{blindtext}
\usepackage{calc}%
\usepackage{chapterthumb}% package should be installed in the same active folder
\usepackage{etoolbox}%
\usepackage{nameref}%
\usepackage{totcount}
\regtotcounter{chapter}%
%=====================Bibliography=============================
\usepackage[backend=biber]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{jobname.bib}
@article{rand_objective_1971,
title = {Objective criteria for the evaluation of clustering methods},
volume = {66},
pages = {846},
number = {336},
journaltitle = {Journal of the American Statistical Association},
author = {Rand, William M.},
date = {1971}
}
\end{filecontents}
\addbibresource{jobname.bib}
%=========================Chapter thumbs========================
\AtBeginDocument{%
\ifnumequal{\number\totvalue{chapter}}{0}{%
\renewcommand{\chapterthumbwidth}{\paperheight}%
\renewcommand{\chapterthumbskip}{\paperheight}%
}{%
\typeout{There are \number\totvalue{chapter} chapter in this document}%
\renewcommand{\chapterthumbskip}{\paperheight/\number\totvalue{chapter}}%
\renewcommand{\chapterthumbwidth}{\paperheight/\number\totvalue{chapter}}%
}%
}%
\lohead[\putchapterthumb]{\putchapterthumb}
\addtokomafont{chapterthumb}{\bfseries}
\newrobustcmd{\SetChapterThumbHeader}{%
\lohead[\putchapterthumb]{\putchapterthumb}%
}%
\newrobustcmd{\ClearChapterThumbHeader}{%
\lohead[]{}%
}%
\newrobustcmd{\refcommand}[1]{%
\nameref*{#1}%
}%
\newtoggle{UseChapterThumb}%
\toggletrue{UseChapterThumb}%
\renewcommand*{\chapterthumbformat}{\refcommand{chapter::title::\number\value{chapter}}}%
\makeatletter
\newcounter{totalchaptercounter}%
\newrobustcmd{\CreateUniqueChapterLabel}[1]{%
\refstepcounter{totalchaptercounter}%
\label{chapter::title::\number\value{totalchaptercounter}}%
}%
\let\LaTeXStandardChapter\chapter%
\newcommand{\chapter@noopt}[1]{%
\iftoggle{UseChapterThumb}{\SetChapterThumbHeader}{\ClearChapterThumbHeader}
\LaTeXStandardChapter{#1}%
\CreateUniqueChapterLabel{#1}%
}%
\newcommand{\chapter@opt}[2][]{%
\iftoggle{UseChapterThumb}{\SetChapterThumbHeader}{\ClearChapterThumbHeader}
\LaTeXStandardChapter[#1]{#2}%
\CreateUniqueChapterLabel{#2}% Must appear after chapter title is done
}%
\newcommand{\unstarredchapter}{%
\@ifnextchar[{\chapter@opt}{\chapter@noopt}%
}%
\newcommand{\starredchapter}[1]{%
\ClearChapterThumbHeader% Clear the headers -> no chapterthumb here
\LaTeXStandardChapter*{#1}%
}%
\renewcommand{\chapter}{%
\@ifstar{\starredchapter}{\unstarredchapter}%
}%
\let\LaTeXStandardTOC\tableofcontents%
\renewcommand{\tableofcontents}{%
\begingroup%
\renewcommand{\chapter}{\LaTeXStandardChapter}%
\LaTeXStandardTOC%
\endgroup%
}%
\let\LaTeXStandardLOF\listoffigures%
\renewcommand{\listoffigures}{%
\begingroup%
\renewcommand{\chapter}{\LaTeXStandardChapter}
\LaTeXStandardLOF%
\endgroup
}%
\let\LaTeXStandardLOT\listoftables%
\renewcommand{\listoftables}{%
\begingroup%
\renewcommand{\chapter}{\LaTeXStandardChapter}
\LaTeXStandardLOT%
\endgroup
}%
\let\LaTeXStandardPrintBibliography\printbibliography%
\newrobustcmd{\commonprintbibliographysetup}[1][]{%
\iftoggle{UseChapterThumb}{\SetChapterThumbHeader\refstepcounter{chapter}}{\ClearChapterThumbHeader}
\LaTeXStandardPrintBibliography[#1]
\iftoggle{UseChapterThumb}{%
\immediate\write\@auxout{%
\string\newlabel{chapter::title::\number\value{chapter}}{{\thepage}{\thepage}{Bibliography}{}}%
}%
}{}%
}%
\newrobustcmd{\printbibliography@@noopt}{%
\commonprintbibliographysetup[]%
}%
\newrobustcmd{\printbibliography@@opt}[1][]{%
\commonprintbibliographysetup[#1]%
}
\renewcommand{\printbibliography}{%
\@ifnextchar[{\printbibliography@@opt}{\printbibliography@@noopt}%
}%
\makeatother
%==================================================
\title{Title of the Dissertation}
\author{Author Name}
\publishers{Faculty Name}
\begin{document}
\maketitle
\pagestyle{plain}
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\cleardoublepage
\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\cleardoublepage
\lohead[\putchapterthumb]{\putchapterthumb}
\mainmatter
\pagestyle{scrheadings}
\chapter{Introduction}
\begin{figure}
\caption{dummy figure}
\end{figure}
\chapter{Materials \& Methods}
\chapter{Results}
\begin{table}
\caption{dummy table}
\end{table}
\chapter{Discussion}
In his reference \parencite{rand_objective_1971}, the author did a nice job.
\backmatter
\cleardoublepage
\printbibliography[heading=bibintoc]
\end{document}
日志文件片段
This is XeTeX, Version 3.14159265-2.6-0.99991 (TeX Live 2014/W32TeX) (preloaded format=xelatex 2014.9.2) 2 SEP 2014 20:07
entering extended mode
\write18 enabled.
%&-line parsing enabled.
**MWE_bleed_interaction.tex
(./MWE_bleed_interaction.tex
.
.
.
\c@section@level=\count114
LaTeX Info: Redefining \ref on input line 353.
LaTeX Info: Redefining \pageref on input line 353.
)
(c:/texlive/2014/texmf-dist/tex/latex/totcount/totcount.sty
Package: totcount 2011/01/25 v1.2 package for gettingthe total value of LaTeX c
ounters
)
\c@chapter@totc=\count115
.
.
.
(c:/texlive/2014/texmf-dist/tex/latex/filecontents/filecontents.sty
Package: filecontents 2011/10/08 v1.3 Create an external file from within a LaT
eX document
)
LaTeX Warning: Overwriting file `./jobname.bib'.
\openout15 = `jobname.bib'.
! Undefined control sequence.
l.38 \lohead
[\putchapterthumb]{\putchapterthumb}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.38 \lohead[
\putchapterthumb]{\putchapterthumb}
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! Undefined control sequence.
l.38 \lohead[\putchapterthumb
]{\putchapterthumb}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.38 \lohead[\putchapterthumb]{\putchapterthumb
}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
\c@totalchaptercounter=\count233
Package biblatex Info: Trying to load language 'english'...
Package biblatex Info: ... file 'english.lbx' found.
(c:/texlive/2014/texmf-dist/tex/latex/biblatex/lbx/english.lbx
File: english.lbx 2014/06/25 v2.9a biblatex localization (PK/JW/AB)
)
Normal \count register pool exhausted, switching to extended pool.
\@quotelevel=\count277
\@quotereset=\count278
(./MWE_bleed_interaction.aux)
\openout1 = `MWE_bleed_interaction.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 156.
LaTeX Font Info: ... okay on input line 156.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 156.
LaTeX Font Info: ... okay on input line 156.
.
.
.
[5] [6
]
! Undefined control sequence.
\ClearChapterThumbHeader ->\lohead
[]{}
l.165 \chapter*{Acknowledgments}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
[7] [8
]
! Undefined control sequence.
\ClearChapterThumbHeader ->\lohead
[]{}
l.168 \chapter*{Abstract}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
[9] [10
] [11] [12
]
! Undefined control sequence.
l.171 \lohead
[\putchapterthumb]{\putchapterthumb}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.171 \lohead[\putchapterthumb
]{\putchapterthumb}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.171 \lohead[\putchapterthumb]{\putchapterthumb
}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
[13] [14
]
! Undefined control sequence.
<argument> \undefinedpagestyle
l.173 \pagestyle{scrheadings}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ->\lohead
[\putchapterthumb ]{\putchapterthumb }
l.175 \chapter{Introduction}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ...ohead [\putchapterthumb
]{\putchapterthumb }
l.175 \chapter{Introduction}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ...humb ]{\putchapterthumb
}
l.175 \chapter{Introduction}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
[1] [2
]
Chapter 1.
! Undefined control sequence.
\SetChapterThumbHeader ->\lohead
[\putchapterthumb ]{\putchapterthumb }
l.180 \chapter{Materials \& Methods}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ...ohead [\putchapterthumb
]{\putchapterthumb }
l.180 \chapter{Materials \& Methods}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ...humb ]{\putchapterthumb
}
l.180 \chapter{Materials \& Methods}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
[3] [4
]
Chapter 2.
! Undefined control sequence.
\SetChapterThumbHeader ->\lohead
[\putchapterthumb ]{\putchapterthumb }
l.182 \chapter{Results}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ...ohead [\putchapterthumb
]{\putchapterthumb }
l.182 \chapter{Results}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ...humb ]{\putchapterthumb
}
l.182 \chapter{Results}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
[5] [6
]
Chapter 3.
! Undefined control sequence.
\SetChapterThumbHeader ->\lohead
[\putchapterthumb ]{\putchapterthumb }
l.187 \chapter{Discussion}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ...ohead [\putchapterthumb
]{\putchapterthumb }
l.187 \chapter{Discussion}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ...humb ]{\putchapterthumb
}
l.187 \chapter{Discussion}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
[7] [8
]
Chapter 4.
LaTeX Warning: Citation 'rand_objective_1971' on page 9 undefined on input line
188.
[9] [10
]
! Undefined control sequence.
\SetChapterThumbHeader ->\lohead
[\putchapterthumb ]{\putchapterthumb }
l.191 \printbibliography[heading=bibintoc]
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ...ohead [\putchapterthumb
]{\putchapterthumb }
l.191 \printbibliography[heading=bibintoc]
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SetChapterThumbHeader ...humb ]{\putchapterthumb
}
l.191 \printbibliography[heading=bibintoc]
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
LaTeX Warning: Empty bibliography on input line 191.
[11
] (./MWE_bleed_interaction.aux)
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) MWE_bleed_interaction
(biblatex) and rerun LaTeX afterwards.
Package logreq Info: Writing requests to 'MWE_bleed_interaction.run.xml'.
\openout1 = `MWE_bleed_interaction.run.xml'.
)
Here is how much of TeX's memory you used:
8513 strings out of 493725
148335 string characters out of 6149065
597217 words of memory out of 5000000
11750 multiletter control sequences out of 15000+600000
8846 words of font info for 31 fonts, out of 8000000 for 9000
1328 hyphenation exceptions out of 8191
54i,8n,43p,807b,717s stack positions out of 5000i,500n,10000p,200000b,80000s
Output written on MWE_bleed_interaction.pdf (28 pages).
笔记
- 要在 MWE 中使用,
chapterthumb
应该安装KOMA 示例来自 latex 分发包管理器。位于chapterthumb.sty
KOMAAngang B
示例部分。此外,还应复制chapterthumb.sty
并粘贴到活动.tex
文件夹中。 - Windows 7 32位,但在Ubuntu 14.04 LTS操作系统上也遇到了同样的问题。
- TexLive 2014 发行版
- 使用 XeLaTeX 进行编译
- TexSTudio 编辑器 2.8.2
- 解决这个 MWE 对我来说非常关键,因为这将修复我的论文在编译过程中抛出的相同错误。
更新 1
除\listfiles
MWE 发布的这些包外,还有:
*File List*
scrbook.cls 2013/12/19 v3.12 KOMA-Script document class (book)
scrkbase.sty 2013/12/19 v3.12 KOMA-Script package (KOMA-Script-dependent bas
ics and keyval usage)
scrbase.sty 2013/12/19 v3.12 KOMA-Script package (KOMA-Script-independent b
asics and keyval usage)
keyval.sty 2014/05/08 v1.15 key=value parser (DPC)
scrlfile.sty 2013/12/19 v3.12 KOMA-Script package (loading files)
tocbasic.sty 2013/12/19 v3.12 KOMA-Script package (handling toc-files)
scrsize11pt.clo 2013/12/19 v3.12 KOMA-Script font size class option (11pt)
typearea.sty 2013/12/19 v3.12 KOMA-Script package (type area)
blindtext.sty 2012/01/06 V2.0 blindtext-Package
xspace.sty 2009/10/20 v1.13 Space after command names (DPC,MH)
calc.sty 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
chapterthumb.sty 2014/01/15 v0.3 unsupported LaTeX package
graphicx.sty 2014/04/25 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
xetex.def 2014/07/25 v4.03 LaTeX color/graphics driver for XeTeX (RRM/JK)
color.sty 2014/04/23 v1.1a Standard LaTeX Color (DPC)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
scrlayer.sty 31/10/2013 v0.9.1480 package (defining layers and page styles)
etoolbox.sty 2011/01/03 v2.1 e-TeX tools for LaTeX
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
nameref.sty 2012/10/27 v2.43 Cross-referencing by name of section
refcount.sty 2011/10/16 v3.4 Data extraction from label references (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
gettitlestring.sty 2010/12/03 v1.4 Cleanup title references (HO)
kvoptions.sty 2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty 2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
totcount.sty 2011/01/25 v1.2 package for gettingthe total value of LaTeX cou
nters
biblatex.sty 2014/06/25 v2.9a programmable bibliographies (PK/JW/AB)
biblatex2.sty 2014/06/25 v2.9a programmable bibliographies (biber) (PK/JW/AB
)
logreq.sty 2010/08/04 v1.0 xml request logger
logreq.def 2010/08/04 v1.0 logreq spec v1.0
ifthen.sty 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
blx-dm.def
biblatex-dm.cfg
blx-compat.def 2014/06/25 v2.9a biblatex compatibility (PK/JW/AB)
biblatex.def
standard.bbx 2014/06/25 v2.9a biblatex bibliography style (PK/JW/AB)
numeric.bbx 2014/06/25 v2.9a biblatex bibliography style (PK/JW/AB)
numeric.cbx 2014/06/25 v2.9a biblatex citation style (PK/JW/AB)
biblatex.cfg
filecontents.sty 2011/10/08 v1.3 Create an external file from within a LaTeX
document
english.lbx 2014/06/25 v2.9a biblatex localization (PK/JW/AB)
***********
更新 2
因此 KOMA 脚本已更新。
更新的问题
因此,MWE 中的代码之前可以运行,因为它基于scrpage2
新版 KOMA-Script 不再支持的包,而这正是日志文件中错误的来源。新版本chapterthumb
基于旧包scrlayer
,而不是旧scrpage2
包。那么如何更新当前代码以使其符合新版 KOMA?
答案1
看起来你的安装有点问题。
您listfile
缺少以下内容:
scrpage2.sty 2013/12/19 v3.12 KOMA-Script package (page head and foot)
如果没有包,scrpage2
命令\lohead
就无法运行。这就是您收到错误消息的原因。
请检查您的安装。您可以尝试使用包管理器来更新您的系统。
更新:\usepackage{scrpage2}
添加到文档 后可以编译文档吗?
答案2
此问题仅限于chapterthumb.sty
软件包。您可以保留旧版本,然后更新整个 TexLive 或 MikeTex LaTeX 系统。
- 旧版本依赖于
scrpage2
KOMA-script 包的软件包部分 - 自此日期起,较新的版本依赖于
scrlayer
的后继包scrpage2
。在此包中,有一个对scrlayer
包的内部调用,而不是,scrpage2
这就是它出现\listfiles
在 MWE 输出中的原因。
我确实设法解决了这个问题,只需将工作目录中的旧版本替换为新版本即可和在通常所在的位置KOMA-script examples
。可以通过任何包管理器下载最新版本,然后在安装文件夹中用旧版本替换较新版本chapterthumb.sty
。如果您通过 TexLive 的包管理器安装它,则应该在以下路径中:
C:\texlive\2014\texmf-dist\doc\latex\koma-script-examples\Anhang-B
为了以防万一需要旧版本的软件包chapterthumbs
并希望使用以前帖子中发布的代码,这里是依赖于该scrpage2
软件包的软件包代码(复制它并将文件重命名为chapterthumbs.sty
:
% chapterthumb.sty
% Copyright 2008 Markus Kohm
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Markus Kohm.
%
% This work consists of this file only.
%-----------------------------------------------------------------------
\ProvidesPackage{chapterthumb}% [2005/03/10 v0.1 unsupported LaTeX package]
\DeclareOption*{%
\PassOptionsToPackage{\CurrentOption}{scrpage2}}
\ProcessOptions\relax
\RequirePackage{graphics,color}
\RequirePackage{scrpage2}
\newcommand*{\putchapterthumb}{%
\begingroup
\makebox[0pt][l]{%
\hspace{-\oddsidemargin}\hspace{-1in}%
\hspace{-\@oddheadshift}%
\hspace{\paperwidth}%
\parbox[t][0pt][t]{0pt}{%
\vspace{-\topmargin}%
\vspace{-1in}%
\vspace{-\headheight}%
\vspace{\dp\strutbox}%
\vspace{\firstchapterthumbskip}%
\setlength{\@tempdima}{\paperheight}%
\addtolength{\@tempdima}{-\chapterthumbwidth}%
\addtolength{\@tempdima}{1pt}%
\setlength{\@tempdimb}{\chapterthumbskip}%
\divide\@tempdima by\@tempdimb
\@tempcnta=\@tempdima
\advance\@tempcnta by 1
\@tempcntb=\value{chapter}%
\advance\@tempcntb by -1
\divide\@tempcntb by \@tempcnta
\multiply\@tempcntb by -\@tempcnta
\advance\@tempcntb by \value{chapter}%
\advance\@tempcntb by -1
\setlength{\@tempdima}{\chapterthumbskip}%
\vspace{\@tempcntb\@tempdima}%
\makebox[0pt][r]{%
\rotatebox{90}{%
\colorbox{\chapterthumbboxcolor}{%
\parbox[t][\chapterthumbheight][c]%
{\chapterthumbwidth}{%
\centering
\color{\chapterthumbcolor}%
\chapterthumbfont{\chapterthumbformat}}}}}%
}%
}%
\endgroup
}
\newcommand*{\firstchapterthumbskip}{0pt}
\newcommand*{\chapterthumbheight}{2em}
\newcommand*{\chapterthumbwidth}{.2\paperheight}%
\newcommand*{\chapterthumbskip}{.1\paperheight}%
\newcommand*{\chapterthumbboxcolor}{black}%
\newcommand*{\chapterthumbcolor}{white}
\newcommand*{\chapterthumbformat}{\@chapapp~\thechapter}
\newcommand*{\chapterthumbfont}{\normalfont\Large\sffamily}
\newcommand*{\scr@fnt@chapterthumb}{\chapterthumbfont}
\endinput
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "chapterthumbexample"
%%% End: