LaTeX forum ⇒ Document Classescaption, elsarticle | Unsupported Document Class

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

caption, elsarticle | Unsupported Document Class

Postby Ronald » Thu Jul 19, 2012 2:51 pm

Hello all together,

in my thesis paper I inserted the following packages in order to change at German language which worked great (WinEdt7):
  1. \usepackage{ngerman}
  2. \usepackage[utf8]{inputenc}

Now I changed the packages because I had troubles with quotation marks. They are as followed:
  1. \usepackage[ngerman]{babel}
  2. \usepackage[latin1]{inputenc}
  3. \usepackage[T1]{fontenc}
  4. \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:

  1. Package caption Warning: Unsupported document class (or package) detected,
  2. (caption) usage of the caption package is not recommended.
  3. See the caption package documentation for explanation.
  4.  
  5. ))
  6. (C:\Users\Ronald\AppData\Roaming\MiKTeX\2.9\tex\latex\koma-script\scrpage2.sty)
  7. Writing nomenclature file Masterthesis.nlo
  8. (C:\UNI\Masterthesis.aux
  9. ! Undefined control sequence.
  10. \select@language ... \@empty }\languageshorthands
  11. {none}\babel@beginsave \cs...
  12. 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
  1. \usepackage{ngerman}
  2. \usepackage[utf8]{inputenc}

they work fine. So the packages exist. The first codes of my thesis are as followed:
  1. \documentclass[12pt]{elsarticle}
  2.  
  3. \usepackage{ngerman}
  4. \usepackage[utf8]{inputenc}
  5.  
  6. %\usepackage[ngerman]{babel}
  7. %\usepackage[latin1]{inputenc}
  8. %\usepackage[T1]{fontenc}
  9. %\usepackage[babel,german=guillemets]{csquotes}
  10.  
  11.  
  12. \usepackage{amsmath,amssymb,amsfonts,amsthm} % Typical maths resource packages
  13. \usepackage{graphicx} % Packages to allow inclusion of graphics
  14. \usepackage{float}
  15. %\usepackage{hyperref} % For creating hyperlinks in cross references
  16. %\usepackage[authoryear]{natbib} % literature reference style
  17. \usepackage{caption3}
  18. \usepackage{nomencl}
  19. \usepackage{pdfpages}
  20. \usepackage{listings}
  21. \usepackage[noend]{algorithmic}
  22. \usepackage{algorithm}
  23. \usepackage{booktabs}
  24. \usepackage{amsmath}
  25. \usepackage{paralist}
  26. \usepackage{picins}
  27. \usepackage{multirow}
  28. \usepackage{makeidx}
  29. \usepackage{wrapfig}
  30. \usepackage{subfig}
  31. \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.
Reason: Source code has to be tagged as such to keep a post clear and legible (see Board Rules).

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Thu Jul 19, 2012 3:26 pm

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
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

Ronald
Posts: 2
Joined: Thu Jul 19, 2012 2:07 pm

Postby Ronald » Thu Jul 19, 2012 5:42 pm

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
  1. %\usepackage[ngerman]{babel}
  2. \usepackage[latin1]{inputenc}
  3. \usepackage[T1]{fontenc}
  4. \usepackage[babel,german=guillemets]{csquotes}


So I changed the lines to the follow ones:
  1. \usepackage[ngerman]{babel}
  2. \usepackage[utf8]{inputenc}
  3. \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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Thu Jul 19, 2012 6:26 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
sommerfee
Posts: 495
Joined: Mon Apr 09, 2007 4:20 pm
Contact:

Postby sommerfee » Sat Jul 21, 2012 8:15 pm

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:

  1. \usepackage[caption=false]{subfig}

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Sun Jul 22, 2012 12:23 pm

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?
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
sommerfee
Posts: 495
Joined: Mon Apr 09, 2007 4:20 pm
Contact:

Postby sommerfee » Sun Jul 22, 2012 6:23 pm

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...)

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Sun Jul 22, 2012 7:04 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
sommerfee
Posts: 495
Joined: Mon Apr 09, 2007 4:20 pm
Contact:

Postby sommerfee » Wed Jan 09, 2013 11:51 pm

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...)

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 4 guests