eplain url 和 pgf(math) 之間的衝突

eplain url 和 pgf(math) 之間的衝突

我嘗試使用 xetex 和 eplain 插入超鏈接,結果如下。

\input eplain
\enablehyperlinks
\input pgfmath
\href{http://www.google.com}{google}

\bye

在日誌檔案中列印這個奇怪的錯誤:

! Undefined control sequence.
\color ...gfsysprotocol@bufferedtrue \pgfsetcolor 
                                                  {.}\expandafter \pgfsys@ou...

\temp ->\color [
                cmyk]{0.28,1,1,0.35}
\after@hl@getparam ...]{\hl@opt@color }}\fi \temp 
                                                  \fi \fi \hl@driver 
\@hl@getparam ...\@hllabel {#1}\after@hl@getparam 
                                                  \ignorespaces 
\@@href ...f@end@ext \hlstart@impl {hrefext}{#1#2}
                                                  \fi \@@@href 
l.4 \href{http://www.google.com}
                                {google}

使用“正常”pgf,

\input eplain
\enablehyperlinks
\input pgf
\href{http://www.google.com}{google}

\bye

該文檔編譯時出現此錯誤:

Package pgfbase: Error! Unsupported color model `'. Sorry.

並寫了一個奇怪的pdf文件

在此輸入影像描述

(如果我在 eplain 之前加載 pgf,也會發生同樣的情況)

答案1

pgfmath載入pgfplain-util.def想要模擬的內容xcolor,但如果未載入整個 PGF,則無法真正執行此操作。

您可以調整我的解決方案\usepackage{color} 和 \input tikz 可以在 Plain TeX/eplain 中一起工作嗎?透過將顏色控制權交還給包裝color

\input eplain
\beginpackages
  \usepackage{url}
  \usepackage{color}
\endpackages

\let\eplaincolor\color
\let\eplaindefinecolor\definecolor
\input pgfmath
\let\color\eplaincolor
\let\definecolor\eplaindefinecolor

\enablehyperlinks
\definecolor{urlcolor}{rgb}{.2,.4,.6}
\hlopts{colormodel=,color=urlcolor}

\href{http://www.google.com}{google}

\url{http://tex.stackexchange.com}
\bye

在此輸入影像描述

相關內容