summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/caption/bicaption.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-02-03 23:00:45 +0000
committerKarl Berry <karl@freefriends.org>2016-02-03 23:00:45 +0000
commitc2b77b4b887eba9dfa698b9a70e5e73b0f5bbcfa (patch)
tree208536948ab3c4efa6e3eafe32bac014b50df900 /Master/texmf-dist/source/latex/caption/bicaption.dtx
parent155385f13efe07d552563c30de184f94da15704b (diff)
caption (3feb16)
git-svn-id: svn://tug.org/texlive/trunk@39562 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.dtx93
1 files changed, 78 insertions, 15 deletions
diff --git a/Master/texmf-dist/source/latex/caption/bicaption.dtx b/Master/texmf-dist/source/latex/caption/bicaption.dtx
index 728948065e8..5975f9561d2 100644
--- a/Master/texmf-dist/source/latex/caption/bicaption.dtx
+++ b/Master/texmf-dist/source/latex/caption/bicaption.dtx
@@ -2,10 +2,10 @@
%
% This is file `bicaption.dtx'.
%
-% $Id: bicaption.dtx 111 2015-09-17 09:48:20Z sommerfeldt $
+% $Id: bicaption.dtx 136 2016-02-02 09:41:30Z sommerfeldt $
% $HeadURL: svn+ssh://sommerfeldt@svn.code.sf.net/p/latex-caption/code/branches/3.3/source/bicaption.dtx $
%
-% Copyright (C) 2010-2015 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+% Copyright (C) 2010-2016 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -28,7 +28,7 @@
% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%
% \fi
-% \CheckSum{330}
+% \CheckSum{393}
%
% \iffalse
%<*driver>
@@ -797,11 +797,11 @@
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${%
\def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }}
-\caption@tempa $Id: bicaption.dtx 111 2015-09-17 09:48:20Z sommerfeldt $
+\caption@tempa $Id: bicaption.dtx 136 2016-02-02 09:41:30Z sommerfeldt $
\ProvidesPackage{bicaption}[\caption@tempa v1.1-\caption@tempb Bilingual Captions (AR)]
% \end{macrocode}
% \begin{macrocode}
-\RequirePackage{caption}[2015/09/01] % needs v3.3 or newer
+\RequirePackage{caption}[2016/02/01] % needs v3.3-134 or newer
% \end{macrocode}
% \changes{v1.0}{2011/09/01}{Compatibility error added}
% \begin{macrocode}
@@ -981,11 +981,19 @@
% \begin{macro}{\caption@addcontentsline}
% \changes{v1.0}{2011/08/31}{Redefinition of \cs{caption@kernel@addcontentsline} added}
% \changes{v1.0b}{2012/01/15}{\cs{caption@kernel@addcontentsline} changed to \cs{caption@addcontentsline}}
+% \changes{v1.1}{2016/02/01}{Adaption to \package{longtable} package added}
% We patch |\caption@add|\-|contents|\-|line| (of the \package{caption} package kernel)
% so |bi|\-|caption@add|\-|contents|\-|line| will be used for bilingual captions instead.
% \begin{macrocode}
\let\bicaption@addcontentsline@ORI\caption@addcontentsline
\renewcommand*\caption@addcontentsline[2]{%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@ifundefined\bicaption@LT@setup{}{%
+ \bicaption@LT@setup
+ \global\let\bicaption@LT@setup\@undefined}%
+% \end{macrocode}
+% \begin{macrocode}
\caption@ifundefined\bicaption@lentry
{\bicaption@addcontentsline@ORI{#1}{#2}}%
{\expandafter\bicaption@addcontentsline\expandafter
@@ -1039,16 +1047,20 @@
% \end{macro}
%
% \begin{macro}{\caption@@make}
-% We patch |\caption@@make| (of the \package{caption} package kernel)
+% We redefine |\caption@@make| (of the \package{caption} package kernel)
% so |\bi|\-|caption@@make| will be used for bilingual captions instead.
% \begin{macrocode}
-\let\caption@@make@ORI\caption@@make
\renewcommand\caption@@make[2]{%
\caption@ifundefined\bicaption@text
- {\caption@@make@ORI{#1}{#2}}%
+ {\begingroup
+ \caption@@make@{#1}{#2}%
+ \endgroup}%
{\expandafter\bicaption@@make\expandafter
{\bicaption@text}{#1}{#2}%
- \global\let\bicaption@text\@undefined}}
+ \global\let\bicaption@text\@undefined}%
+% \end{macrocode}
+% \begin{macrocode}
+ \caption@@make@epilogue}
% \end{macrocode}
% \end{macro}
%
@@ -1081,7 +1093,7 @@
\else
\begingroup
\caption@setoptions{bi-first}%
- \caption@@make@ORI{#2}{#3}%
+ \caption@@make@{#2}{#3}%
\endgroup
\fi
% \end{macrocode}
@@ -1091,9 +1103,10 @@
\else
\begingroup
\caption@setoptions{bi-second}%
- \caption@@make@ORI{#2}{#1}%
+ \caption@@make@{#2}{#1}%
\endgroup
- \fi}
+ \fi
+}
% \end{macrocode}
% \end{macro}
%
@@ -1139,11 +1152,11 @@
% |\@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*%
+ {\def\bicaption@cmd{\bicaption@star{#1}}%
\@@bicaption}%
- {\caption@dblarg\@@@bicaption}}
+ {\def\bicaption@cmd{#1}%
+ \caption@dblarg\@@@bicaption}}
% \end{macrocode}
% \begin{macrocode}
\newcommand\@@bicaption[1]{%
@@ -1162,6 +1175,55 @@
{\bicaption@setup{#3}{#4}%
\bicaption@cmd[{#1}]{#2}}}
% \end{macrocode}
+% \begin{macrocode}
+\long\def\bicaption@star#1[#2]{#1*}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@bicaption}
+% \changes{v1.1}{2016/01/31}{Adaption to \package{longtable} package added}
+% Same as |\@bicaption| but for |longtable| (offered by the \package{longtable} package).
+% |\bicaption@LTsetup| will be executed later on, inside |\LT@makecaption| offered by the \package{caption} package.
+% \begin{macrocode}
+\newcommand\LT@bicaption{%
+ \noalign\bgroup
+ \@ifstar
+ {\gdef\bicaption@cmd{\LT@c@ption\@gobble}%
+ \LT@@bicaption}%
+ {\gdef\bicaption@cmd{\LT@c@ption\@firstofone}%
+ \caption@dblarg\LT@@@bicaption}}
+\newcommand\LT@@bicaption[1]{%
+ \LT@@@@bicaption{}{#1}[]}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\LT@@@bicaption[#1]#2{%
+ \caption@dblarg{\LT@@@@bicaption{#1}{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\LT@@@@bicaption#1#2[#3]#4{%
+ \gdef\bicaption@LTsetup{%
+ \caption@getlabel#2\label{}\@nil
+ \bicaption@LT@setup}%
+ \gdef\bicaption@LT@setup{%
+ \bicaption@ifswap
+ {\bicaption@setup{#1}{#2}}%
+ {\bicaption@setup{#3}{#4}}}%
+ \bicaption@ifswap
+ {\egroup\bicaption@cmd[{#3}]{#4}}%
+ {\egroup\bicaption@cmd[{#1}]{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@LT@setup}
+% \changes{v1.1}{2016/01/31}{Adaption to \package{longtable} package added}
+% Execute the stuff defined by \cs{LT@bicaption} to prepare the typesetting
+% of the \package{longtable} bilingual caption.
+% \begin{macrocode}
+\g@addto@macro\caption@LT@setup{%
+ \caption@ifundefined\bicaption@LTsetup{}{%
+ \bicaption@LTsetup
+ \global\let\bicaption@LTsetup\@undefined}}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bicaption@setup}
@@ -1222,3 +1284,4 @@
% \Finale
%
\endinput
+