I introduce a figure as follows:



\caption{Caption for the figure}


In the preamble I have written:


I am writing the .tex file in Vim, in Ubuntu 12.04 LTS. When I compile the .tex file writing in the terminal:

bash make_latex.sh

(script which link is here: http://www.mediafire.com/view/p6ha13gt53nilpv/make_latex.sh )

I receive this error:

enter image description here

I have installed manually the caption package following all these steps: http://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages

First Step: I extracted the .ins file writing

latex caption.ins

The information generated in the terminal is here: https://www.mediafire.com/?o4giarg9jb4rov9

Second Step: As said in the instructions, I wrote:

latex caption.dtx

The information generated in the terminal is here: https://www.mediafire.com/?cl9ocvbid721p0a

Third Step: In /usr/local/share/texmf/tex/latex/caption I copied the files that the info in the First Step told that were necessary to be copied. Here is the "proof":

enter image description here

Fourth Step: As said in the instructions, I made


And as it is shown here:

enter image description here

The process was done.

So, the question is: Why am I receiving that error when compiling ? I would appreciate very much if someone could help me

The latex version is:

enter image description here

Here is my entire preamble:

\parindent 1 true cm
\renewcommand{\chaptermark}[1]{\markboth{\thechapter .\ #1}{}}             
\renewcommand{\sectionmark}[1]{\markright{\thesection .\ #1}{}}
\fancyhead[LE]{{\sf \leftmark}}                             
\fancyhead[RO]{{\sf \rightmark}}
  • 1
    You should have installed caption with a suitable apt-get command. Did you run sudo mktexlsr?
    – egreg
    Jun 23, 2014 at 20:08
  • 1
    First try sudo apt-get install texlive-latex-recommended
    – egreg
    Jun 23, 2014 at 20:10
  • 2
    So you already have caption. As far as I can remember, \captionsetup was already present in the version of caption available in 2009. Anyway, being five years behind is really too much, you should try upgrading your TeX Live.
    – egreg
    Jun 23, 2014 at 20:21
  • 1
    @DavidC.: Make sure you're using the correct (installed) version, and not some random copy identified via mktexlsr. See Which package version am I using?
    – Werner
    Jun 23, 2014 at 20:47
  • 1
    What happens if you type \usepackage[font=small]{caption} and omit the \captionsetup instruction?
    – Mico
    Jun 23, 2014 at 22:03

1 Answer 1


Depending on your setup, you may have different versions of packages floating around. When you're not sure what's going on with your version, it's best to see what version of a package you're using. Even though you think your TeXMF folder hash is updated, TeX may be grabbing something local, or something located elsewhere during the construction of the hash.

From the comments it seems like this was indeed the case (a local, outdated version).

In terms of your font selection inside \captionsetup. If you wish to use the stretch option, note that is should be supplied as part of the font setup:

  • You should give your edition, which works for your answer.
    – Nick Dong
    Sep 24, 2019 at 2:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .