Document Classescaption, elsarticle | Unsupported Document Class

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Ronald
Posts: 2
Joined: Thu Jul 19, 2012 2:07 pm

caption, elsarticle | Unsupported Document Class

Post by Ronald »

Hello all together,

in my thesis paper I inserted the following packages in order to change at German language which worked great (WinEdt7):

Code: Select all

\usepackage{ngerman}
\usepackage[utf8]{inputenc}
Now I changed the packages because I had troubles with quotation marks. They are as followed:

Code: Select all

\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[babel,german=guillemets]{csquotes}
It didn't worked well, so I changed back to the first package, that now doesn't work anymore. By compiling the following error message is shown:

Code: Select all

Package caption Warning: Unsupported document class (or package) detected,
(caption)                usage of the caption package is not recommended.
See the caption package documentation for explanation.

))
(C:\Users\Ronald\AppData\Roaming\MiKTeX\2.9\tex\latex\koma-script\scrpage2.sty)
Writing nomenclature file Masterthesis.nlo
(C:\UNI\Masterthesis.aux
! Undefined control sequence.
\select@language ... \@empty }\languageshorthands
                                                  {none}\babel@beginsave \cs...
l.4 \select@language{ngerman}
What can I do? I didn´t changed anythinng else, so I have no idea why is doesn´t work as it did before? When I create a new file and insert these packages

Code: Select all

\usepackage{ngerman}
\usepackage[utf8]{inputenc}
they work fine. So the packages exist. The first codes of my thesis are as followed:

Code: Select all

\documentclass[12pt]{elsarticle}

\usepackage{ngerman}
\usepackage[utf8]{inputenc}

%\usepackage[ngerman]{babel}
%\usepackage[latin1]{inputenc}
%\usepackage[T1]{fontenc}
%\usepackage[babel,german=guillemets]{csquotes}


\usepackage{amsmath,amssymb,amsfonts,amsthm}    % Typical maths resource packages
\usepackage{graphicx}                           % Packages to allow inclusion of graphics
\usepackage{float}
%\usepackage{hyperref}                           % For creating hyperlinks in cross references
%\usepackage[authoryear]{natbib}                % literature reference style
\usepackage{caption3}
\usepackage{nomencl}
\usepackage{pdfpages}
\usepackage{listings}
\usepackage[noend]{algorithmic}
\usepackage{algorithm}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{paralist}
\usepackage{picins}
\usepackage{multirow}
\usepackage{makeidx}
\usepackage{wrapfig}
\usepackage{subfig}
\DeclareMathOperator*{\argmax}{arg\,max}
I hope that I mentioned all necessary. I am very thankful for any help.
Last edited by localghost on Thu Jul 19, 2012 3:17 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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

caption, elsarticle | Unsupported Document Class

Post by localghost »

The warning by the caption package can be neglected because the elsarticle class relies on the »article« class. And the latter one is supported by the package. It just gives a warning because it detects a class which is not officially supported. All things will work.

Your problem is at another place. The ngerman package is obsolete. Hence the babel package along with its ngerman language option is the way to go. The error can be caused due to the migration from ngerman to babel. Just try another compiler run.

If the problem persists, delete the *.aux file in the working directory and try again. If the problem still persists, prepare a minimal example to give an adequate problem description. At the moment all approaches are only guesses and random shots, which is not very helpful.

And by the way, \usepackage{caption} (without the appended 3) is quite sufficient to load the package.


Best regards and welcome to the board
Thorsten
Ronald
Posts: 2
Joined: Thu Jul 19, 2012 2:07 pm

caption, elsarticle | Unsupported Document Class

Post by Ronald »

First of all thanks a lot for you fast answer. I believe as you that the problem occurred with the change to babel which I cannot undo. The babel package doesn#t work either. Then it has problems with the title page and its vowel mutations (that was the reason I inserted ngerman). As you advised I tried other compilers but it doesn't work neither. Also I deleted the *.aux file but I didn't help.

If I use the babel lines it doesn't work because of the Latin and the T1

Code: Select all

