"解决 LaTeX 中 hyperref 包警告:PDF 字符串中不允许的标记 (Unicode)"\n\n本文介绍了在使用 LaTeX 中的 hyperref 包时遇到的警告:Token not allowed in a PDF string (Unicode)。该警告通常是由于使用 \kern\leavevmode@ifvmode 命令导致的。文章提供了解决方法,包括使用 \hspace 代替 \kern,以及使用 \ifvmode 代替 \leavevmode@ifvmode。\n\n问题描述\n\n在使用 LaTeX 中的 hyperref 包时,你可能会遇到以下警告:\n\nPackage hyperref Warning: Token not allowed in a PDF string (Unicode): \kern 2.00876pt removed on input line 196.\n\nPackage hyperref Warning: Token not allowed in a PDF string (Unicode): removing \leavevmode@ifvmode' on input line 196.\n\n**原因**\n\n上述问题是由于使用了 \kern\leavevmode@ifvmode命令,而这两个命令不能在 PDF 字符串中使用导致的。\n\n**解决方法**\n\n1.\kern命令:可以尝试使用\hspace命令代替\kern命令。例如,将\kern 2.00876pt替换为\hspace{2.00876pt}。\n\n2. \leavevmode@ifvmode命令:可以尝试使用\ifvmode命令代替\leavevmode@ifvmode命令。例如,将\leavevmode@ifvmode替换为\ifvmode\else\fi`。\n\n请根据具体情况进行相应的替换,然后重新编译代码。这样应该能够解决上述问题。\n\n其他注意事项\n\n- 确保你使用的是最新的 LaTeX 和 hyperref 包版本。\n- 检查你的代码中是否存在其他可能导致问题的命令或环境。\n\n希望本文能够帮助你解决 LaTeX 中 hyperref 包的警告问题。

解决 LaTeX 中 hyperref 包警告:PDF 字符串中不允许的标记 (Unicode)

原文地址: https://www.cveoy.top/t/topic/qe4N 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录