MacTeX-2012, subcaption.sty not found

3,168 views
Skip to first unread message

Jacob Wegelin

unread,
Jul 25, 2012, 2:16:13 PM7/25/12
to latexus...@googlegroups.com
The example below compiled under pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011), on a Mac OS 10.7.4.

But under pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) on a Mac OS 10.6.8, it threw the following:

! LaTeX Error: File `subcaption.sty' not found.

I downloaded this installation of MacTeX.pkg yesterday from http://www.tug.org/mactex/downloading.html. The checksum was correct after download, and the installation (with defaults) went fine. But, as shown above, this installation does not know where to find `subcaption.sty'.

What am I doing wrong?

\documentclass[11pt]{article}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{center}
\begin{subfigure}[b]{0.2\textwidth}
\centering
\caption{A thing on the left?
}
\end{subfigure}
%
\begin{subfigure}[b]{0.2\textwidth}
\centering
\caption{On the right?
}
\end{subfigure}
\caption{
Two things.
}
\end{center}
\end{figure}
\end{document}

Jacob Wegelin

Ole Peter Smith

unread,
Jul 25, 2012, 4:19:06 PM7/25/12
to latexus...@googlegroups.com

it's missing that sty-file, you may be able to find some package containing it where you downloaded the distribution - or use brute force, locating it on the other mac and put it in the 'same' place, or in your working directory.

0le

Send via Android

--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexusersgroup@googlegroups.com.
To unsubscribe from this group, send email to latexusersgroup+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.

Werner Grundlingh

unread,
Jul 25, 2012, 4:45:10 PM7/25/12
to latexus...@googlegroups.com, Jacob Wegelin
You might be interested in following some of the discussion related to How do I update my TeX distribution? This covers some broad-stroke ideas of installing things from scratch as well as updating existing packages on various distributions. For a more manual approach to things, consider viewing Where do I place my own .sty files, to make them available to all my .tex files?

Werner

Jacob Wegelin

unread,
Jul 26, 2012, 12:10:36 PM7/26/12
to Werner Grundlingh, latexus...@googlegroups.com

Thanks. Following the first link, I ran TeX Live Utility to update things, but subcaption was not listed in TeX Live Utility.

Next I ran "tlmgr update --all", but subcaption is also not listed by tlmgr.

I am mystified why the subcaption package would be present (without any extra effort from me) in the 2011 edition of MacTeX but not the 2012 edition.

In the spirit of the second link:

I also used Spotlight to search for subcaption.sty on the Mac on which I still am able to run subcaption, and I find that file nowhere.

Is subcaption simply not supported after 2011? And how does it work on my Mac OS 10.7.4 if subcaption.sty cannot be found by Spotlight?

Jacob Wegelin

Kevin Godby

unread,
Jul 26, 2012, 12:15:42 PM7/26/12
to latexus...@googlegroups.com, Jacob Wegelin
Hello, Jacob.

The subcaption.sty file is provided by the TeX Live caption package.

If you run "kpsewhich subcaption.sty" does it return anything? How
about "kpsewhich caption.sty"?

--Kevin Godby

Jacob Wegelin

unread,
Jul 26, 2012, 12:44:21 PM7/26/12
to Kevin Godby, latexus...@googlegroups.com
Both these commands return a path on the Mac OS 10.7.4 on which MacTeX-2011 is installed and on which the tex subcaption example runs:

~/Documents/from-laptop/LaTeX-example> kpsewhich subcaption.sty
/usr/local/texlive/2011/texmf-dist/tex/latex/caption/subcaption.sty
~/Documents/from-laptop/LaTeX-example> kpsewhich caption.sty
/usr/local/texlive/2011/texmf-dist/tex/latex/caption/caption.sty

but on the Mac OS 10.6.8 on which MacTeX-2012 is installed and on which the tex subcaption example throws an error, those commands return nothing.

(Evidently, Spotlight does not know about certain files and kpsewhich is
necessary to find them?)

As for TeX Live, I ran it on the latter Mac, told it to update everything, but subcaption was not in its list of packages.

And the "tlmgr update" command also made no mention of subcaption or caption.

By manually copying caption.sty, subcaption.sty, and caption3.sty to the directory in which I am trying to run the sample code on the MacTeX-2012 computer, I got the sample code to run on that computer.

