在源文件的最后一个\usepackage{}后面加入:
% generate pdf files with hyperlink, remember to usepackage{hyperref} after any pachages
\def\a{true}
\def\useyap{true}% if using dvi->ps->pdf, set \useyap to true, or set to false if using dvi->pdf
\ifx\a\useyap
\usepackage[dvipdf,
CJKbookmarks=true,
bookmarksnumbered=true,
bookmarksopen=true,
colorlinks=true,
citecolor=blue,
linkcolor=red,
anchorcolor=green,
urlcolor=blue
]{hyperref}
\else
\usepackage[dvipdfm,
CJKbookmarks=true,
bookmarksnumbered=true,
bookmarksopen=true,
colorlinks=true,
citecolor=blue,
linkcolor=red,
anchorcolor=green,
urlcolor=blue
]{hyperref}
\AtBeginDvi{\special{pdf:tounicode GBK-EUC-UCS2}} % GBK -> Unicode
\fi
如果用dvi->ps->pdf方法生成pdf,直接用上面的代码,如果用dvi->pdf方法生成pdf,需要将上面代码第二行的true改为false,上面代码注释里都有写。
No comments:
Post a Comment