KOMA 中章节缩略图的出血校正

KOMA 中章节缩略图的出血校正

我想发送一份论文文件章节缩略图到印刷厂。该文件是用文字书写的KOMA-Script,是一个很好的解决方案流血发现修正这里。由于chapterthumbs页面边缘为黑色,因此我想确保在发送文档之前也对其进行了出血校正。否则,由于切割过程不精确(这是预料之中的),页面边缘可能会出现不必要的白色边距chapterthumbs

问题
如何为章节缩略图本身提供出血校正,即将其黑色延伸至出血校正区域,如下图所示?

输出

在此处输入图片描述

考虑下面的 MWE,其中提供了章节缩略图并使用crop包进行了出血校正。缺少的是章节缩略图本身的出血校正。

MWE 代码

\documentclass[paper=a4, twoside=semi]{scrbook} % A4 is 210mm x 297mm
\usepackage[cross,center,width=216mm,height=303mm]{crop} % bleed is 6mm
\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{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}

更新1:基于Symbol解决方案的MWE
我想知道是什么原因造成这种十字架的不平等。

在此处输入图片描述

答案1

更换

\usepackage[cross,center,width=216mm,height=303mm]{crop} % bleed is 6mm

经过

\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

结果

主意

在下面的 MWE 中,我们可以看到每一页都是重复和反射的。因此,每个拇指索引都不会停止在逻辑边缘,而是似乎超出了它。无论您如何生成拇指索引或任何其他需要出血校正的印刷内容,此技巧都有效。

请注意,由于下面的黑框不是单个框而是由两个框组成的,因此逻辑边缘可能仍未着墨。\kern2\dimen0只需用替换 即可轻松修复此问题\kern2\dimen0\kern-1pt

\documentclass[oneside]{book}
\usepackage[mirror,cam,a2,center]{crop}
\usepackage{thumb,blindtext}
\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{MyTitle}
\begin{document}
    \blinddocument
\end{document}

反对称性

为了反对称,请%在适当的位置添加,以便换行符在水平模式下不会产生任何空格。

\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}}

TOC 项目重复问题

发生这种情况的原因很简单,因为每个 toc 命令都会执行两次。因此,您可以

  • .toc手动删除文件中的重复项目;或者
  • 打开和关闭 \contentsline如下所述。

    \makeatletter
    \newsavebox\WholePageBigBox
    \renewcommand*\CROP@genreflect[1]{%
        \leavevmode
        \savebox\WholePageBigBox{\hb@xt@\paperwidth{\vbox to\paperheight{#1\vss}\hss}}%
            \write\@auxout{\noexpand\TurnOn@writefile}%
            \usebox\WholePageBigBox%
            \write\@auxout{\noexpand\TurnOff@writefile}%
            \dimen0\CROP@horigin\kern2\dimen0\reflectbox{\usebox\WholePageBigBox}}
    \let\old@writefile=\@writefile
    \newcommand*\lazy@writefile[2]{}
    \newcommand*\TurnOn@writefile{\renewcommand\@writefile\old@writefile}
    \newcommand*\TurnOff@writefile{\renewcommand\@writefile\lazy@writefile}
    \makeatother
    

相关内容