
我正在用 LaTeX 寫碩士論文並想使用minted
用於原始碼語法突出顯示的套件。我已經成功安裝了它,文檔中的最小示例minted
工作得很好。
問題是當我使用布拉格技術大學預先定義的文檔類別時,稱為FITthesis
.我相信這是一個Fitthesis.cls
文件(附件)。
命令後pdflatex -shell-escape MintedTest
我收到錯誤:
! Undefined control sequence.
\set@color ...\@pdfcolorstack push{\current@color
}\aftergroup \reset@color
l.8 \begin{document}
這是最小的例子:
\documentclass[thesis=M,english]{FITthesis}[2012/10/20]
\usepackage{minted}
\begin{document}
\begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
\end{minted}
\end{document}
有什麼想法要做什麼嗎?我是乳膠新手。我什至沒有找到這個錯誤所在的文件。
- 日誌檔案和檔案的連結
Fitthesis.cls
:http://cl.ly/OGSm
答案1
它運行時沒有內部顏色錯誤,只是關於未提供關鍵字和其他資料的錯誤。
\documentclass[thesis=M,english]{FITthesis}[2012/10/20]
\usepackage{color}
\usepackage{graphicx}
\makeatletter
\color{black}
\let\default@color\current@color
\makeatother
\department{ddd}
\title{ttt}
\supervisor{sss}
\author{aaa}
\authorFN{aaa}
\authorGN{aaa}
\begin{document}
aaa
\end{document}
答案2
如果你插入\RequirePackage{顏色}前\AtBeginDocument{ ... }
在課堂裡FIT論文.cls它也會起作用;-)