代码之家  ›  专栏  ›  技术社区  ›  Yorgos

分区命令中包含\%时出错

  •  1
  • Yorgos  · 技术社区  · 12 年前

    当我尝试输入 \% 在一个 \subsection 的标题和 Compile pdf ,我得到以下错误:

    File ended while scanning use of \@@BOOKMARK.

    我该怎么做?

    编辑

    这是一个可重复的例子。该文件以UTF-8格式编码。

    \documentclass[a4paper]{article}
    
    
    \usepackage{fontspec}
    \usepackage{hyperref}
    \usepackage{longtable}
    \usepackage{rotating}
    \usepackage{tabularx}
    \usepackage{lscape}
    \usepackage[normalem]{ulem}
    
    
    \setmainfont[Scale=1.0]{Times New Roman} 
    \setsansfont{Times New Roman}
    
    
    \begin{document}
    
    \section{Μέσες τιμές και 95\% Διαστήματα Εμπιστοσύνης}
    
    \subsection{a \% b cd}
    
    <<>>=
    1+1
    @
    
    \end{document}
    
    1 回复  |  直到 12 年前
        1
  •  3
  •   Yihui Xie    12 年前

    这可能是一个配置问题 hyperref .我没有 Times New Roman ,但我成功了 xelatex (TeXLive 2012,Ubuntu 13.04)在RStudio(v0.98.312)和 knitr 使用以下配置:

    \documentclass{article}
    \usepackage{fontspec}
    \setmainfont{DejaVu Serif}
    \usepackage[unicode=true,bookmarks=true,bookmarksopen=true]{hyperref}
    \usepackage{xunicode}
    \begin{document}
    
    
    \section{Μέσες τιμές και 95\% Διαστήματα Εμπιστοσύνης}
    
    \subsection{a \% b cd}
    
    <<>>=
    1+1
    @
    
    \end{document}
    

    输出:

    percent in subsection title

    该文档采用UTF8编码。你可能需要告诉我 超参考 这个 unicode 选项