%\usepackage[ngerman]{babel}        
\usepackage[latin1]{inputenc}      
\usepackage[T1]{fontenc}
\usepackage[babel,german=guillemets]{csquotes}
So I changed the lines to the follow ones:

Code: Select all

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[babel,german=guillemets]{csquotes}
And now it works:-) Still one question: Can I create a backup of the whole project and not only save the sheets? So that I can go back to an earlier point (and undo an babel-package-installation for example;-) ), that a mistake as today cannot occur any more?
Thanks a lot for your help.
Best wishes
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

caption, elsarticle | Unsupported Document Class

Post by localghost »

Ronald wrote:[…] The babel package doesn't work either. Then it has problems with the title page and its vowel mutations (that was the reason I inserted ngerman). As you advised I tried other compilers but it doesn't work neither. Also I deleted the *.aux file but I didn't help. […]
This description is not helpful. As I requested earlier you should prepare a minimal example. Otherwise the discussion remains academic and I wasted my time because concrete help is not possible.

And I didn't advise to use another compiler, but to run the compiler again.
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

caption, elsarticle | Unsupported Document Class

Post by sommerfee »

localghost wrote:The warning by the caption package can be neglected because the elsarticle class relies on the »article« class. And the latter one is supported by the package. It just gives a warning because it detects a class which is not officially supported. All things will work.
This is not true, the caption package does not check against the document class name but known definitions of \caption, \@caption, and \@makecaption instead. So in fact the elsarticle document class is incompatible to the caption package.

So better drop loading the caption package and load the subfig package with option "caption=false" to prevent the subfig package from loading the caption package:

Code: Select all

\usepackage[caption=false]{subfig}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

caption, elsarticle | Unsupported Document Class

Post by localghost »

sommerfee wrote:This is not true, the caption package does not check against the document class name but known definitions of \caption, \@caption, and \@makecaption instead. So in fact the elsarticle document class is incompatible to the caption package. […]
OK. Nobody knows that better than you. But on the other side I can use caption with elsarticle and until now don't have any problems. I didn't check the class code so didn't know about the (re)definitions of the macros you mentioned. Is it a concurrence that I don't face any flaws?
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

caption, elsarticle | Unsupported Document Class

Post by sommerfee »

localghost wrote:But on the other side I can use caption with elsarticle and until now don't have any problems. I didn't check the class code so didn't know about the (re)definitions of the macros you mentioned. Is it a concurrence that I don't face any flaws?
I'm terribly sorry, I have mistaken the Elsevier document classes with the Springer ones, so just forget what I have said about the Elsevier classes.

I just took a look and the elsarticle document class defines \@makecaption in a way the caption package isn't aware off. But it's the same definition as in article, but with an additional \footnotesize inside. So in this case one can ignore the warning message from the caption package.

(I just put a small note inside my TODO list to add the elsarticle definition to my caption package, but please don't expect a new version very soon...)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

caption, elsarticle | Unsupported Document Class

Post by localghost »

sommerfee wrote: I'm terribly sorry, I have mistaken the Elsevier document classes with the Springer ones, so just forget what I have said about the Elsevier classes. […]
Nevermind.
sommerfee wrote:[…] I just took a look and the elsarticle document class defines \@makecaption in a way the caption package isn't aware off. But it's the same definition as in article, but with an additional \footnotesize inside. So in this case one can ignore the warning message from the caption package. […]
I only knew that elsarticle loads »article« but wasn't aware of any modifications to captions.
sommerfee wrote: […] (I just put a small note inside my TODO list to add the elsarticle definition to my caption package, but please don't expect a new version very soon...)
No need to hurry. For the present it works yet again.
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

caption, elsarticle | Unsupported Document Class

Post by sommerfee »

sommerfee wrote:(I just put a small note inside my TODO list to add the elsarticle definition to my caption package, but please don't expect a new version very soon...)
Finally I found some time to release a new version (3.3) of the caption package which does include support for the elsarticle document class. (Please note that it's documented in the CHANGELOG only, I will revise the documentation as soon as I will find some time for that...)
Post Reply