在 texlive 上安装 subcaption 包时出现问题

在 texlive 上安装 subcaption 包时出现问题

我正在尝试在 Ubuntu 11.10 上安装的 TexLive 上安装 subcaption 包。当尝试构建 subcaption.sty 时,我发现我需要先下载或构建几个依赖项:

diagbox.sty
epic.sty
footmisc.sty
overpic.sty
pict2e.sty

将这些文件放在与 subcaption.dtx 相同的目录中后,我尝试构建 subcaption.sty,结果如下:

$ latex subcaption.dtx 
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
(./subcaption.dtx
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(/usr/share/texmf-texlive/tex/latex/base/ltxdoc.cls
Document Class: ltxdoc 2007/11/11 v2.0u Standard LaTeX documentation class
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/base/doc.sty
(/usr/share/texmf-texlive/tex/latex/tools/multicol.sty)))
(/usr/share/texmf-texlive/tex/generic/oberdiek/ifpdf.sty) (./footmisc.sty)
(/usr/share/texmf-texlive/tex/latex/tools/array.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty
(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)
(/etc/texmf/tex/latex/config/graphics.cfg)
(/usr/share/texmf-texlive/tex/latex/graphics/dvips.def))) (./overpic.sty
Package: overpic v0.53 <2010/09/13> (RN)
(./epic.sty
Enhancements to Picture Environment. Version 1.2 - Released June 1, 1986
)
overpic: relative positioning in percent
) (./pict2e.sty (./p2e-dvips.def)) (./diagbox.sty
(/usr/share/texmf-texlive/tex/latex/fp/fp.sty
`Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich
(/usr/share/texmf-texlive/tex/latex/fp/defpattern.sty)
(/usr/share/texmf-texlive/tex/latex/fp/fp-basic.sty)
(/usr/share/texmf-texlive/tex/latex/fp/fp-addons.sty)
(/usr/share/texmf-texlive/tex/latex/fp/fp-snap.sty)
(/usr/share/texmf-texlive/tex/latex/fp/fp-exp.sty)
(/usr/share/texmf-texlive/tex/latex/fp/fp-trigo.sty)
(/usr/share/texmf-texlive/tex/latex/fp/fp-pas.sty)
(/usr/share/texmf-texlive/tex/latex/fp/fp-random.sty)
(/usr/share/texmf-texlive/tex/latex/fp/fp-eqn.sty)
(/usr/share/texmf-texlive/tex/latex/fp/fp-upn.sty)
(/usr/share/texmf-texlive/tex/latex/fp/fp-eval.sty)))
(/usr/share/texmf-texlive/tex/latex/oberdiek/hypdoc.sty
(/usr/share/texmf-texlive/tex/latex/hyperref/hyperref.sty
(/usr/share/texmf-texlive/tex/generic/oberdiek/ifvtex.sty)
(/usr/share/texmf-texlive/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texmf-texlive/tex/latex/oberdiek/hycolor.sty
(/usr/share/texmf-texlive/tex/latex/oberdiek/xcolor-patch.sty))
(/usr/share/texmf-texlive/tex/latex/hyperref/pd1enc.def)
(/usr/share/texmf-texlive/tex/generic/oberdiek/etexcmds.sty
(/usr/share/texmf-texlive/tex/generic/oberdiek/infwarerr.sty))
(/etc/texmf/tex/latex/config/hyperref.cfg)
(/usr/share/texmf-texlive/tex/latex/oberdiek/kvoptions.sty
(/usr/share/texmf-texlive/tex/generic/oberdiek/kvsetkeys.sty))
Implicit mode ON; LaTeX internals redefined
(/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty)
(/usr/share/texmf-texlive/tex/generic/oberdiek/bitset.sty
(/usr/share/texmf-texlive/tex/generic/oberdiek/intcalc.sty)
(/usr/share/texmf-texlive/tex/generic/oberdiek/bigintcalc.sty
(/usr/share/texmf-texlive/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texmf-texlive/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texmf-texlive/tex/generic/oberdiek/ltxcmds.sty))))
(/usr/share/texmf-texlive/tex/generic/oberdiek/atbegshi.sty))
*hyperref using default driver hdvips*
(/usr/share/texmf-texlive/tex/latex/hyperref/hdvips.def
(/usr/share/texmf-texlive/tex/latex/hyperref/pdfmark.def

Package hyperref Warning: You have enabled option `breaklinks'.
(hyperref)                But driver `hdvips.def' does not suppport this.
(hyperref)                Expect trouble with the link areas of broken links.

)) (/usr/share/texmf-texlive/tex/generic/thumbpdf/thumbpdf.sty

Package thumbpdf Warning: Missing driver name.

)) (/usr/share/texmf-texlive/tex/latex/caption/subcaption.sty

! Package subcaption Error: `caption' package not loaded
(subcaption)                (which is needed by this package)

See the subcaption package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.38   \endinput}{}

? 

我做错了什么?我该如何解决?

(我是新手...我不知道 dtx、ins 或 sty 文件是什么。我所知道的是,我通常可以运行latex file.ins来生成file.sty,然后放入file.sty适当的目录并使用该包。)

[安装最新版本的 TexLive 后,我遇到了问题...请参阅下面的链接]

网络安装后 Ubuntu 上的 TexLive 2012 出现问题

答案1

latex subcaption.dtx将要不是构建subcaption.sty,但文档却subcaption.dvi相反。subcaption.pdfsubcaption本身没有不是diagbox.sty对、epic.styfootmisc.styoverpic.sty或有依赖关系pict2e.sty,您只需要它们来为自己构建文档。(此步骤不是必需的,因为文档已经预先构建为subcaption.pdf。)

在为自己构建软件包文档时,您会收到错误消息“caption package not loaded”,subcaption因为构建文档需要subcaption安装的软件包的实际版本。因此,您需要先更新caption软件包包(其中包括subcaption.sty)。

latex caption.instex caption.ins将构建所需的包文件,即caption.sty,...和subcaption.sty。但从 CTAN 获取 LaTeX 包的最简单方法是先查找 TDS 结构化档案,它们位于

http://mirrors.ctan.org/install/macros/latex/contrib/

如您所见,有一个 caption.tds.zip,因此获取此文件,解压缩它,然后将其内容放到正确的位置,就是安装/更新整个caption软件包(包括 sty 文件和文档)所需要做的全部工作。

相关内容