Graphics, Figures & TablesCostumizing caption while using babel

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sbigi
Posts: 1
Joined: Thu Mar 26, 2009 1:43 am

Costumizing caption while using babel

Post by sbigi »

Hi,

I would like to decrease size of caption text in a document written in 'article' class. In the meantime I am using babel and the standard way simply does not work (there are no error or warning messages). Without babel it works fine:
\documentclass[12pt,letterpaper]{article}
\usepackage[magyar]{babel}
...
\usepackage[small]{caption}
...
I tried to define a new command as well, but since I use long captions I need short one in the listoffigures, but when the caption is short would like to avoid the double typing. I do not know how to set the first argument for default value for the second one.

I got error if there is no second argument:
\newcommand{\scap}[2]{\caption[#2]{\small{#1}}}
Any suggestion is welcome.

thank you!
Brigitta

Recommended reading 2024:

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

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

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

Costumizing caption while using babel

Post by sommerfee »

The magyar babel package seems to have some code inside which is incompatible to the caption package - especially it redefines \caption.

I will take a closer look at it within the next days and report.

Regarding your second question: You can use the helper macro \@dblarg for that purpose:

Code: Select all

\makeatletter
\newcommand\scap{\@dblarg\@scap}
\long\def\@scap[#1]#2{\caption[{#1}]{\small #2}}
\makeatother
But note that this will only typeset the caption text in small, not the caption label in front of it.

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

Costumizing caption while using babel

Post by sommerfee »

Regarding your first problem:

Try this code to load the caption package:

Code: Select all

\usepackage[small,labelsep=period]{caption}
\makeatletter
\let\caption@makecaption\@makecaption
\addto\extrasmagyar{\let\@makecaption\caption@makecaption}
\makeatother
You will still get a warning about the fact that \caption was redefined by another package, but this gives you just small limitations. Anyway this should be a sufficient workaround until I added proper support of the hungarian/magyar babel package to my caption package (which is planned for the next release).

HTH,
Axel
Post Reply