XeLaTeX 中的 pdfcomments 和 Unicode 字符存在问题

XeLaTeX 中的 pdfcomments 和 Unicode 字符存在问题

我正在尝试pdfcomment在 XeLaTeX 中使用该包。我似乎无法在 中正确使用 Unicode 字符(例如捷克语ň或 )。通常,注释的任何此类尾随字符都会消失。这是一个最小示例:ě\pdfmarkupcomment

\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{czech}
\usepackage{pdfcomment}
\hypersetup{unicode}
\begin{document}
Běžně. Běžně.

\pdfmarkupcomment{Běžně}{}. Běžně. % This would be typeset as "Běžn. Běžně" leaving out "ě"
\end{document}

pdfcomment 包文档说:

在内部,参数⟨comment⟩需要转换为PDFDocEncoding/PDFUnicode。

然后它只是\hypersetup{unicode}在脚注中说了这一点,这就是我在 LaTeX 文档中放的内容,但它似乎并没有解决问题。(我不知道“需要转换为 PDFDocEncoding/PDFUnicode”是什么意思。)

或者,如果有不同的方法来突出显示文本的任意部分(即不在其周围创建一个框),并且可以与 Unicode 配合使用,我会很乐意使用它。

答案1

在评论中,egreg 暗示,我发现

它似乎soul试图通过在字体中排版原型来分析您的字符串\SOUL@tt。 如果该字体中缺少最后几个字符,soul则会发现它只是构建了一个零宽度框。 然后它认为当前字符串已完成并停止工作。

\documentclass{article}
\usepackage{fontspec,pdfcomment}
\begin{document}

\ulposdef{\uline}{\rule[-.8ex]{\ulwidth}{.5pt}}

\uline{Běžně}
\pdfmarkupcomment{Běžně}{}. Běžně. % This would be typeset as "Běžn. Běžně" leaving out "ě"
%leaving out "ě"

\makeatletter
\let\SOUL@tt\ttfamily
\makeatother

\uline{Běžně}
\pdfmarkupcomment{Běžně}{}. Běžně. % This would be typeset as "Běžn. Běžně" leaving out "ě"
%leaving out "ě"

\end{document}

相关内容