I'm trying to install the subcaption package on TexLive installed on Ubuntu 11.10. When trying to build subcaption.sty, I found that I needed to first download or build several dependencies:


After putting these files in the same directory as subcaption.dtx, I try to build subcaption.sty and here is the result:

$ latex subcaption.dtx 
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
Document Class: ltxdoc 2007/11/11 v2.0u Standard LaTeX documentation class
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/generic/oberdiek/ifpdf.sty) (./footmisc.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/dvips.def))) (./overpic.sty
Package: overpic v0.53 <2010/09/13> (RN)
Enhancements to Picture Environment. Version 1.2 - Released June 1, 1986
overpic: relative positioning in percent
) (./pict2e.sty (./p2e-dvips.def)) (./diagbox.sty
`Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich
Implicit mode ON; LaTeX internals redefined
*hyperref using default driver hdvips*

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}{}


What am I doing wrong? How can I fix this?

(I'm a novice... I don't know what dtx, ins, or sty files are. All I know is that I can usually run latex file.ins to produce file.sty and then put file.sty in an appropriate directory and use that package.)

[After installing the latest version of TexLive, I had problems... see link below]

Problems with TexLive 2012 on Ubuntu after network installation

closed as too localized by Joseph Wright Feb 6 '13 at 16:24

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.


latex subcaption.dtx will not build subcaption.sty but the documentation subcaption.dvi resp. subcaption.pdf instead. The subcaption package itself does not have dependencies to diagbox.sty, epic.sty, footmisc.sty, overpic.sty, or pict2e.sty, you only need them to build the documentation for yourself. (This step is not necessary since the documentation already comes pre-build as subcaption.pdf.)

You are getting the error message "caption package not loaded" when building the subcaption package documentation for yourself since building the documentation requires the actual version of the subcaption package installed. So you need to update the caption package bundle (which includes subcaption.sty) first.

latex caption.ins or tex caption.ins will build the required package files, i.e. caption.sty, ..., and subcaption.sty. But the easiest way to get a LaTeX package from CTAN is to look for a TDS structured archive first, they are located at


As you see there is a caption.tds.zip, so getting this file, unzipping it, and putting its contents to the right location is all you need to do to install/update the whole caption package bundle including sty files and docs.

Not the answer you're looking for? Browse other questions tagged or ask your own question.