最近投一个会议,最新版模板中需要用到siunitx包,但是编译过程中显示找不到siunitx。
有的网页建议下载sty文件放到\texlive\2022\texmf-dist\tex\latex\siunitx路径中,但是CTAN网站只能找到siunitx文件夹,并不包括sty文件。
先尝试了https://blog.csdn.net/xiaotongApril/article/details/120026871,下载这个包的文件夹然后输入texhash对数据库进行刷新,发现没有用,文件夹中没有任何文件的变化。
尝试https://wap.sciencenet.cn/blog-2089193-1349242.html更新texlive的宏包,更新了很多包,但是没有包括这个siunitx。还是不行。
偶然在网页上看到ins文件可以编译生成sty文件,而检查发现siunitx文件夹中确实有ins文件,因此尝试编译这个ins。直接在siunitx文件夹中shift+右键打开Powershell,输入编译指令:
latex siunitx.ins
可以看到有很多东西写入了这个siunitx.sty文件
再运行
texhash
然后再看texstudio中的提示,终于找到这个siunitx包了
成功了。
解决方法总结:
在ctan中下载包:https://ctan.org/pkg/siunitx?lang=en
解压将整个siunitx文件夹放入texlive\2022\texmf-dist\tex\latex
在texlive\2022\texmf-dist\tex\latex\siunitx文件夹中编译siunitx.ins文件得到siunitx.sty,powershell中运行latex siunitx.ins
更新数据库,powershell中运行texhash