
버그 unicode-math
인가요 ?hyperref
LuaLaTeX
% !TeX program = lualatex
% !TeX encoding = utf8
\documentclass[14pt]{extarticle}
\usepackage{fontspec}
\usepackage{amsmath}
\setsansfont{CMU Sans Serif}
\setmainfont{CMU Serif}
\setmonofont{CMU Typewriter Text}
\usepackage{unicode-math} % this one DOES NOT cause error without hyperref
\usepackage[english]{babel}
\usepackage{hyperref} % this one DOES NOT cause error without unicode-math
\begin{document}
\section{title $\alpha$}
\end{document}
오류가 발생했습니다.
잘못된 알파벳 상수입니다. \섹션{제목 $\알파$}
답변1
북마크에는 간단한 텍스트만 포함될 수 있습니다. 이는 hyperref가 LaTeX 입력을 거기에서 의미 있는 것으로 변환해야 함을 의미합니다. 이를 위해 문제가 있는 콘텐츠를 삭제하거나 교체하는 경우가 많습니다. 일반적으로 hyperref는 최소한 이 프로세스에서 오류를 방지하는 데 매우 좋지만 char에 허용된 명령을 처리할 수는 없습니다.https://github.com/latex3/hyperref/issues/63. 그리고 슬프게도 유니코드 수학은 여러 곳에서 이 작업을 수행합니다.
\texorpdfstring
를 사용하여 대안으로 하이퍼참조를 제공 할 수 있습니다 . 예를 들어 직접 유니코드 문자 U+1D6FC는 대부분의 PDF 리더에서 작동합니다. 직접 입력하거나 다음 표기법을 사용하여 입력할 수 있습니다 ^^
.
\documentclass[14pt]{extarticle}
\usepackage{fontspec}
\usepackage{amsmath}
\setsansfont{CMU Sans Serif}
\setmainfont{CMU Serif}
\setmonofont{CMU Typewriter Text}
\usepackage{unicode-math} %
\usepackage[english]{babel}
\usepackage{hyperref} %
\begin{document}
\section{title \texorpdfstring{$\alpha$}{
답변2
PDF 책갈피를 지정하는 방식에서 기본적인 단점이 발생했다고 생각합니다 unicode-math
.hyperref
그 자체로.
\texorpdfstring
이 단점을 해결하기 위해 장치를 사용할 수 있습니다 . 예를 들어 LuaLaTeX에서는
\section{title \texorpdfstring{$\alpha$}{$\symit{alpha}$}}
결과는 다음과 같습니다 title alpha
(참고:~ 아니다 title α
)가 북마크에 표시됩니다.
곁에: x03B1
유니코드 테이블의 슬롯이 α를 가리키고 CMU Serif 글꼴이 해당 슬롯에 올바른 기호를 가지고 있더라도
\section{title \texorpdfstring{$\alpha$}{\symbol{"03B1}}}
이제 북마크에 표시된 대로 전혀 작동하지 않습니다 title "03B1
. 확실히 에 비해 만족도가 훨씬 떨어지죠 title alpha
? (이것이 내가 북마크를 형성하는 방식에 근본적인 문제가 있다는 점을 미리 밝힌 이유이기도 합니다.)
이 이야기의 교훈은 무엇입니까? 아마도 PDF 북마크로 표시되는 명령 인수에 수학 모드 그리스 문자를 사용하지 않아야 할 수도 있습니다.