
나는 정교한 ToC로 책을 디자인하고 있습니다. ToC를 그대로 유지하고 싶지만 장을 그룹화하여 PDF의 북마크를 좀 덜 부담스럽게 만들고 싶습니다.
MWE:
\usepackage[utf8]{inputenc}
\usepackage[hidelinks, bookmarksopen=false]{hyperref}
\usepackage{bookmark}
\title{Question PDF bookmarks}
\author{Alex Dijk}
\date{April 2022}
\begin{document}
\chapter{1 jan}First January lecture
\chapter{2 jan}Another January lecture
\chapter{3 jan}Another January lecture
\chapter{4 jan}Another January lecture
\chapter{5 jan}Another January lecture
\chapter{6 jan}Another January lecture
\chapter{7 jan}Another January lecture
\chapter{8 jan}Another January lecture
\chapter{1 feb}First February lecture
\chapter{2 feb}Another February lecture
\chapter{3 feb}Another February lecture
\chapter{4 feb}Another February lecture
\chapter{5 feb}Another February lecture
\chapter{6 feb}Another February lecture
\chapter{7 feb}Another February lecture
\chapter{8 feb}Another February lecture
\end{document}
따라서 여기서는 결과 PDF에 '1월' 및 '2월'이라는 북마크를 추가하고 싶습니다(ToC에는 제외). 그런 다음 이러한 추가 책갈피는 기본적으로 열리지 않아야 하며, 이 책갈피 아래에서 1월과 2월의 모든 개별 장이 주문됩니다. 이 작업을 어떻게 수행합니까?
답변1
현재 하이퍼 참조를 사용하면 이 작업을 수행할 수 있습니다(inputenc는 현재 라텍스에서 더 이상 필요하지 않으며 어쨌든 몇 년 이후로 utf8이 기본값입니다).
\documentclass{book}
\usepackage[hidelinks, bookmarksopen=false]{hyperref}
\usepackage{bookmark}
\title{Question PDF bookmarks}
\author{Alex Dijk}
\date{April 2022}
\begin{document}
\bookmark[level=part,dest=\hyperget{anchor}{chap:jan}]{January}
\chapter{1 jan}\label{chap:jan}First January lecture
\chapter{2 jan}Another January lecture
\chapter{3 jan}Another January lecture
\chapter{4 jan}Another January lecture
\chapter{5 jan}Another January lecture
\chapter{6 jan}Another January lecture
\chapter{7 jan}Another January lecture
\chapter{8 jan}Another January lecture
\cleardoublepage
\bookmark[level=part,dest=\hyperget{anchor}{chap:feb}]{February}
\chapter{1 feb}\label{chap:feb}First February lecture
\chapter{2 feb}Another February lecture
\chapter{3 feb}Another February lecture
\chapter{4 feb}Another February lecture
\chapter{5 feb}Another February lecture
\chapter{6 feb}Another February lecture
\chapter{7 feb}Another February lecture
\chapter{8 feb}Another February lecture
\end{document}
이전 시스템에서는 대상을 수동으로 생성해야 합니다.
\documentclass{book}
\usepackage[hidelinks, bookmarksopen=false]{hyperref}
\usepackage{bookmark}
\title{Question PDF bookmarks}
\author{Alex Dijk}
\date{April 2022}
\begin{document}
\hypertarget{jan}{}
\bookmark[level=part,dest=jan]{January}
\chapter{1 jan}First January lecture
\chapter{2 jan}Another January lecture
\chapter{3 jan}Another January lecture
\chapter{4 jan}Another January lecture
\chapter{5 jan}Another January lecture
\chapter{6 jan}Another January lecture
\chapter{7 jan}Another January lecture
\chapter{8 jan}Another January lecture
\cleardoublepage
\hypertarget{feb}{}
\bookmark[level=part,dest=feb]{February}
\chapter{1 feb}\label{chap:feb}First February lecture
\chapter{2 feb}Another February lecture
\chapter{3 feb}Another February lecture
\chapter{4 feb}Another February lecture
\chapter{5 feb}Another February lecture
\chapter{6 feb}Another February lecture
\chapter{7 feb}Another February lecture
\chapter{8 feb}Another February lecture
\end{document}