[問題] listings新增關鍵字沒有效果

作者: LaAc (深淵戰士)   2022-12-30 21:10:20
我要將code寫入目錄,因為使用的語言是比較冷門的
Latex好像沒有資料庫,我也不太會定義一個新的語言
所以我想先預設language是C
然後用morekeywords增加這個語言的關鍵字
於是我這樣寫:
\usepackage{listings}
\usepackage{xcolor}
\lstset{
language={C},
%backgroundcolor=\color{red!50!green!50!blue!50},
rulesepcolor= \color{gray},
breaklines=true,
numbers=left,
numberstyle= \small,
keywordstyle= \color{red},
morekeywords={projectile, element, mass, energy},
commentstyle=\color{gray},
frame=shadowbox
}
但好像沒有效果,完全無法顯示
請問可能是哪裡寫錯了或是少了什麼嗎?
作者: andrew43 (討厭有好心推文後刪文者)   2021-01-19 13:04:00
貼出可重覆問題的完整原始碼吧

Links booklink

Contact Us: admin [ a t ] ucptt.com