
Quero adicionar um título de PDF ao marcador de PDF usando o pacote hyperref. No entanto, isso não funciona.
Conforme mostrado na imagem, quero adicionar um título acima da Introdução.
Além disso, quero fazer da "equação (1)" um link como um todo, não apenas o vermelho 1, como mostra a imagem acima.
Como eu poderia conseguir isso? Muito obrigado.
Aqui está meu 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}
Responder1
O marcador adicional pode ser feito por \pdfbookmark
:
\pdfbookmark[1]{My Title}{title}
O link incluindo "equação" é mais complicado, pois \autoref
não coloca o número entre parênteses. Manualmente isso pode ser feito por:
\hyperref[eq: mass balance]{equation~(\ref*{eq: mass balance})}
A forma de estrela \ref
define uma referência sem link, porque o link já está definido por \hyperref
.
Exemplo completo:
\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}
Favoritos:
Movendo o alvo do título para mais perto do título:
O comando bookmark precisa ser contrabandeado para dentro \maketitle
. Depende da classe usada, dos pacotes, da definição de \maketitle
onde colocar o bookmark, para aproximar o alvo do título. Na classe article
, o argumento do título começa no modo vertical, portanto o marcador pode ser colocado aqui:
\title{%
\pdfbookmark[1]{My Title}{title}%
My Title%
}
...
\maketitle
Responder2
Esta é bookmark
apenas a parte da questão...
Adições aos marcadores podem ser feitas com \pdfbookmark
, por exemplo.
O nível relevante deve ser fornecido, aqui o article
nível da turma 0
é apropriado, se o marcador do título estiver alinhado com o restante, use o nível 1
então. Aqui eu fiz a solução, 0
no entanto.
\pdfbookmark[0]{bookmarkentry}{label}
O rótulo é uma marca de link, fornecida \title{}
por exemplo.
\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}