
這個最小的範例會產生錯誤(未定義的控制序列):
% !TEX TS-program = pdflatexmk
\documentclass{article}
\usepackage{tikz}
\usepackage{preview}
\begin{document}
Hello.
\end{document}
一旦刪除 tikz 包,它就可以正常編譯。刪除任一 usepackage 指令都允許程式編譯。此外,包括兩者,但添加 [active] 選項來預覽允許腳本編譯。
我已經貼上了日誌文件這裡。
答案1
Ulrike Fischer 指出這是目前列出的錯誤報告這裡和這裡。我提供了一個簡短的指南,以便保留建議的解決方案。
在命令列上運行kpsewhich pgfutil-latex.def
以檢測 def 檔案的位置。搜尋解決預覽包的 \AtBeginDocument 命令。將先前的程式碼區塊更改為以下內容:
\AtBeginDocument{
\@ifpackageloaded{preview}{%
% Ok, package loaded. Swap definitions of everyshi.sty's shipout
% and preview.sty's shipout:
\ifPreview
\let\shipout\@EveryShipout@Org@Shipout%This is the null version of \shipout, created by preview and saved by everyshi
\let\@EveryShipout@Org@Shipout\pr@shipout% This is the original shipout
\let\pr@shipout\@EveryShipout@Shipout%
\fi
}{}%
}