将“附录”设为其自己的部分并作为其自己的书签

将“附录”设为其自己的部分并作为其自己的书签

我希望我的“附录”部分作为其自己的部分(我的书围绕部分、章节、节等构成)出现在目录和 PDF 书签中。

我的问题已经得到解决,这里这里。我采用了建议的第二个解决方案在本页。它可以工作……但不完全是,正如您在我在本说明下包含的屏幕截图中所看到的:“附录”显示为其自己的书签(好),但现在有两个条目说“附录”指向同一页面(坏) - 类似地,当您运行代码(包括在下面)时,您还会获得两个“附录”的目录条目(坏)。

我想要一个单独的页面,上面写着“附录”(就像书中的“部分”一样,然后在下一页上显示第一个附录条目,在下面的例子中是条目“歌词”。

注意:虽然我下面包含的代码没有显示它,但我使用该\input{Appendix}命令来访问附录包含的文本。

谢谢你的帮助。

% PREAMBLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[oneside,centered,twocolumn]{book}
%\usepackage[T1]{fontenc}
\special{papersize=215.9mm,279.4mm}
\usepackage[english]{babel}

\usepackage[sc]{mathpazo}
\linespread{1.05} % Palladio needs more leading (space between lines)
\usepackage{tocloft} % Customization of TOC LOF LOT
\makeatletter\@addtoreset{chapter}{part}\makeatother%
\usepackage[toc,page]{appendix}
\usepackage[table]{xcolor} % For links' color
\usepackage{colortbl} % To define colors
\usepackage{multirow}
\usepackage{eso-pic}
\usepackage{epigraph}
\usepackage{caption} % To change the way captions are labelled
\usepackage{pdfpages}
\usepackage{ltablex}
\usepackage{nicefrac} % to write fractions
\usepackage{attrib} % For source of quotations
\usepackage{lettrine} % For NewThought formatting
\usepackage{array} % To define width of columns in long table
\usepackage{booktabs} % Nicer spacing in columns
\usepackage{siunitx} % To write Celsius, etc.
\usepackage{enumitem} % To create item lists
\usepackage[rightmargin=0pt]{quoting}
\usepackage{scrextend}
\usepackage{threeparttable} % For table notes + To allow footnote material to stay with the tabular environment
\usepackage{relsize,etoolbox} % To make table footnote font smaller and quotes small
\usepackage{threeparttablex}
\appto\TPTnoteSettings{\footnotesize}
\usepackage{textcomp} % For Numero symbol
\usepackage{titlesec}
\usepackage[linguistics,edges]{forest}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{titling}
\usepackage{fancyhdr}
\usepackage{fontspec}

\setmainfont{TeX Gyre Pagella} % Palatino clone

\usepackage{hyperref} % Hyperlinks
\usepackage{bookmark}

% HEADING and PART FONTS %%%%%%%%%%%%%%%%%%%%%%%%

\newfontfamily\headingfont[]{TeX Gyre Heros}
\newfontfamily\partfont[]{Candara}

% STYLE PART WITH GRAPHICS AND WORK STYLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\titleformat{\part}[display]
{\bfseries\color{black}\filcenter\fontsize{60}{70}\partfont} % Size of Part
{\thispagestyle{empty}\Huge\MakeUppercase\partfont\thepart} % <=========
{10pt}
{\tikz[remember picture,overlay]\node[inner sep=0pt] at ($(current page.north) +
    (0pt,-400pt)$) {\includegraphics{example-image-duck}};%
}

% STYLE CHAPTER PAGE WITH GRAPHICS AND WORK STYLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\titleformat{\chapter}[display]
{\bfseries\color{black}\filcenter\fontsize{35}{35}\headingfont} % Size of Chapter1&Chapter
{\huge\MakeUppercase\headingfont{\chaptertitlename} \thechapter}
{12pt}
{\tikz[remember picture,overlay]\node[inner sep=0pt] at ($(current page.north) +
    (0pt,-117pt)$) {\includegraphics[width=14cm]{example-image-a}};}
\titlespacing{\chapter}{0pt}{50mm}{42.5mm}

% WATERMARK ADDITIONS FOR BACKGROUND IMAGE BEHIND APPENDICES %%%%%%%%%%%%%%%%%%%%%%

\usepackage[printwatermark]{xwatermark}
\newwatermark[pages=595-595]{\includegraphics{example-image-duck}}

\newlength{\drop}



\begin{document}

\frontmatter
\tableofcontents

\part{Fish}

\chapter{Fortification}
\chapter{Whales}

\bookmarksetupnext{level=-1}
\appendix
\addappheadtotoc
\appendixpage

\chapter{Lyrics}
\section{Whales}
\subsubsection{Dogs}
\chapter{Cats}
\chapter{Dice}

\end{document}

在此处输入图片描述

答案1

我尝试了您的 MWE,结果pdflatex却被告知,正如您使用过的fontspec一样,我必须使用xelatex(这会导致分段错误)或lualatex无法找到您使用的字体。我非常不开心。

在您的文档中不要使用\addappheadtotoc,只需使用\appendixpage,您就会得到我认为您想要的东西。GOM

相关内容