安装style文件
方法一:自动安装
terminal中
sudo tlmgr install xxxx
方法二:半自动安装
如果压缩包中没有sty文件,可以先用latex命令编译一下
sudo latex packagename.ins
注意,要在.ins的目录下,否则找不到该文件,然后一路回车,就会发现编译出一些.sty文件或者其他更多文件,下一步就是方法三种的步骤了
sudo texhash
sudo mktexlsr
方法三:手动安装
将.sty文件拷贝到
/usr/local/texlive/2016basic/texmf-dist/tex/latex/packagename
然后利用命令告诉系统
sudo texhash
sudo mktexlsr
安装完宏包之后,texhash、mktexlsr
等工作都做了,但是还是提示找不到宏包,我几乎每次都会遇到这个问题,偶然发现,把.tex文档的内容继续编辑一下,然后保存,再编译,就ok啦
查看宏包信息
sudo tlmgr info xxxx
或者sudo tlmgr show xxxx
其中xxxx就是想要查看的宏包名
示例
sudo tlmgr info titlesec
如果已经安装了titlese宏包,反馈结果如下
tlmgr: package repository http://ctan.math.washington.edu/tex-archive/systems/texlive/tlnet (not verified: gnupg not available)
package: titlesec
category: Package
shortdesc: Select alternative section titles
longdesc: A package providing an interface to sectioning commands for selection from various title styles. E.g., marginal titles and to change the font of all headings with a single command, also providing simple one-step page styles. Also includes a package to change the page styles when there are floats in a page. You may assign headers/footers to individual floats, too.
installed: Yes
revision: 40129
sizes: run: 121k
relocatable: No
cat-version: 2.10.2
cat-date: 2016-03-21 21:28:19 +0100
cat-license: lppl
cat-topics: headings page-hf
cat-related: fancyhdr titleps sectsty titletoc tocloft
collection: collection-latexextra
宏包定位
locate xxxx
比如locate titlesec
反馈结果如下:
/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec
/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/CHANGES
/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/README
/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/block.tss
/usr/