summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption/bicaption.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-10-11 22:51:57 +0000
committerKarl Berry <karl@freefriends.org>2011-10-11 22:51:57 +0000
commit662cda48313c1615e5b117f827f245bd4a4fc22a (patch)
tree01e91550e909592ad97621e006e88bb7245ab8f0 /Master/texmf-dist/source/latex/caption/bicaption.dtx
parentcb7441b1e993714d541a3ac8ec26843cd16a301b (diff)
caption (11oct11)
git-svn-id: svn://tug.org/texlive/trunk@24268 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/caption/bicaption.dtx')
-rw-r--r--Master/texmf-dist/source/latex/caption/bicaption.dtx435
1 files changed, 378 insertions, 57 deletions
diff --git a/Master/texmf-dist/source/latex/caption/bicaption.dtx b/Master/texmf-dist/source/latex/caption/bicaption.dtx
index 3f0e989df9f..be0f7d433d7 100644
--- a/Master/texmf-dist/source/latex/caption/bicaption.dtx
+++ b/Master/texmf-dist/source/latex/caption/bicaption.dtx
@@ -14,7 +14,7 @@
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
-% This work has the LPPL maintenance status "maintained".
+% This work has the LPPL maintenance status "maintained".F
%
% This Current Maintainer of this work is Axel Sommerfeldt.
%
@@ -25,12 +25,12 @@
% caption-eng.tex, and caption-rus.tex.
%
% \fi
-% \CheckSum{190}
+% \CheckSum{366}
%
% \iffalse
%<*driver>
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesFile{bicaption.drv}[2010/09/19 v1.0 Adds a bilingual caption feature to the caption package]
+\ProvidesFile{bicaption.drv}[2011/09/03 v1.0 Adds a bilingual caption feature to the caption package]
\hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up.
%\errorcontextlines=3
%
@@ -263,20 +263,41 @@
% \DescribeMacro\bicaption
% Bilingual captions will be typeset by
% \begin{quote}
-% |\bicaption|\oarg{list entry}\marg{heading \#1}\marg{heading \#2}\\
+% |\bicaption|\oarg{list entry \#1}\marg{heading \#1}\\
+% | |\oarg{list entry \#2}\marg{heading \#2}\\
% |\bicaption*|\marg{heading \#1}\marg{heading \#2}
% \end{quote}
% The |\label| should be placed either after this command, or inside the first heading.
%
+% \DescribeMacro\bicaptionbox
+% Bilingual caption boxes will be typeset by
+% \begin{quote}
+% |\bicaptionbox|\oarg{list entry \#1}\marg{heading \#1}\\
+% | |\oarg{list entry \#2}\marg{heading \#2}\\
+% | |\oarg{width}\oarg{inner-pos}\marg{contents}\\
+% |\bicaptionbox*|\marg{heading \#1}\marg{heading \#2}\\
+% | |\oarg{width}\oarg{inner-pos}\marg{contents}
+% \end{quote}
+% The |\label| should be placed inside the first heading.
+%
+% \begingroup\small
+% (For a description of the optional parameters \meta{width} and \meta{inner-pos}
+% please take a look at the \package{caption} package documentation,
+% \cs{captionbox}.)
+% \endgroup
+%
% \bigskip
%
% If the \package{subcaption} package is loaded, these commands are available
% additionally:
%
+% \smallskip
+%
% \DescribeMacro\bisubcaption
% Bilingual sub-captions will be typeset by
% \begin{quote}
-% |\bisubcaption|\oarg{list entry}\marg{heading \#1}\marg{heading \#2}\\
+% |\bisubcaption|\oarg{list entry \#1}\marg{heading \#1}\\
+% | |\oarg{list entry \#2}\marg{heading \#2}\\
% |\bisubcaption*|\marg{heading \#1}\marg{heading \#2}
% \end{quote}
% The |\label| should be placed either after this command, or inside the first heading.
@@ -284,14 +305,22 @@
% \DescribeMacro\bisubcaptionbox
% Bilingual sub-caption boxes will be typeset by
% \begin{quote}
-% |\subcaptionbox|\oarg{list entry}\marg{heading \#1}\marg{heading \#2}\\
-% | |\oarg{width}\oarg{inner-pos}\marg{contents}\\
-% |\subcaptionbox*|\marg{heading \#1}\marg{heading \#2}\\
-% | |\oarg{width}\oarg{inner-pos}\marg{contents}
+% |\bisubcaptionbox|\oarg{list entry \#1}\marg{heading \#1}\\
+% | |\oarg{list entry \#2}\marg{heading \#2}\\
+% | |\oarg{width}\oarg{inner-pos}\marg{contents}\\
+% |\bisubcaptionbox*|\marg{heading \#1}\marg{heading \#2}\\
+% | |\oarg{width}\oarg{inner-pos}\marg{contents}
% \end{quote}
% The |\label| should be placed inside the first heading.
%
-% \subsection{An example code}
+% \begingroup\small
+% (For a description of the optional parameters \meta{width} and \meta{inner-pos}
+% please take a look at the \package{subcaption} package documentation,
+% \cs{subcaptionbox}.)
+% \endgroup
+%
+% \PageBreak
+% \subsection{A sample document}
%
% \begin{quote}
% |\documentclass[english,ngerman]{article}|\\
@@ -300,14 +329,18 @@
% ||\\
% |\usepackage{babel}|\\
% |\usepackage[lang=english,font=it]{bicaption}|\\
+% \iffalse
% |\usepackage[format=hang,list=on]{subcaption}|\\
+% \else
+% |\usepackage[format=hang]{subcaption}|\\
+% \fi
% ||\\
% |\begin{document}|\\
% ||\\
-% \iffalse
+% \iffalse
% |\listoffigures|\\
% ||\\
-% \fi
+% \fi
% |\begin{figure}[!htb]|\\
% | \centering|\\
% | \bisubcaptionbox|\\
@@ -321,7 +354,7 @@
% | \label{fig:test}|\\
% |\end{figure}|\\
% ||\\
-% \iffalse
+% \iffalse
% |\captionsetup{bi-lang=2nd}|\\
% ||\\
% |\begin{figure}[!htb]|\\
@@ -336,8 +369,8 @@
% | \bicaption{Deutscher Titel}{English Title}|\\
% | \label{fig:test2}|\\
% |\end{figure}|\\
-% \fi
% ||\\
+% \fi
% |\captionsetup{bi-lang=both}|\\
% ||\\
% |\begin{figure}[!htb]|\\
@@ -389,9 +422,10 @@
% | {Short English heading}|\\
% |\end{figure}|\\
% ||\\
-% |\end{document}|\\
+% |\end{document}|
% \end{quote}
%
+% \PageBreak
% \captionsetup[bi-first]{lang=german}
% \captionsetup[bi-second]{lang=english,font=it}
% \captionsetup[sub]{format=hang,list=on}
@@ -482,6 +516,119 @@
% {Short English heading}
% \end{figure}
%
+% \PageBreak
+% \subsection{Customising lists}
+%
+% \DescribeMacro{list=}
+% As default both caption texts will be insert into the List of Figures resp. List of Tables.
+% To suppress the second entry just pass the option |list=off| to the \package{bicaption}
+% package, e.g.:
+% \begin{quote}
+% |\usepackage[lang=english,|\ldots|,list=off]{bicaption}|
+% \end{quote}
+%
+% \pagebreak[3]
+% \DescribeMacro{listtype+=}
+% Another option is separating the lists. For that purpose the option
+% \begin{quote}
+% |listtype+=|\meta{list type extension}
+% \end{quote}
+% can be used to tell the \package{bicaption} package to use a different list
+% for the second caption text.
+% The given value will be appended to the current environment type;
+% for example with |listtype+=X| the list entries will be put into the list
+% responsible for the types
+% |figureX| ($=$ |figure| $+$ |X|), |tableX| ($=$ |table| $+$ |X|) etc.
+%
+% Such a \meta{list type} can be defined using |\Declare|\-|Caption|\-|Type|
+% offered by the \package{caption} package, but some document classes
+% or other packages offer macros for defining new floating environment types
+% (and their corresponding lists) as well.
+%
+% A sample document:
+% \begin{quote}
+% |\documentclass[a4paper]{article}|\\
+% ||\\
+% |% Use "ngerman" as 1st language, "english" as 2nd one|\\
+% |\usepackage[english,ngerman]{babel}|\\
+% ||\\
+% |% Load the bicaption package with 2nd language set to|\\
+% |% "english", and list type "figureEng" resp. "tableEng"|\\
+% |\usepackage[lang=english,listtype+=Eng]{bicaption}|\\
+% ||\\
+% |% Define the new floating environment type "figureEng"|\\
+% |\DeclareCaptionType[fileext=lof2]{figureEng}|\\
+% | [Figure][List of Figures]|\\
+% |% Define the new floating environment type "tableEng"|\\
+% |\DeclareCaptionType[fileext=lot2]{tableEng}|\\
+% | [Table][List of Tables]|\\
+% ||\\
+% |\begin{document}|\\
+% |\listoffigures % typeset "Abbildungsverzeichnis"|\\
+% |\listoffigureEnges % typeset "List of Figures"|\\
+% ||\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | A placeholder for an image or whatever|\\
+% | \bicaption{Deutscher Text}{English text}|\\
+% |\end{figure}|\\
+% ||\\
+% |\end{document}|
+% \end{quote}
+%
+% \pagebreak[3]
+% A different approach is using one list for both languages, but with different formatting.
+% Since the \package{caption} package does not offer options and commands for
+% customising the format of the lists, one need an additional package for this purpose,
+% for example the \package{titletoc} package:
+%
+% \begin{quote}
+% |\documentclass[a4paper]{article}|\\
+% ||\\
+% |% Use "ngerman" as 1st language, "english" as 2nd one|\\
+% |\usepackage[english,ngerman]{babel}|\\
+% ||\\
+% |% Load the bicaption package with 2nd language set to|\\
+% |% "english", and list type "figure2" resp. "table2"|\\
+% |\usepackage[lang=english,listtype+=2]{bicaption}|\\
+% ||\\
+% |% We load the titletoc package for customizing lists|\\
+% |% Note: Loading titletoc should be done prior defining|\\
+% |% additional floating environments with \DeclareCaptionType|\\
+% |\usepackage{titletoc}|\\
+% ||\\
+% |% Define the new floating environment type "figure2"|\\
+% |% Use the same file extension as for "figure" (.lof) here|\\
+% |\DeclareCaptionType[fileext=lof]{figure2}|\\
+% |% Define the new floating environment type "table2"|\\
+% |% Use the same file extension as for "table" (.lot) here|\\
+% |\DeclareCaptionType[fileext=lot]{table2}|\\
+% ||\\
+% |% We use the titletoc package for customizing "figure2"|\\
+% |% which is appropriate for the second language captions|\\
+% \iffalse
+% |\contentsuse{figure2}{lof}|\\
+% \fi
+% |\titlecontents{figure2}[3.8em]|\\
+% | {} % no above code|\\
+% | {} % empty numbered entry format|\\
+% | {} % empty numberless entry format|\\
+% | {} % empty filler page format|\\
+% ||\\
+% |\begin{document}|\\
+% |\renewcommand\listfigurename|\\
+% | {Abbildungsverzeichnis / List of Figures}|\\
+% |\listoffigures|\\
+% ||\\
+% |\begin{figure}|\\
+% | \centering|\\
+% | A placeholder for an image or whatever|\\
+% | \bicaption{Deutscher Text}{English text}|\\
+% |\end{figure}|\\
+% ||\\
+% |\end{document}|
+% \end{quote}
+%
% \iffalse
% --------------------------------------------------------------------------- %
% \fi
@@ -567,9 +714,19 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{bicaption}[2011/08/12 v0.9b Bilingual Captions (AR)]
-\RequirePackage{caption}[2011/08/12] % needs v3.2a or newer
+\ProvidesPackage{bicaption}[2011/09/03 v1.0 Bilingual Captions (AR)]
+% \end{macrocode}
+% \begin{macrocode}
+\RequirePackage{caption}[2011/08/28] % needs v3.2c or newer
% \end{macrocode}
+% \changes{v1.0}{2011/09/01}{Compatibility error added}
+% \begin{macrocode}
+\caption@AtBeginDocument{\caption@ifcompatibility{%
+ \caption@Error{%
+ The `bicaption' package does not work correctly\MessageBreak
+ in compatibility mode}}{}}
+% \end{macrocode}
+%
% \bigskip
%
% \pagebreak[3]
@@ -650,17 +807,24 @@
% \end{macrocode}
%
% \begin{macro}{\bicaption@selectlanguage}
+% \changes{v1.0}{2011/08/31}{Starred variant added}
% Set the language via \cs{selectlanguage}.
% \begin{macrocode}
\newcommand*\bicaption@selectlanguage{%
+ \@ifstar
+ {\bicaption@select@language\select@language}
+ {\bicaption@select@language\selectlanguage}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\bicaption@select@language[1]{%
\caption@ifundefined\bicaption@language{}{%
- \expandafter\selectlanguage\expandafter{\bicaption@language}}}
+ \expandafter#1\expandafter{\bicaption@language}}}
% \end{macrocode}
% |\caption@applyfont| (of the \package{caption} package kernel) will be extended here
% so the language setting will actually take effect.
% \begin{macrocode}
\g@addto@macro\caption@applyfont{%
- \bicaption@selectlanguage}
+ \bicaption@selectlanguage*}
% \end{macrocode}
% \begin{macrocode}
\g@addto@macro\caption@prepareslc{%
@@ -695,6 +859,61 @@
% \pagebreak[3]
% \subsection{Main code}
%
+% \begin{macro}{\caption@kernel@addcontentsline}
+% \changes{v1.0}{2011/08/31}{Redefinition of \cs{caption@kernel@addcontentsline} added}
+% We patch \cs{caption@kernel@addcontentsline} (of the \package{caption} package kernel)
+% so \cs{bicaption@addcontentsline} will be used for bilingual captions instead.
+% \begin{macrocode}
+\let\caption@kernel@addcontentsline@ORI\caption@kernel@addcontentsline
+\renewcommand*\caption@kernel@addcontentsline[2]{%
+ \caption@ifundefined\bicaption@lentry
+ {\caption@kernel@addcontentsline@ORI{#1}{#2}}%
+ {\expandafter\bicaption@addcontentsline\expandafter{\bicaption@lentry}{#1}{#2}%
+ \global\let\bicaption@lentry\@undefined}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bicaption@addcontentsline}
+% \changes{v1.0}{2011/08/31}{This macro added}
+% |\bicaption@addcontentsline|\marg{list entry \#2}\marg{type}\marg{list entry \#1}\par
+% Typeset both captions using the original version of \cs{caption@addcontentsline}.
+% \begin{macrocode}
+\newcommand\bicaption@addcontentsline[3]{%
+ \begingroup
+% \end{macrocode}
+% Execute the options setup with |\captionsetup[bi]{|\ldots|}|.
+% \begin{macrocode}
+ \caption@setoptions{bi}%
+% \end{macrocode}
+% Do the first list entry, if requested.
+% \begin{macrocode}
+ \ifnum\bicaption@lang=2\relax \else
+ \begingroup
+ \caption@setoptions{bi-first}%
+ \bicaption@@addcontentsline{#2}{#3}%
+ \endgroup
+ \fi
+% \end{macrocode}
+% Do the second list entry, if requested.
+% \begin{macrocode}
+ \ifnum\bicaption@lang=1\relax \else
+ \begingroup
+ \caption@setoptions{bi-second}%
+ \bicaption@@addcontentsline{#2}{#1}%
+ \endgroup
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \endgroup}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\bicaption@@addcontentsline[2]{%
+ \caption@ifcontentsline{#2}{%
+ \bicaption@selectlanguage\relax
+ \caption@kernel@addcontentsline@ORI{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\caption@@make}
% We patch \cs{caption@@make} (of the \package{caption} package kernel)
% so \cs{bicaption@@make} will be used for bilingual captions instead.
@@ -703,14 +922,13 @@
\renewcommand\caption@@make[2]{%
\caption@ifundefined\bicaption@text
{\caption@@make@ORI{#1}{#2}}%
- {\bicaption@@make{#1}{#2}{\bicaption@text}%
- \global\let\bicaption@label\@undefined
+ {\expandafter\bicaption@@make\expandafter{\bicaption@text}{#1}{#2}%
\global\let\bicaption@text\@undefined}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bicaption@@make}
-% |\bicaption@@make|\marg{label}\marg{text \#1}\marg{text \#2}\par
+% |\bicaption@@make|\marg{text \#2}\marg{label}\marg{text \#1}\par
% Typeset both captions using the original version of \cs{caption@@make}.
% \begin{macrocode}
\newcommand\bicaption@@make[3]{%
@@ -723,9 +941,9 @@
% \begin{macrocode}
\ifnum\bicaption@lang=0\relax
\bicaption@ifslc
- {\caption@@slc{#1}{#2}{\captionwidth}{}%
+ {\caption@@slc{#2}{#3}{\captionwidth}{}%
{\caption@set@bool\caption@ifslc0}%
- \caption@@slc{#1}{#3}{\captionwidth}{}%
+ \caption@@slc{#2}{#1}{\captionwidth}{}%
{\caption@set@bool\caption@ifslc0}}%
{}%
\fi
@@ -734,13 +952,12 @@
% (Otherwise we only apply the label of it.)
% \begin{macrocode}
\ifnum\bicaption@lang=2\relax
- \ifx\bicaption@label\@empty\else
- \expandafter\label\expandafter{\bicaption@label}%
- \fi
+ \bicaption@label
+ \global\let\bicaption@label\relax
\else
\begingroup
\caption@setoptions{bi-first}%
- \caption@@make@ORI{#1}{#2}%
+ \caption@@make@ORI{#2}{#3}%
\endgroup
\fi
% \end{macrocode}
@@ -750,61 +967,165 @@
\else
\begingroup
\caption@setoptions{bi-second}%
- \caption@@make@ORI{#1}{#3}%
+ \caption@@make@ORI{#2}{#1}%
\endgroup
\fi}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\bicaption@setup}
-% |\bicaption@setup|\marg{text \#1}\marg{text \#2}\par
-% Initiates the bilingual caption typesetting by extracting the |\label|
-% of the first text and storing the second text into |\bicaption@text|.
-% \begin{macrocode}
-\newcommand\bicaption@setup[2]{%
- \bicaption@getlabel#1\label{}\@nil
- \global\long\def\bicaption@text{\ignorespaces#2}}
-\long\def\bicaption@getlabel#1\label#2#3\@nil{%
- \global\def\bicaption@label{#2}}
-% \end{macrocode}
-% \end{macro}
-%
% \pagebreak[3]
% \subsubsection{The \cs{bicaption} commands}
%
-% \begin{macro}{\@bicaption}
+% \begin{macro}{\bicaption}
+% |\bicaption*|\oarg{list entry \#1}\marg{text \#1}\oarg{list entry \#2}\marg{text \#2}
% \begin{macrocode}
-\newcommand*\@bicaption[1]{%
- \let\bicaption@cmd#1%
- \caption@withoptargs\@@bicaption}
-\newcommand\@@bicaption[3]{%
- \bicaption@ifswap
- {\bicaption@setup{#2}{#2}%
- \bicaption@cmd#1{#3}}%
- {\bicaption@setup{#2}{#3}%
- \bicaption@cmd#1{#2}}}
+\newcommand\bicaption{\@bicaption\caption}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\bicaption}
-% |\bicaption*|\oarg{list entry}\marg{text \#1}\marg{text \#2}
+% \begin{macro}{\bicaptionbox}
+% \changes{v1.0}{2011/08/31}{This macro added}
+% |\bicaptionbox*|\oarg{entry \#1}\marg{text \#1}\oarg{entry \#2}\marg{text \#2}%
+% \oarg{\ldots}\marg{\ldots}
% \begin{macrocode}
-\newcommand\bicaption{\@bicaption\caption}
+\newcommand\bicaptionbox{\@bicaption\captionbox}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bisubcaption}
-% |\bisubcaption*|\oarg{list entry}\marg{text \#1}\marg{text \#2}
+% |\bisubcaption*|\oarg{list entry \#1}\marg{text \#1}\oarg{list entry \#2}\marg{text \#2}
% \begin{macrocode}
\newcommand\bisubcaption{\@bicaption\subcaption}
+\let\subbicaption\bisubcaption
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bisubcaptionbox}
-% |\bisubcaptionbox*|\oarg{list entry}\marg{text \#1}\marg{text \#2}%
+% |\bisubcaptionbox*|\oarg{entry \#1}\marg{text \#1}\oarg{entry \#2}\marg{text \#2}%
% \oarg{\ldots}\marg{\ldots}
% \begin{macrocode}
\newcommand\bisubcaptionbox{\@bicaption\subcaptionbox}
+\let\subbicaptionbox\bisubcaptionbox
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@bicaption}
+% \changes{v1.0}{2011/08/31}{Optional parameter \meta{list entry \#2} added}
+% |\@bicaption|\marg{cmd}*\oarg{entry \#1}\marg{text \#1}\oarg{entry \#2}\marg{text \#2}\ldots
+% \begin{macrocode}
+\newcommand*\@bicaption[1]{%
+ \def\bicaption@cmd{#1}%
+ \@ifstar
+ {\l@addto@macro\bicaption@cmd*%
+ \@@bicaption}%
+ {\caption@dblarg\@@@bicaption}}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\@@bicaption[1]{%
+ \@@@@bicaption{}{#1}[]}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\@@@bicaption[#1]#2{%
+ \caption@dblarg{\@@@@bicaption{#1}{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\@@@@bicaption#1#2[#3]#4{%
+ \bicaption@getlabel#2\label{}\@nil
+ \bicaption@ifswap
+ {\bicaption@setup{#1}{#2}%
+ \bicaption@cmd[{#3}]{#4}}%
+ {\bicaption@setup{#3}{#4}%
+ \bicaption@cmd[{#1}]{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bicaption@getlabel}
+% \changes{v1.0}{2011/09/03}{\cs{label} can have optional arguments now}
+% Gets the label command out of the (first) caption text and stores it to |\bicaption@label|.
+% \begin{macrocode}
+\long\def\bicaption@getlabel#1\label#2#3\@nil{%
+ \def\@tempa{#2}%
+ \ifx\@tempa\@empty
+ \let\bicaption@label\relax
+ \else
+ \def\@tempb{*}%
+ \ifx\@tempa\@tempb
+ \def\bicaption@label{\label*}%
+ \bicaption@@getlabel#3\@nil
+ \else
+ \def\bicaption@label{\label}%
+ \bicaption@@getlabel{#2}#3\@nil
+ \fi
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\bicaption@@getlabel#1#2\@nil{%
+ \def\@tempa{#1}%
+ \def\@tempb{[}%
+ \ifx\@tempa\@tempb
+ \bicaption@@@getlabel#1#2\@nil
+ \else
+ \l@addto@macro\bicaption@label{{#1}}%
+ \fi}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\bicaption@@@getlabel[#1]#2\@nil{%
+ \l@addto@macro\bicaption@label{[{#1}]}%
+ \bicaption@@getlabel#2\@nil}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bicaption@setup}
+% |\bicaption@setup|\marg{list-entry}\marg{text}\par
+% Initiates the bilingual caption typesetting by storing the extra texts into
+% |\bi|\-|caption@l|\-|entry| and |\bi|\-|caption@text|.
+% \begin{macrocode}
+\newcommand\bicaption@setup[2]{%
+ \def\bicaption@lentry{#1}%
+ \def\bicaption@text{\ignorespaces#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@freeze}
+% \changes{v1.0}{2011/08/31}{Redefinition of \cs{caption@freeze} added}
+% To make |\bicaption| work inside |SCfigure| and |FPfigure| environments we need to add
+% |\bi|\-|caption| to |\caption@freeze|.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifx\caption@freeze\@undefined \else
+ \g@addto@macro\caption@freeze{%
+ \let\caption@frozen@bicaption\bicaption
+ \def\bicaption{%
+ \caption@withoptargs\caption@SC@bicaption}%
+ \long\def\caption@SC@bicaption#1#2{%
+ \@ifnextchar[%]
+ {\caption@SC@bi@caption{#1}{#2}}%
+ {\caption@SC@bi@caption@{#1}{#2}}}%
+ \long\def\caption@SC@bi@caption#1#2[#3]#4{%
+ \caption@@freeze{\bicaption#1{#2}[{#3}]{#4}}%
+ \ignorespaces}%
+ \long\def\caption@SC@bi@caption@#1#2#3{%
+ \caption@@freeze{\bicaption#1{#2}{#3}}%
+ \ignorespaces}%
+ \l@addto@macro\caption@warmup{%
+ \let\bicaption\caption@frozen@bicaption}}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bicaption@listof}
+% Make commands like |\listoffigure2s| work.
+% \begin{macrocode}
+\def\bicaption@declarelist#1{\@namedef{listof#1}{\bicaption@listof#1}}
+\@onlypreamble\bicaption@declarelist
+\def\bicaption@listof#1 {\@nameuse{listof#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\caption@ifundefined\c@figure{}{\bicaption@declarelist{figure}}
+\caption@ifundefined\c@table{}{\bicaption@declarelist{table}}
+\caption@For{typelist}{\bicaption@declarelist{#1}}
+% \end{macrocode}
+% \begin{macrocode}
% \end{macrocode}
% \end{macro}
%