latex sty文件缺失问题 [转载]

原文出处

安装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/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/drop.tss

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/frame.tss

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/leftmargin.tss

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/margin.tss

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/rightmargin.tss

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/titleps.pdf

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/titleps.sty

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/titleps.tex

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/titlesec.pdf

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/titlesec.sty

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/titlesec.tex

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/titletoc.sty

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/ttlkeys.def

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/ttlps.def

/usr/local/texlive/2016basic/texmf-dist/tex/latex/titlesec/wrap.tss

/usr/local/texlive/2016basic/tlpkg/tlpobj/titlesec.tlpobj

卸载sty文件

sudo tlmgr remove --force xxxx

示例

sudo tlmgr remove --force biblatex

反馈结果:

tlmgr: removing package biblatex

tlmgr: ultimately removed these packages: biblatex

tlmgr: package log updated: /usr/local/texlive/2016basic/texmf-var/web2c/tlmgr.log

running mktexlsr ...

done running mktexlsr.

寻找文件

tlmgr search --file biblatex

如果已经安装过biblatex,结果如下

texmf-dist/bibtex/bib/biblatex/biblatex/biblatex-examples.bib

    texmf-dist/bibtex/bib/biblatex/biblatex/biblatex-examples.bltxml

    texmf-dist/bibtex/bst/biblatex/biblatex.bst

    texmf-dist/tex/latex/biblatex/bbx/alphabetic-verb.bbx

    texmf-dist/tex/latex/biblatex/bbx/alphabetic.bbx

    texmf-dist/tex/latex/biblatex/bbx/authortitle-comp.bbx

    texmf-dist/tex/latex/biblatex/bbx/authortitle-ibid.bbx

    texmf-dist/tex/latex/biblatex/bbx/authortitle-icomp.bbx

    texmf-dist/tex/latex/biblatex/bbx/authortitle-tcomp.bbx

    texmf-dist/tex/latex/biblatex/bbx/authortitle-terse.bbx

    texmf-dist/tex/latex/biblatex/bbx/authortitle-ticomp.bbx

    texmf-dist/tex/latex/biblatex/bbx/authortitle.bbx

    texmf-dist/tex/latex/biblatex/bbx/authoryear-comp.bbx

    texmf-dist/tex/latex/biblatex/bbx/authoryear-ibid.bbx

    texmf-dist/tex/latex/biblatex/bbx/authoryear-icomp.bbx

    texmf-dist/tex/latex/biblatex/bbx/authoryear.bbx

    texmf-dist/tex/latex/biblatex/bbx/debug.bbx

    texmf-dist/tex/latex/biblatex/bbx/draft.bbx

    texmf-dist/tex/latex/biblatex/bbx/numeric-comp.bbx

    texmf-dist/tex/latex/biblatex/bbx/numeric-verb.bbx

    texmf-dist/tex/latex/biblatex/bbx/numeric.bbx

    texmf-dist/tex/latex/biblatex/bbx/reading.bbx

    texmf-dist/tex/latex/biblatex/bbx/standard.bbx

    texmf-dist/tex/latex/biblatex/bbx/verbose-ibid.bbx

    texmf-dist/tex/latex/biblatex/bbx/verbose-inote.bbx

    texmf-dist/tex/latex/biblatex/bbx/verbose-note.bbx

    texmf-dist/tex/latex/biblatex/bbx/verbose-trad1.bbx

    texmf-dist/tex/latex/biblatex/bbx/verbose-trad2.bbx

    texmf-dist/tex/latex/biblatex/bbx/verbose-trad3.bbx

    texmf-dist/tex/latex/biblatex/bbx/verbose.bbx

    texmf-dist/tex/latex/biblatex/biblatex.cfg

    texmf-dist/tex/latex/biblatex/biblatex.def

    texmf-dist/tex/latex/biblatex/biblatex.sty

    texmf-dist/tex/latex/biblatex/blx-bibtex.def

    texmf-dist/tex/latex/biblatex/blx-compat.def

    texmf-dist/tex/latex/biblatex/blx-dm.def

    texmf-dist/tex/latex/biblatex/blx-mcite.def

    texmf-dist/tex/latex/biblatex/blx-natbib.def

    texmf-dist/tex/latex/biblatex/cbx/alphabetic-verb.cbx

    texmf-dist/tex/latex/biblatex/cbx/alphabetic.cbx

    texmf-dist/tex/latex/biblatex/cbx/authortitle-comp.cbx

    texmf-dist/tex/latex/biblatex/cbx/authortitle-ibid.cbx

    texmf-dist/tex/latex/biblatex/cbx/authortitle-icomp.cbx

    texmf-dist/tex/latex/biblatex/cbx/authortitle-tcomp.cbx

    texmf-dist/tex/latex/biblatex/cbx/authortitle-terse.cbx

    texmf-dist/tex/latex/biblatex/cbx/authortitle-ticomp.cbx

    texmf-dist/tex/latex/biblatex/cbx/authortitle.cbx

    texmf-dist/tex/latex/biblatex/cbx/authoryear-comp.cbx

    texmf-dist/tex/latex/biblatex/cbx/authoryear-ibid.cbx

    texmf-dist/tex/latex/biblatex/cbx/authoryear-icomp.cbx

    texmf-dist/tex/latex/biblatex/cbx/authoryear.cbx

    texmf-dist/tex/latex/biblatex/cbx/debug.cbx

    texmf-dist/tex/latex/biblatex/cbx/draft.cbx

    texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx

    texmf-dist/tex/latex/biblatex/cbx/numeric-verb.cbx

    texmf-dist/tex/latex/biblatex/cbx/numeric.cbx

    texmf-dist/tex/latex/biblatex/cbx/reading.cbx

    texmf-dist/tex/latex/biblatex/cbx/verbose-ibid.cbx

    texmf-dist/tex/latex/biblatex/cbx/verbose-inote.cbx

    texmf-dist/tex/latex/biblatex/cbx/verbose-note.cbx

    texmf-dist/tex/latex/biblatex/cbx/verbose-trad1.cbx

    texmf-dist/tex/latex/biblatex/cbx/verbose-trad2.cbx

    texmf-dist/tex/latex/biblatex/cbx/verbose-trad3.cbx

    texmf-dist/tex/latex/biblatex/cbx/verbose.cbx

    texmf-dist/tex/latex/biblatex/lbx/UKenglish.lbx

    texmf-dist/tex/latex/biblatex/lbx/USenglish.lbx

    texmf-dist/tex/latex/biblatex/lbx/american.lbx

    texmf-dist/tex/latex/biblatex/lbx/australian.lbx

    texmf-dist/tex/latex/biblatex/lbx/austrian.lbx

    texmf-dist/tex/latex/biblatex/lbx/brazil.lbx

    texmf-dist/tex/latex/biblatex/lbx/brazilian.lbx

    texmf-dist/tex/latex/biblatex/lbx/british.lbx

    texmf-dist/tex/latex/biblatex/lbx/canadian.lbx

    texmf-dist/tex/latex/biblatex/lbx/catalan.lbx

    texmf-dist/tex/latex/biblatex/lbx/croatian.lbx

    texmf-dist/tex/latex/biblatex/lbx/czech.lbx

    texmf-dist/tex/latex/biblatex/lbx/danish.lbx

    texmf-dist/tex/latex/biblatex/lbx/dutch.lbx

    texmf-dist/tex/latex/biblatex/lbx/english.lbx

    texmf-dist/tex/latex/biblatex/lbx/finnish.lbx

    texmf-dist/tex/latex/biblatex/lbx/french.lbx

    texmf-dist/tex/latex/biblatex/lbx/german.lbx

    texmf-dist/tex/latex/biblatex/lbx/greek.lbx

    texmf-dist/tex/latex/biblatex/lbx/icelandic.lbx

    texmf-dist/tex/latex/biblatex/lbx/italian.lbx

    texmf-dist/tex/latex/biblatex/lbx/naustrian.lbx

    texmf-dist/tex/latex/biblatex/lbx/newzealand.lbx

    texmf-dist/tex/latex/biblatex/lbx/ngerman.lbx

    texmf-dist/tex/latex/biblatex/lbx/norsk.lbx

    texmf-dist/tex/latex/biblatex/lbx/norwegian.lbx

    texmf-dist/tex/latex/biblatex/lbx/nynorsk.lbx

    texmf-dist/tex/latex/biblatex/lbx/polish.lbx

    texmf-dist/tex/latex/biblatex/lbx/portuges.lbx

    texmf-dist/tex/latex/biblatex/lbx/portuguese.lbx

    texmf-dist/tex/latex/biblatex/lbx/russian.lbx

    texmf-dist/tex/latex/biblatex/lbx/slovak.lbx

    texmf-dist/tex/latex/biblatex/lbx/slovene.lbx

    texmf-dist/tex/latex/biblatex/lbx/spanish.lbx

    texmf-dist/tex/latex/biblatex/lbx/swedish.lbx

更新

sudo tlmgr update --all


来源:CSDN

原文

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 215,874评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,102评论 3 391
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 161,676评论 0 351
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,911评论 1 290
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,937评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,935评论 1 295
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,860评论 3 416
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,660评论 0 271
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,113评论 1 308
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,363评论 2 331
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,506评论 1 346
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,238评论 5 341
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,861评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,486评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,674评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,513评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,426评论 2 352

推荐阅读更多精彩内容