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

看板LaTeX作者 (深淵戰士)時間1年前 (2022/12/30 21:10), 編輯推噓0(001)
留言1則, 1人參與, 2年前最新討論串1/1
我要將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 } 但好像沒有效果,完全無法顯示 請問可能是哪裡寫錯了或是少了什麼嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 27.247.1.120 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/LaTeX/M.1672405823.A.F65.html

01/19 13:04, 2年前 , 1F
貼出可重覆問題的完整原始碼吧
01/19 13:04, 1F
文章代碼(AID): #1ZhkC_zb (LaTeX)