TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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.

Have a look at How to install "vanilla" TeXLive on Debian or Ubuntu? you shouldn't need to do any 'manual' installation for subcaption – cmhughes Feb 5 '13 at 19:02
The subcaption package needs caption so you have to install also that one. But trying to update a very old distribution like yours (more than three years) is quite hopeless. Do as cmhughes recommends, you won't regret it. – egreg Feb 5 '13 at 19:08
Which answer at the page that cmhughes links to should I follow? – synaptik Feb 5 '13 at 20:42
@synaptik I would recommend removing your old distribution completely as in How to remove everything related to TeX Live for fresh install on Ubuntu? and then follow the instructions in the first answer to How to install "vanilla" TeXLive on Debian or Ubuntu? – cmhughes Feb 5 '13 at 21:57
Why don't you just download mirrors.ctan.org/install/macros/latex/contrib/caption.tds.zip ? There is no need to build the sty files (or documentation) by yourself. (BTW: latex subcaption.dtx will not build subcaption.sty but subcaption.pdf instead. latex caption.ins will build subcaption.sty) – Axel Sommerfeldt Feb 6 '13 at 7:00

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.

share|improve this answer
Thanks, this is very helpful. How can I find out what the right location is? – synaptik Feb 6 '13 at 19:29
@synaptik Unpack the zip file within a texmf directory of your choice, e.g. $HOME/texmf. See also: tex.stackexchange.com/questions/1137/… – Axel Sommerfeldt Feb 6 '13 at 20:44
@synaptik ...and tex.stackexchange.com/questions/73016/… – Axel Sommerfeldt Feb 6 '13 at 20:50
Thanks very much. – synaptik Feb 6 '13 at 22:14

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