問題

問題

問題

跨文件超連結總是將我帶到另一個文件的第一頁,而我希望連結將我帶到目標文件中的確切標籤位置(或文字)。

複製步驟

環境:

  1. TeX 版本:版本 3.141592653 (TeX Live 2022/Debian)
  2. 作業系統:Linux發行版、Debian 12 bookworm x86_64。

開始:

假設我有一個one.tex帶有超連結標籤/目標的檔案:

Links to label
{\catcode`\#=11
 \special{html:<a href="#one">}one\special{html:</a>}}
{\catcode`\#=11
 \special{html:<a href="#two">}two\special{html:</a>}}
{\catcode`\#=11
 \special{html:<a href="#three">}three\special{html:</a>}}

Label
{\catcode`\#=11
 \special{html:<a name="one">}one\special{html:</a>}}

\vfil \break
Label
{\catcode`\#=11
 \special{html:<a name="two">}two\special{html:</a>}}

\vfil \break
Label
{\catcode`\#=11
 \special{html:<a name="three">}three\special{html:</a>}}

\bye

$ tex one.tex; dvipdfm one.dvi用or編譯後$ xetex one.tex,我用mupdf one.pdf.頂部的文件內連結工作正常。

現在,假設我想從另一個文件連結到這些標籤two.tex

Link to label
{\catcode`\#=11
 \special{html:<a href="one.pdf#one">}one\special{html:</a>}}
{\catcode`\#=11
 \special{html:<a href="one.pdf#two">}two\special{html:</a>}}
{\catcode`\#=11
 \special{html:<a href="one.pdf#three">}three\special{html:</a>}}

\bye

使用與上述相同的過程進行編譯並在 中打開它後mupdf,單擊連結總是會將我帶到 的第一頁one.pdf。我希望連結二能將我帶到 的第 2 頁/標籤 2 one.pdf。連結三也是如此。 (文件間連結失敗)

有沒有辦法在 Plain TeX 中實現我的目標?或者我必須求助於某些特定的 PDF 擴充功能?謝謝!

非解決方案

我已閱讀這些內容,但它們並不能解決此問題:

  1. 純 TeX 中的超鏈接
  2. Plain TeX 以及 dvi 和 pdf 中的不同超連結樣式

乳膠:

  1. 能否提供不同 PDF 中位置的超連結?
  2. 建立指向另一個 pdf 檔案的特定頁面的鏈接

相關內容