문서 제목이 나중에 설정되어 다른 명령으로 래핑되는 상황이 있습니다(언어 버전과 관련이 있음).
Hypersetup 로드 순서
hypersetup 명령에 새 제목을 넣고 싶습니다 pdftitle
. 결과는 바람직하지 않습니다. 파일의 메타데이터는 Adobe Reader에 Baluga로 표시됩니다. \hypersetup
아래에 my를 넣든 specialmacro
말든 상관은 없는 것 같습니다 .
예
\documentclass{article}
\usepackage{fontspec}
\usepackage{hyperref}
\newcommand\baluga{Baluga}
\newcommand\whale{}
\hypersetup{%
pdftitle={\baluga{} \whale{}},%
}%
\newcommand\specialmacro{
\renewcommand\whale{whale}
}
\begin{document}
\specialmacro{}
Test
\end{document}
업데이트: Wrapper를 사용하는 솔루션\hypersetup
\documentclass{article}
\usepackage{fontspec}
\usepackage{hyperref}
\newcommand\baluga{Baluga}
\newcommand\whale{}
\newcommand\hyperset{
\hypersetup{%
pdftitle={\baluga{} \whale{}},%
}%
}
\newcommand\specialmacro{
\renewcommand\whale{whale}
\hyperset
}
\begin{document}
\specialmacro{}
Test
\end{document}
답변1
새로 편집된 버전은 다음과 같습니다.
\documentclass{article}
\usepackage{fontspec}
\usepackage{hyperref}
\newcommand\baluga{Baluga}
\newcommand\whale{}
\newcommand\hyperset{\hypersetup{pdftitle={\baluga{} \whale{}},}}
\begin{document}
Test
\renewcommand\whale{whale}
\hyperset
\end{document}