MiKTeX and proTeXtProblem with Miktex 2.7 and caption.sty

Information and discussion about MikTeX distribution for Windows and the related proTeXt: Installing, updating, configuring
Post Reply
JStringer
Posts: 6
Joined: Tue Sep 09, 2008 2:33 am

Problem with Miktex 2.7 and caption.sty

Post by JStringer »

Hi! Hope someone can help me. I just have a new laptop running vista and was advised to put the new version of Miktex on it 2.7. The style file I am using from the journal that I wish to publish in requires caption.sty but the new version of Miktex doesn't seem to like it. It was working fine on an older version of Mixtex. Can someone help me please?

Thanks

Jo

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Problem with Miktex 2.7 and caption.sty

Post by Stefan Kottwitz »

Hi Jo,

welcome to the board!
Could you provide more details? Perhaps give us a link to the journal style file, a minimal example, error messages or the logfile as attachment.

Stefan
LaTeX.org admin
JStringer
Posts: 6
Joined: Tue Sep 09, 2008 2:33 am

Re: Problem with Miktex 2.7 and caption.sty

Post by JStringer »

Hi Stefan!

Not sure if I am answering correctly but the part of my style file (for JABES) that is causing the problem is singelinecheck=true for package caption. When I replaced this option with nothing it Miktex 2.7 then complained about \DeclareCaptionStyle{fortables}.

This is part of my style file:

\RequirePackage{graphicx} \setlength\doublerulesep{2.5pt}
\RequirePackage[singlelinecheck=true]{caption}
%\RequirePackage{setspace}
%\DeclareCaptionFont{singlespacing}{\renewcommand\baselinestretch{1.0}}
\DeclareCaptionStyle{fortables}[justification=centering]
{format=hang,
font={sf,singlespacing,small},
position=top,
aboveskip=1ex,
belowskip=0ex,
labelsep=period}
\DeclareCaptionStyle{forfigures}[justification=centering]
{font={it,small},
position=bottom,
labelsep=period}
\captionsetup[table]{style=fortables}
\captionsetup[figure]{style=forfigures}

Thanks

Jo
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Problem with Miktex 2.7 and caption.sty

Post by sommerfee »

Hi Jo,
JStringer wrote: Not sure if I am answering correctly but the part of my style file (for JABES) that is causing the problem is singelinecheck=true for package caption.
This is strange since "singlelinecheck=true" is the default setting. So replacing this option with nothing it should have no effect. (Unless the caption package had been loaded before, e.g. by the subfig package. In this case you get an "option clash" from LaTeX.)
When I replaced this option with nothing it Miktex 2.7 then complained about \DeclareCaptionStyle{fortables}.
What exactly do you mean by "complained about"? What error message are you getting?
This is part of my style file:
I tried to convert this into a minimal example file, but this works fine here (using caption.sty v3.1j):

Code: Select all

\documentclass{article}

\usepackage[singlelinecheck=true]{caption}
%\RequirePackage{setspace}
%\DeclareCaptionFont{singlespacing}{\renewcommand\baselinestretch{1.0}}
\DeclareCaptionStyle{fortables}[justification=centering]
{format=hang,
font={sf,singlespacing,small},
position=top,
aboveskip=1ex,
belowskip=0ex,
labelsep=period}
\DeclareCaptionStyle{forfigures}[justification=centering]
{font={it,small},
position=bottom,
labelsep=period}
\captionsetup[table]{style=fortables}
\captionsetup[figure]{style=forfigures}

\begin{document}

\begin{figure}
\centering A figure
\caption{Blah\ldots}
\end{figure}

\end{document}
So please give me a full running example which shows the problem, so I can reproduce the problem and take care about it.

Axel
JStringer
Posts: 6
Joined: Tue Sep 09, 2008 2:33 am

Re: Problem with Miktex 2.7 and caption.sty

Post by JStringer »

Hi Axel!

I tried your small example and I got exactly the same error:

!Latex error: unknwon option 'singlelinecheck=true' for package 'caption'.

What am I doing wrong?

Thanks

Jo
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Problem with Miktex 2.7 and caption.sty

Post by sommerfee »

JStringer wrote: !Latex error: unknwon option 'singlelinecheck=true' for package 'caption'.
It seems that a very old caption package (I assume v1.4b) is used here, because the option "singlelinecheck=true" is valid since v3.0 from Dec 2003.

So please take a closer look at your log file and/or put a \listfiles at the beginning of the document, so you see what version of the caption package is actually used.

Gruß,
Axel
JStringer
Posts: 6
Joined: Tue Sep 09, 2008 2:33 am

Re: Problem with Miktex 2.7 and caption.sty

Post by JStringer »

Hi Axel!

I did what you suggested and I am using v1.4b. After the error it says:

1.78 \newsavebox{\as@captionbox}

?

I have downloaded caption.sty from the web again just in case I did anything to it. I then ran Miktex options to refresh FNDB and update formats (I think this is what you are supposed to do).

I have an older version of Mixtex on my laptop - that wouldn't be causing a problem would it?

Thanks

Jo
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problem with Miktex 2.7 and caption.sty

Post by localghost »

JStringer wrote:[...] I have downloaded caption.sty from the web again just in case I did anything to it. I then ran Miktex options to refresh FNDB and update formats (I think this is what you are supposed to do). [...]
Why don't you simply use the MiKTeX Package Manager to install packages?
JStringer wrote:[...] I have an older version of Mixtex on my laptop - that wouldn't be causing a problem would it? [...]
It is very unlikely that there would be problems, but it is recommended to upgrade to the current version.


Best regards and welcome to the board
Thorsten¹
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Problem with Miktex 2.7 and caption.sty

Post by sommerfee »

JStringer wrote:I have downloaded caption.sty from the web again just in case I did anything to it.
What version have you downloaded from where? The version v1.4b is over 13(!) years old, and is neither offering package options like "singlelinecheck=true" nor commands like \DeclareCaptionStyle or \captionsetup.

Please install the actual version of the caption package (which is v3.1j at the moment) and everything should (hopefully) compile fine.

Axel
Post Reply