
Я хочу добавить заголовок PDF в закладку PDF с помощью пакета hyperref. Однако это не работает.
Как показано на рисунке, я хочу добавить заголовок над введением.
Более того, я хочу сделать «уравнение (1)» ссылкой в целом, а не только красной 1, как показано на рисунке выше.
Как мне этого добиться? Большое спасибо.
Вот мой MWE:
\documentclass[a4paper, 10pt]{article}
\usepackage{amsmath}
\usepackage[backend=biber, style=numeric]{biblatex}
\usepackage[bookmarksnumbered, pdftitle={A PDF Title?}]{hyperref}
\hypersetup{colorlinks=true, citecolor=cyan}
\begin{filecontents*}{\jobname.bib}
@article{Azeez2013,
author = {Azeez, O. S. and Isafiade, A. J. and Fraser, D. M.},
title = {Supply-based superstructure synthesis of heat and mass exchange networks},
journal = {Computers \& Chemical Engineering},
volume = {56},
number = {7},
pages = {184--201},
year = {2013}
}\end{filecontents*}
\addbibresource{\jobname}
\title{A PDF title?}
\begin{document}
\maketitle
\section{Introduction}
This is an example for illustrating the use Hyperref package~\cite{Azeez2013}.
\section{Problem Statement}
What is wrong?
\begin{equation}
\label{eq: mass balance}
\sum_{i} m_{in} = \sum_{j} m_{out}
\end{equation}
This equation~\eqref{eq: mass balance} shows the mass balance of the model.
\section*{Acknowledgements}
\addcontentsline{toc}{section}{Acknowledgements}%
Who would you like to thank?
\addcontentsline{toc}{section}{References}
\printbibliography
\end{document}
решение1
Дополнительную закладку можно сделать \pdfbookmark
:
\pdfbookmark[1]{My Title}{title}
Ссылка, включающая "уравнение", более хитрая, потому что \autoref
не помещает число в скобки. Вручную это можно сделать так:
\hyperref[eq: mass balance]{equation~(\ref*{eq: mass balance})}
Форма «звезда» \ref
устанавливает ссылку без ссылки, поскольку ссылка уже установлена \hyperref
.
Полный пример:
\documentclass[a4paper, 10pt]{article}
\usepackage{amsmath}
\usepackage[bookmarksnumbered, pdftitle={A PDF Title?}]{hyperref}
\hypersetup{colorlinks=true, citecolor=cyan}
\usepackage{bookmark}% faster updated boomkarks
\newcommand*{\myeqref}[2][equation]{%
\hyperref[{#2}]{#1~(\ref*{#2})}%
}
\begin{document}
\pdfbookmark[1]{My Title}{title}% "1" = section level
\section{Introduction}
This is an example for illustrating the use Hyperref package.
\section{Problem Statement}
What is wrong?
\begin{equation}
\label{eq: mass balance}
\sum_{i} m_{in} = \sum_{j} m_{out}
\end{equation}
This \myeqref{eq: mass balance} shows the mass balance of the model.
\section*{Acknowledgements}
\addcontentsline{toc}{section}{Acknowledgements}%
Who would you like to thank?
\end{document}
Закладки:
Перемещаем цель для заголовка ближе к заголовку:
Команда закладки должна быть скрыта внутри \maketitle
. Это зависит от используемого класса, пакетов, определения \maketitle
, куда поместить закладку, чтобы приблизить цель к заголовку. В классе article
аргумент заголовка начинается в вертикальном режиме, поэтому закладку можно поместить здесь:
\title{%
\pdfbookmark[1]{My Title}{title}%
My Title%
}
...
\maketitle
решение2
Это bookmark
только часть вопроса...
Дополнения к закладкам можно сделать \pdfbookmark
, например, с помощью .
Соответствующий уровень должен быть указан, здесь с article
классом уровень 0
уместен, если закладка заголовка должна быть выровнена с остальным, используйте уровень 1
тогда. Здесь я сделал решение с 0
однако.
\pdfbookmark[0]{bookmarkentry}{label}
Метка представляет собой некий ссылочный знак, приведенный, \title{}
например, в.
\documentclass[a4paper, 10pt]{article}
\usepackage{amsmath}
\usepackage[backend=biber, style=numeric]{biblatex}
\newcommand{\mydocumenttitle}{A PDF title}
\usepackage[bookmarksopen=true,bookmarksnumbered, pdftitle={\mydocumenttitle}]{hyperref}
\hypersetup{colorlinks=true, citecolor=cyan}
\begin{filecontents*}{\jobname.bib}
@article{Azeez2013,
author = {Azeez, O. S. and Isafiade, A. J. and Fraser, D. M.},
title = {Supply-based superstructure synthesis of heat and mass exchange networks},
journal = {Computers \& Chemical Engineering},
volume = {56},
number = {7},
pages = {184--201},
year = {2013}
}
\end{filecontents*}
\addbibresource{\jobname}
\author{A. U. Thor}
\title{\hypertarget{title:link}{\mydocumenttitle}}
\begin{document}
\maketitle
\pdfbookmark[0]{A PDF title}{title:link}
\clearpage
\section{Introduction}
This is an example for illustrating the use Hyperref package~\cite{Azeez2013}.
\section{Problem Statement}
What is wrong?
\begin{equation}
\sum_{i} m_{in} = \sum_{j} m_{out}\label{eq: mass balance}
\end{equation}
This equation~\eqref{eq: mass balance} shows the mass balance of the model.
\section*{Acknowledgements}
\addcontentsline{toc}{section}{Acknowledgements}%
Who would you like to thank?
\addcontentsline{toc}{section}{References}
\printbibliography
\end{document}