
我有一個生成的 LaTeX(python 腳本,從不同來源獲取資料)文檔,然後使用 pdfLaTeX 將其編譯為 pdf。
一般文檔的結構如下
\documentclass[a4paper]{article}
\usepackage{color}
\usepackage{colortbl}
\usepackage{graphicx}
\usepackage{mathrsfs}
\usepackage{array}
\usepackage{booktabs}
\usepackage{times}
\usepackage{natbib}
\usepackage{longtable}
\usepackage[table]{xcolor}
\usepackage{pdflscape}
\usepackage{fancybox}
\usepackage[
pdftex,
a4paper,
colorlinks=false,
urlcolor=red,
linkcolor=blue,
bookmarks=true,
bookmarksopen=true,
bookmarksopenlevel=2,
bookmarksnumbered=false,
pdfpagemode=UseOutlines
]{hyperref}
% imported from stylesheet
\begin{document}
...
\tableofcontents
...
\section{Section A}
\subsection{Subsection 1}
Generated Text
Generated Plots ...
\includegraphics[width=1.0\textwidth]{...}
\begin{minipage}[c]{0.30\textwidth}
...
\end{minipage}
\end{document}
直到最近,文檔中的超連結都運作得很好。現在它們在 pdf 中可見(Acrobat Reader 中的紅色框),但單擊它們沒有效果(不會跳到正確的部分)。
我用不同的 pdf 檢視器和作業系統進行了嘗試。
有趣的是 evince 有控制台輸出
$ evince test.pdf
Error: Invalid page tree
Error: Invalid page tree
Error: Invalid page tree
Error: Invalid page tree
Error: Invalid page tree
...
failed to look up section.1
failed to look up subsection.1.1
failed to look up subsection.1.2
failed to look up section.2
...
\hyperref
外部來源 (url) 的 s 仍然有效。
您通常如何調試類似的事情? pdfLaTeX 問題?乳膠問題?
編輯:
感謝您的評論。在嘗試提供一個最小的範例時,我發現了打破它的行:
\let\thefootnote\relax\footnotetext{ Some text \href{http://url.com}{Link}}
使用 .tex 檔案中的這一行,外部連結本身可以工作,但目錄中的超級引用已損壞(如上所述)。如果沒有這一行,目錄中的連結就可以正常運作。
編輯2:
\footnotetext{ Some text \href{http://url.com}{Link}}
對我有用。1
不過,腳註的一小部分應該要隱藏起來。我想就是這樣。
另一種解決方法似乎具有相同的效果(即也破壞了超連結):
\makeatletter{\renewcommand*{\@makefnmark}{}\footnotetext{For further explanation refer to \href{http://www.google.com}{Link Text}}\makeatother}