在自訂文件類別中使用 Minted 進行語法突出顯示時出錯

在自訂文件類別中使用 Minted 進行語法突出顯示時出錯

我正在用 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}

有什麼想法要做什麼嗎?我是乳膠新手。我什至沒有找到這個錯誤所在的文件。

答案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它也會起作用;-)

相關內容