宏包已正常加载,编译也正常,但却将某些命令标记为暗红色。
具体的原因可参考
- https://sourceforge.net/p/texstudio/wiki/Frequently%20Asked%20Questions/#how-does-txs-know-about-valid-commands
- https://sourceforge.net/p/texstudio/wiki/Frequently%20Asked%20Questions/#what-are-cwl-files-good-for-and-how-do-they-work
解决方案参考install-latex-guide-zh-cn文件的“使用编译器”一章5.1.2节TeXStudio一节。
以被标记的命令为midrule
为例,这是booktabs
宏包中的命令,在
https://github.com/texstudio-org/texstudio/blob/master/completion/booktabs.cwl
这一链接中下载booktabs.cwl
文件,放在\completion\user文件夹中。
接下来的关键在于还要加载这一文件,注意在【补全(Completion)】中勾选上显示高级选项,然后就可以找到booktabs.cwl
文件了。