
hyperref パッケージを使用して PDF ブックマークに PDF タイトルを追加したいのですが、うまくいきません。
写真のように、「はじめに」の上にタイトルを追加したいと思います。
さらに、上の図のように、赤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}