But is there some long-term, elegant, preferably automatic solution, which will survive updates to LaTeX and moving to new computers, and does not require placing style files by hand into various directories?

Following
http://tex.stackexchange.com/questions/1137/where-do-i-place-my-own-sty-files-to-make-them-available-to-all-my-tex-files

I ran

kpsewhich -var-value=TEXMFHOME

on both of my computers, and neither of them has such a directory:

~/Documents/tmp/ExampleLaTeX> kpsewhich -var-value=TEXMFHOME | xargs ls
ls: /Users/bnw/Library/texmf: No such file or directory
~/Documents/tmp/ExampleLaTeX>

Jacob Wegelin

Kevin Godby

unread,
Jul 26, 2012, 2:57:45 PM7/26/12
to latexus...@googlegroups.com, Jacob Wegelin
On Thu, Jul 26, 2012 at 11:44 AM, Jacob Wegelin
<jacobw...@fastmail.fm> wrote:
*snip*
> but on the Mac OS 10.6.8 on which MacTeX-2012 is installed and on which the
> tex subcaption example throws an error, those commands return nothing.

If you run 'sudo tlmgr info caption' does it report that the package
is installed? If it's not installed, run 'sudo tlmgr install caption'
and then see if 'kpsewhich subcaption.sty' returns anything. If it is
already installed, then we'll need to check some paths to see why
kpsewhich isn't finding it.

> By manually copying caption.sty, subcaption.sty, and caption3.sty to the
> directory in which I am trying to run the sample code on the MacTeX-2012
> computer, I got the sample code to run on that computer.
>
> But is there some long-term, elegant, preferably automatic solution, which
> will survive updates to LaTeX and moving to new computers, and does not
> require placing style files by hand into various directories?

Well, since the caption package is included with TeX Live, the best
solution would be to have TeX Live install it. Then TeX Live can keep
it up to date.

> ~/Documents/tmp/ExampleLaTeX> kpsewhich -var-value=TEXMFHOME | xargs ls
> ls: /Users/bnw/Library/texmf: No such file or directory
> ~/Documents/tmp/ExampleLaTeX>

This is another solution in case we can't get TeX Live to work
properly for some reason. If you create the missing directory, you can
place the .sty files in that directory, and run 'texhash
/Users/bnw/Library/texmf'. (The texhash program indexes all the files
in that directory.) kpsewhich should then be able to find the files
you've added to the /Users/bnw/Library/texmf directory.

--Kevin

Jacob Wegelin

unread,
Jul 27, 2012, 7:18:30 AM7/27/12
to Kevin Godby, latexus...@googlegroups.com

On Thu, 26 Jul 2012, Kevin Godby wrote:

> On Thu, Jul 26, 2012 at 11:44 AM, Jacob Wegelin
> <jacobw...@fastmail.fm> wrote:
> *snip*
>> but on the Mac OS 10.6.8 on which MacTeX-2012 is installed and on which the
>> tex subcaption example throws an error, those commands return nothing.
>
> If you run 'sudo tlmgr info caption' does it report that the package
> is installed? If it's not installed, run 'sudo tlmgr install caption'
> and then see if 'kpsewhich subcaption.sty' returns anything. If it is
> already installed, then we'll need to check some paths to see why
> kpsewhich isn't finding it.

sudo tlmgr info caption

says that caption is installed:

package: caption
category: Package
shortdesc: Customising captions in floating environments.
longdesc: (...)
installed: Yes
revision: 25657
cat-version: 3.2e
cat-date: 2011-11-10 13:22:20 +0100
cat-license: lppl
collection: collection-latexrecommended

sudo tlmgr info subcaption
Password:
tlmgr: package repository
http://ftp.math.purdue.edu/mirrors/ctan.org/systems/texlive/tlnet
tlmgr: cannot find package subcaption

Is subcaption.sty part of the caption package?
I thought it was a separate, small package of its own, which had to be
separately declared in a "usepackage" statement.

~/Documents/tmp> kpsewhich caption.sty
/sw/share/texmf-dist/tex/latex/caption/caption.sty
~/Documents/tmp> kpsewhich subcaption.sty
~/Documents/tmp>

What next step should I take?


Thanks

Jacob Wegelin
Reply all
Reply to author
Forward
0 new messages