I use Axel Sommerfeldt's bicaption package to setup bilingual captions.
bicaption needs babel's \selectlanguage to set the different caption names for different languages. However, I cannot use the faculty of babel/polyglossia since it doesn't work for east Asian languages.
It is easy to set a name option for the two captions, but I can't set different names for different types of floats. For example,
\documentclass{article}
\usepackage{caption}[2012/02/19 v3.2f]
\usepackage{bicaption}[2011/10/30 v1.0a]
\captionsetup[bi-first]{name=Foo}
\captionsetup[bi-second]{name=Bar}
\begin{document}
\begin{figure}
\centering FIGURE
\bicaption{XXX}{YYY}
\end{figure}
\begin{table}
\centering TABLE
\bicaption{XXX}{YYY}
\end{table}
\end{document}
I tried
\captionsetup[bi-first,figure]{name=Foo}
there's no effect. And I tried
\captionsetup[bi-first]{figurename=Foo}
then I got an error
! Package caption Error: Can be used only in preamble.
So what can I do? Is there a simple way to use bicaption without babel?
In an older version of caption package (e.g. 2011/11/10 v3.2e), figurename and table options can be used in document environment, but the latest caption allows them only to be used in the preamble. I cannot see any advantage to set \@onlypreamble\caption@SetName. However, even if I use the old version of caption, I still cannot set the name for user-defined (via newfloat package) floats in bilingual captions.
Note: I do not like the \bicaption provided by ccaption package, it is complicated to use. And I have the ability to define my own version of \bicaption, but it seems also a bad option.
Currently I can use this weird trick:
\captionsetup[bi-first]{font=bi-first}
\captionsetup[bi-second]{font=bi-second}
\DeclareCaptionFont{bi-first}{%
\def\tablename{Table}%
\def\figurename{Figure}}
\DeclareCaptionFont{bi-second}{%
\def\tablename{Alter-table}%
\def\figurename{Alter-figure}}
\DeclareCaptionOptionis better. And I'm glad that there would be a new interface for this. – Leo Liu Apr 07 '12 at 10:12\DeclareCaptionOptionNoValue? I wonder why it is not documented either. – Leo Liu Apr 07 '12 at 10:18\DeclareCaptionOptionNoValuewill be fine, too. Unfortunately thecaptionpackage documentation is currently not up-to-date, that's the only reason why it's not documented yet. – Apr 07 '12 at 12:25bicaptionpackage. If you have further ideas on how to improve usage without babel/polyglossia please don't hesitate to contact me. – Apr 10 '12 at 06:53