This question is similar to previous ones considering chapterthumbs -- answering this question will render them obsolete.
- How to get chapterthumb work in KOMA-Script?
- How to get chapterthumbs match their chapter titles in KOMA-Script?
- Bleed correction for chapterthumbs in KOMA
- How to fix this MWE to show the chapterthumbs in KOMA-Script?
Why this post then? The reason is that the new version of chapterthumb is based on another package called scrlayer-scrpage of the KOMA-script instead of the old one scrpage2. For more info see this reference (in German): http://www.komascript.de/chapterthumbs-example
What is needed:
The MWE will present the current problem of compilation of my dissertation as well as fulfill the criteria of the printing house where suitable bleed correction must be provided. So the objectives are:
- Change the text of the chapterthumbs from Chapter 1 to Introduction, Chapter 2 to Materials & Methods, and so forth.
- The chapterthumbs should be spread over the whole right edge -- introduction thumb begins at the top right and bibliography thumb ends at the bottom right. Of course the crop area should not be calculated. One can do this without
croppackage and without its related code and when chapterthumbs distributed correctly one can reload the crop code later one. - Chapterthumbs should only appear in intro - M&M - Discussion - Results and Bibliography. So it needs to show up in the Bibliography as well.
MWE
\documentclass[paper=a4, twoside=semi]{scrbook} % A4 is 210mm x 297mm
\usepackage{blindtext}
\usepackage{fontspec}
%=====================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}
%===================Chapterthumb ===============================
\usepackage{chapterthumb}% install + add in active .tex folder
\usepackage{scrlayer-scrpage}
\pagestyle{scrheadings}
\AddLayersToPageStyle{@everystyle@}{chapterthumb}
\addtokomafont{chapterthumb}{\bfseries}
%====================Crop and Bleed correction==================
\usepackage[mirror,cross,center,width=216mm,height=303mm]{crop} % bleed is 6mm
\makeatletter
\newsavebox\WholePageBigBox
\renewcommand*\CROP@genreflect[1]{
\leavevmode
\savebox\WholePageBigBox{\hb@xt@\paperwidth{\vbox to\paperheight{#1\vss}\hss}}%
\usebox\WholePageBigBox\dimen0\CROP@horigin\kern2\dimen0\reflectbox{\usebox\WholePageBigBox}}
\makeatother
%===============================================================
\title{Title of the Dissertation}
\author{Author Name}
\publishers{Faculty Name}
\begin{document}
\maketitle
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\mainmatter
\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
\printbibliography[heading=bibintoc]
\chapter*{Curriculum Vitae} %there should be no chapterthumbs here
\end{document}
Output
Notes
- Pls make sure you have the updated version of LaTeX distribution whether MikTeX or TexLive. To use the chapterthumb in the MWE one should install
KOMA examplesfrom the latex distribution package manager. thechapterthumb.styresides in the Angang B. Additionally, one should copy thechapterthumb.styand paste it in the active.texfolder. - Windows 7 32bit but the same problem was encountered on Ubuntu 14.04 LTS OS.
- TexLive 2014 distribution XeTeX, Version 3.14159265-2.6-0.99991 (TeX Live 2014/W32TeX)
- compilation with XeLaTeX
Update1
This code would solve the chapternames instead of their numbers and was extracted from previous posts using nameref and etoolbox packages. This can be added between the section of chapterthumb and crop bleed correction in the MWE.
%==================== to show chapter names instead of their numbers ========
\usepackage{etoolbox}
\usepackage{nameref}
\let\LaTeXStandardChapter\chapter%
\renewcommand*{\chapterthumbformat}{\refcommand{chapter::title::\number\value{chapter}}}%
\makeatletter
\newcounter{totalchaptercounter}%
\newrobustcmd{\WriteChapterTitleToAux}[1]{%
\refstepcounter{totalchaptercounter}%
\immediate\write\@auxout{%
\string\newlabel{chapter::title::\number\value{totalchaptercounter}}{{\thesection}{\thepage}{\unexpanded{#1}}{}}
}% End of writing to AUX file
}%
\newrobustcmd{\refcommand}[1]{%
\nameref*{#1}%
}%
\newcommand{\chapter@noopt}[1]{%
\WriteChapterTitleToAux{#1}%
\LaTeXStandardChapter{#1}%
}%
\newcommand{\chapter@opt}[2][]{%
\WriteChapterTitleToAux{#2}%
\LaTeXStandardChapter[#1]{#2}%
}%
\newcommand{\unstarredchapter}{%
\@ifnextchar[{\chapter@opt}{\chapter@noopt}%
}%
\newcommand{\starredchapter}[1]{%
\LaTeXStandardChapter*{#1}
}%
\renewcommand{\chapter}{%
\@ifstar{\starredchapter}{\unstarredchapter}%
}%
Output
