summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-07-21 21:39:45 +0000
committerKarl Berry <karl@freefriends.org>2020-07-21 21:39:45 +0000
commitc2672b946257e59e864cb7029db18d05630b7bc2 (patch)
tree9723cf1a33fe92ac5a53f284e2b7b985938a69a1 /Master/texmf-dist/source
parent24f85a1e21564b541c4118b87d4bda16783c9cb1 (diff)
caption (21jul20)
git-svn-id: svn://tug.org/texlive/trunk@55900 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/caption/caption3.dtx74
1 files changed, 50 insertions, 24 deletions
diff --git a/Master/texmf-dist/source/latex/caption/caption3.dtx b/Master/texmf-dist/source/latex/caption/caption3.dtx
index 031c84fa67c..8edc856461b 100644
--- a/Master/texmf-dist/source/latex/caption/caption3.dtx
+++ b/Master/texmf-dist/source/latex/caption/caption3.dtx
@@ -28,7 +28,7 @@
% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
% \fi
-% \CheckSum{3585}
+% \CheckSum{3606}
%
% \iffalse
%<*driver>
@@ -191,7 +191,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2020/07/19 v1.12a caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2020/07/20 v1.12b caption3 kernel (AR)]
% \end{macrocode}
%
% \section{Workaround for bug in package \package{arabtex}}
@@ -742,14 +742,15 @@
% \begin{macrocode}
\newcommand*\@captionsetup[1]{%
\captionsetup@startrue#1\captionsetup@starfalse
- \@ifnextchar[\caption@setup@options\caption@setup}
+ \@ifnextchar[%]
+ \caption@setup@options\caption@setup}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@setup{\caption@setkeys{caption}}
% \end{macrocode}
% \begin{macrocode}
\def\caption@setup@options[#1]{%
- \@ifnextchar[%
+ \@ifnextchar[%]
{\caption@stepthecounter
\caption@withoptargs{\@expandtwoargs
\caption@setup@options@i{#1}{@\caption@thecounter}}}%
@@ -3635,6 +3636,7 @@
% \changes{v1.8}{2018/05/16}{Redefinition of \cs{acused} added}
% \changes{v1.8}{2018/05/26}{Definition method changed so it can be pre-defined by other packages}
% \changes{v1.8}{2018/05/27}{Redefinition of \cs{hypertarget} added}
+% \changes{v1.12b}{2020/07/20}{Special adaption to \class{beamer} added}
% |\caption@prepareslc|\par
% Re-define anything which would disturb the single-line-check.
% \begin{macrocode}
@@ -3643,16 +3645,32 @@
\let\label\caption@gobble
\let\hypertarget\@gobbletwo
% \end{macrocode}
+% We re-define \cs{footnote} so
+% \begin{enumerate}
+% \item The footnote counter will not be increased twice (but still the correct footnote mark will be used within the single-line-check)
+% \item The footnote text will not be evaluated twice
+% \end{enumerate}
% \begin{macrocode}
- \let\caption@endnotemark@ORI\endnotemark
+ \let\caption@footnote@ORI\footnote
+ \def\footnote{\caption@withoptargs\caption@footnote}%
+ \let\caption@footnotemark@ORI\footnotemark
+ \def\footnotemark{\caption@withoptargs\caption@footnotemark}%
+ \let\caption@footnotetext@ORI\@footnotetext
+ \let\@footnotetext\caption@gobble
+% \end{macrocode}
+% Same for \cs{endnote}
+% \begin{macrocode}
+ \let\caption@endnote@ORI\endnote
\def\endnote{\caption@withoptargs\caption@endnote}%
+ \let\caption@endnotemark@ORI\endnotemark
\def\endnotemark{\caption@withoptargs\caption@endnotemark}%
+ \let\caption@endnotetext@ORI\@endnotetext
\let\@endnotetext\caption@gobble
% \end{macrocode}
% \begin{macrocode}
\let\pagenote\caption@gobble
% \end{macrocode}
-% Adaption to the \package{acronym} package.\par
+% Adaption to the \package{acronym} package\par
% See also \url{https://tex.stackexchange.com/questions/428788}
% \begin{macrocode}
\let\acused\@gobble
@@ -3671,43 +3689,50 @@
% \begin{macrocode}
}
% \end{macrocode}
-%
-% The following patch of \cs{footnote} assumes that the optional arguments of
-% \cs{footnote} and \cs{footnotemark} match. Since this is not the case in
-% \class{beamer} based documents, and since \class{beamer} extents the
-% syntax of \cs{footnote} in a way we don't support, we don't apply the patch there.
-% \begin{macrocode}
-\caption@ifclassloaded{beamer}{}{%
- \g@addto@macro\caption@prepareslc{%
- \let\caption@footnote@ORI\footnote
- \def\footnote{\caption@withoptargs\caption@footnote}%
- \let\caption@footnotemark@ORI\footnotemark
- \def\footnotemark{\caption@withoptargs\caption@footnotemark}%
- \let\caption@footnotetext@ORI\@footnotetext
- \let\@footnotetext\caption@gobble}}
-% \end{macrocode}
% \begin{macrocode}
\newcommand\caption@footnote[2]{%
\caption@footnotemark{#1}}
+% \end{macrocode}
+% \begin{macrocode}
\newcommand\caption@footnotemark[1]{%
\begingroup
\let\stepcounter\caption@l@stepcounter
- \caption@footnotemark@ORI#1%
+ \caption@footnotemark@ORI#1\relax
\endgroup}
% \end{macrocode}
% \begin{macrocode}
\newcommand\caption@endnote[2]{%
\caption@endnotemark{#1}}
+% \end{macrocode}
+% \begin{macrocode}
\newcommand\caption@endnotemark[1]{%
\begingroup
\let\stepcounter\caption@l@stepcounter
- \caption@endnotemark@ORI#1
+ \caption@endnotemark@ORI#1\relax
\endgroup}
% \end{macrocode}
% \begin{macrocode}
\newcommand*\caption@l@stepcounter[1]{%
\advance\csname c@#1\endcsname\@ne\relax}
% \end{macrocode}
+% The patch above assumes that the optional arguments of \cs{footnote} and
+% \cs{footnotemark} match. Since this is not the case in \class{beamer} based documents,
+% and since \class{beamer} extents the syntax of \cs{footnote} in a special way,
+% we need a special patch here.\par
+% \emph{Note:} For this patch we assume that \cs{footnote} will always end with the usage of
+% \cs{beamer@footnotetext}. (Unfortunately \cs{footnote} is defined too monolithic
+% in \class{beamer} to offer a less dirty patch.)
+% \begin{macrocode}
+\caption@ifclassloaded{beamer}{%
+ \g@addto@macro\caption@prepareslc{%
+ \def\footnote{%
+ \begingroup
+ \let\stepcounter\caption@l@stepcounter
+ \renewcommand<>\beamer@framefootnotetext[1]{%
+ \endgroup}%
+ \let\@footnotetext\beamer@framefootnotetext
+ \caption@footnote@ORI}}}{}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\caption@applyfont}
@@ -4113,7 +4138,8 @@
% |\caption@For|\marg{elt-list}\marg{code with \#1}\\
% |\caption@For*|\marg{elt-list}\marg{code with \#1}
% \begin{macrocode}
-\newcommand*\caption@For{\caption@withoptargs\caption@@For}
+\newcommand*\caption@For{%
+ \caption@withoptargs\caption@@For}
%\@onlypreamble\caption@For
% \end{macrocode}
% \begin{macrocode}