texlive[53291] Master/texmf-dist: caption (1jan20)
commits+karl at tug.org
commits+karl at tug.org
Wed Jan 1 22:50:59 CET 2020
Revision: 53291
http://tug.org/svn/texlive?view=revision&revision=53291
Author: karl
Date: 2020-01-01 22:50:58 +0100 (Wed, 01 Jan 2020)
Log Message:
-----------
caption (1jan20)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/caption/README
trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx
trunk/Master/texmf-dist/source/latex/caption/caption-deu.tex
trunk/Master/texmf-dist/source/latex/caption/caption-eng.tex
trunk/Master/texmf-dist/source/latex/caption/caption-rus.tex
trunk/Master/texmf-dist/source/latex/caption/caption.dtx
trunk/Master/texmf-dist/source/latex/caption/caption.ins
trunk/Master/texmf-dist/source/latex/caption/caption3.dtx
trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx
trunk/Master/texmf-dist/tex/latex/caption/caption.sty
trunk/Master/texmf-dist/tex/latex/caption/caption3.sty
Modified: trunk/Master/texmf-dist/doc/latex/caption/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/caption/README 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/doc/latex/caption/README 2020-01-01 21:50:58 UTC (rev 53291)
@@ -1,8 +1,8 @@
==========================================================================
The `caption' package bundle
-Release 2019-11-24
-Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+Release 2020-01-01
+Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
License: LPPL = LaTeX Project Public Licence
Maintenance Status: maintained (by Axel Sommerfeldt)
Modified: trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/source/latex/caption/bicaption.dtx 2020-01-01 21:50:58 UTC (rev 53291)
@@ -110,12 +110,6 @@
% \newcommand\NEWfeature{\NEW{New feature}}
% \newcommand\NEWdescription{\NEW{New description}}
%
-% \makeatletter
-% \newcommand*\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
-% \newcommand*\@Ref[2]{#1{#2}: \textit{\nameref{#2}}}
-% \makeatother
-% \newcommand*\See[1]{\nopagebreak{\small (See #1)}}
-%
% \GetFileInfo{bicaption.drv}
% \let\docdate\filedate
% \let\docversion\fileversion
Modified: trunk/Master/texmf-dist/source/latex/caption/caption-deu.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-deu.tex 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-deu.tex 2020-01-01 21:50:58 UTC (rev 53291)
@@ -1,9 +1,6 @@
%
% This is file `caption-deu.tex'.
%
-% $Id$
-% $HeadURL$
-%
% Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
%
% --------------------------------------------------------------------------
@@ -172,8 +169,8 @@
{\endlist}
\makeatletter
-\newcommand*\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
-\newcommand*\@Ref[2]{#1{#2}: \textit{\nameref{#2}}}
+\def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
+\def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
\newcommand*\SEE[3][]{\nopagebreak{#1(#2 #3)}}
\newcommand*\SeeUserDefined[1][]{\See{\Ref{declare}#1}}
\makeatother
Modified: trunk/Master/texmf-dist/source/latex/caption/caption-eng.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-eng.tex 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-eng.tex 2020-01-01 21:50:58 UTC (rev 53291)
@@ -1,9 +1,6 @@
%
% This is file `caption-eng.tex'.
%
-% $Id$
-% $HeadURL$
-%
% Copyright (C) 1994-2012 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
%
% --------------------------------------------------------------------------
@@ -165,8 +162,8 @@
{\endlist}
\makeatletter
-\newcommand*\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
-\newcommand*\@Ref[2]{#1{#2}: \textit{\nameref{#2}}}
+\def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
+\def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
\newcommand*\SEE[3][]{\nopagebreak{#1(#2 #3)}}
\newcommand*\SeeUserDefined[1][]{\See{\Ref{declare}#1}}
\makeatother
Modified: trunk/Master/texmf-dist/source/latex/caption/caption-rus.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption-rus.tex 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/source/latex/caption/caption-rus.tex 2020-01-01 21:50:58 UTC (rev 53291)
@@ -2,9 +2,6 @@
% This is file `caption-rus.tex'.
% Russian translation of `caption-eng.tex'
%
-% $Id$
-% $HeadURL$
-%
% Copyright (C) 1994-2007 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
%
% --------------------------------------------------------------------------
@@ -196,8 +193,8 @@
{\endlist}
\makeatletter
-\newcommand*\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
-\newcommand*\@Ref[2]{#1{#2}: \textit{\nameref{#2}}}
+\def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
+\def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
\newcommand*\SEE[3][]{\nopagebreak{#1(#2 #3)}}
\newcommand*\SeeUserDefined[1][]{\See{\Ref{declare}#1}}
\makeatother
Modified: trunk/Master/texmf-dist/source/latex/caption/caption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption.dtx 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/source/latex/caption/caption.dtx 2020-01-01 21:50:58 UTC (rev 53291)
@@ -2,7 +2,7 @@
%
% This is file `caption.dtx'.
%
-% Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
%
% --------------------------------------------------------------------------
%
@@ -25,7 +25,7 @@
% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%
% \fi
-% \CheckSum{2974}
+% \CheckSum{3006}
%
% \iffalse
%<*driver>
@@ -215,13 +215,13 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2019/10/18 v3.4a Customizing captions (AR)]
+\ProvidesPackage{caption}[2020/01/01 v3.4c Customizing captions (AR)]
% \end{macrocode}
%
% \section{Loading the kernel}
%
% \begin{macrocode}
-\RequirePackage{caption3}[2019/09/09] % needs v1.8e or newer
+\RequirePackage{caption3}[2019/12/31] % needs v1.8f or newer
% \end{macrocode}
%
% \section{Check against unknown document classes}
@@ -1311,15 +1311,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption at typehook}
-% Hook which will be used inside |\caption at set|\-|type|.
-% It will be extended later on, e.g.~by our \package{float} package
-% support.
-% \begin{macrocode}
-\newcommand*\caption at typehook{}
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\caption at iftype}
% \changes{v3.1}{2007/04/11}{This macro and its usage added}
% Since we often need to check if |\@captype| is defined (means: we
@@ -2600,6 +2591,7 @@
% \begin{macro}{\@float at setevery}
% \changes{v3.1k}{2009/10/09}{Bugfix 08-12-05: \cs{color at begin/endgroup} added
% to redefinition of \cs{caption at setfloatcapt}}
+% \changes{v3.4b}{2019/12/16}{Usage of \cs{caption at float@setname} added}
% |\@float at setevery|\marg{float type} is provided by the \package{float}
% package; it's called every time a floating environment defined with
% |\newfloat| or |\restylefloat| begins.
@@ -2648,6 +2640,7 @@
%
% \begin{macrocode}
}{}%
+ \caption at float@setname{#1}%
\caption at freezeHref % will be defrosted in \float at makebox
\caption at ORI@float at setevery{#1}}%
% \end{macrocode}
@@ -2674,8 +2667,9 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\caption at typehook}
+% \begin{macro}{\caption at float@setname}
% \changes{v3.1}{2007/07/08}{float package hook added}
+% \changes{v3.4b}{2019/12/16}{Renamed from \cs{caption at typehook} to \cs{caption at float@setname}}
% \LaTeX\ and almost every other packages use
% |\|\meta{type}|name|
% to provide a macro for the type resp.~environment name -- for example
@@ -2693,7 +2687,7 @@
% \Note{If the float was not defined with \cs{newfloat} but with
% \cs{restylefloat} instead, \cs{fname@}\meta{type} is not defined.}
% \begin{macrocode}
- \g at addto@macro\caption at typehook{%
+ \newcommand*\caption at float@setname[1]{%
\expandafter\ifx\csname #1name\endcsname\relax
\expandafter\let\csname #1name\expandafter\endcsname
\csname fname@#1\endcsname
@@ -3326,27 +3320,65 @@
% \changes{v3.1g}{2008/01/20}{Bugfix: Skips are handled correctly now}
% \changes{v3.1k}{2008/03/29}{Bugfix 08-10-16-dctt: \texttt{rule=0} added}
% \changes{v3.2}{2010/10/26}{Bugfix 10-07-20a: Set \cs{hsize} to \cs{linewidth}, if necessary}
+% \changes{v3.4c}{2020/01/01}{Ugly workaround for usage in lists added}
% To support the \package{listings} package we need to redefine
% |\lst at MakeCaption| so the original stuff is nested with
-% |\caption at begin| and |\caption at end| etc.
-% \Note{This macro is always called twice (with `t' resp. `b' as
-% parameter), therefore we need an extra group here.}
+% |\caption at begin| and |\caption at end| etc.\par
+% Unfortunately |\lst at MakeCaption| is sometimes used with |\linewidth| intact but sometimes with |\linewidth| adapted.
+% So we either could write a bunch of very ugly code which is using internals of the \package{listings} package, or
+% we could simply ignore this fact since |\hsize| will be left untouched by the \package{listings} package.
+% (This is reason why the caption is mis-aligned when using one of the options |linewidth=|, |xleftmargin=|, |yleftmargin=|, or |resetmargins=|,
+% even the \package{caption} package isn't used. This needs to be fixed within the \package{listings} package, for example by using
+% |\lst at MakeCaption| inside a parbox of correct width.)
+%
+% The \package{listings} package calls |\lst at MakeCaption| sometimes with original |\linewidth|, sometimes with adapted |\linewidth|.
+% So we need to detect if |\linewidth| is already adapted or not.
+% We realize this by setting a flag inside the "Init" hook of the \package{listings} package (where the adaption takes place).
% \begin{macrocode}
+%% \caption at setbool{lst at Init}{0}%
+%% \lst at AddToHook{Init}{\caption at setbool{lst at Init}{1}}%
+% \end{macrocode}
+% \begin{macrocode}
\let\caption at ORI@lst at MakeCaption\lst at MakeCaption
\def\lst at MakeCaption#1{% #1 is `t' or `b'
+% \end{macrocode}
+% This macro is always called twice by the \package{listings} package (with `t' resp. `b' as parameter),
+% therefore we need an extra group here.
+% \begin{macrocode}
\begingroup
% \end{macrocode}
-% Workaround for bug in \package{listings} package:
-% If |\hsize| seems not to be set correctly, we set it to |\linewidth|.
-% \changes{v3.3}{2018/04/30}{Bugfix from Ulrike Fischer applied, see also \url{https://github.com/axelsommerfeldt/caption/issues/1}}
% \begin{macrocode}
- \@tempdima\linewidth
- \advance\@tempdima\lst at xleftmargin
- \advance\@tempdima\lst at xrightmargin
- \ifdim\hsize>\@tempdima
- \hsize\@tempdima
- \fi
+%% \caption at Debug{%
+%% linewidth=\lst at linewidth,
+%% xleftmargin=\lst at xleftmargin,\MessageBreak
+%% xrightmargin=\lst at xrightmargin,
+%% resetmargins=\lst at ifresetmargins true\else false\fi}%
% \end{macrocode}
+% If |\linewidth| isn't adapted by the \package{listings} package yet, do the adaption here.
+% \begin{macrocode}
+%% \caption at iflst@Init{}{%\lsthk at PreInit\lsthk at Init => has unwanted side-effects (like an extra horizontal line)
+%% \linewidth\lst at linewidth\relax
+%% \lst at ifresetmargins
+%% \advance\linewidth\@totalleftmargin
+%% \advance\linewidth\rightmargin
+%% \@totalleftmargin\z@
+%% \fi
+%% \advance\linewidth-\lst at xleftmargin
+%% \advance\linewidth-\lst at xrightmargin
+%% \advance\@totalleftmargin\lst at xleftmargin\relax}%
+% \end{macrocode}
+% Inside lists the \package{listings} package ignores the left margin (|\@totalleftmargin|) for captions.
+% We emulate this behaviour by adding a negativ skip which will be typeset ahead of |\caption at box|.\par
+% This does not result in correct justification of the caption, but captions inside listings inside
+% lists are not justified correctly anyway. (Again, this needs to be fixed by the \package{listings} package.)\par
+% Note: We cannot use |\@totalleftmargin| here since it was usually resetted by the \package{listings} package.
+% So we have to calculate the total left margin on our own which makes this code even more dirty.
+% \begin{macrocode}
+ \l at addto@macro\caption at beginhook{%
+ \@tempdima\leftmargin
+ \multiply\@tempdima\@listdepth
+ \hskip-\@tempdima\relax}%
+% \end{macrocode}
% First of all, we set |position=#1| and if it was set to `top',
% we swap the skips so the default behavior of the \package{listings} package
% will not be changed. (Note that the \package{listings} package has set its
Modified: trunk/Master/texmf-dist/source/latex/caption/caption.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption.ins 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/source/latex/caption/caption.ins 2020-01-01 21:50:58 UTC (rev 53291)
@@ -6,7 +6,7 @@
\preamble
-Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
https://gitlab.com/axelsommerfeldt/caption
Modified: trunk/Master/texmf-dist/source/latex/caption/caption3.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/caption3.dtx 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/source/latex/caption/caption3.dtx 2020-01-01 21:50:58 UTC (rev 53291)
@@ -25,7 +25,7 @@
% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%
% \fi
-% \CheckSum{3418}
+% \CheckSum{3405}
%
% \iffalse
%<*driver>
@@ -188,7 +188,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2019/09/09 v1.8e caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2019/12/31 v1.8f caption3 kernel (AR)]
% \end{macrocode}
%
% \section{Workaround for bug in package \package{arabtex}}
@@ -1523,7 +1523,8 @@
\DeclareCaptionBox{colorbox}{\colorbox{\caption at boxcolor}{%
\setlength\caption at tempdima{#1}%
\addtolength\caption at tempdima{-2\fboxsep}%
- \linewidth=\caption at tempdima\hsize=\caption at tempdima
+ \linewidth\caption at tempdima
+ \hsize\caption at tempdima
#2}}
\DeclareCaptionOption{boxcolor}{\def\caption at boxcolor{#1}}
\DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
@@ -3151,6 +3152,7 @@
% \changes{v1.5}{2012/12/26}{max-margin stuff moved to \cs{caption at calcmargin}}
% \changes{v1.6}{2013/05/01}{Usage of \cs{caption at box} added}
% \changes{v1.7}{2016/01/31}{Adapted to the \package{bicaption} package}
+% \changes{v1.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
% |\caption@@make|\marg{caption label}\marg{caption text}
% \begin{macrocode}
\newcommand\caption@@make[2]{%
@@ -3167,7 +3169,7 @@
%
% Typeset the outer box |\caption at box|
% \begin{macrocode}
- \caption at box\linewidth{%
+ \caption at box\hsize{%
% \end{macrocode}
%
% Special single-line treatment (option |singlelinecheck=|)
@@ -3237,12 +3239,11 @@
% \end{macro}
%
% \begin{macro}{\caption at calcmargin}
-% \changes{v1.0f}{2005/10/24}{Internal: \cs{ifcaption at width} replaced by
-% \cs{ifdim}\cs{captionwidth=}\cs{z@}}
+% \changes{v1.0f}{2005/10/24}{Internal: \cs{ifcaption at width} replaced by \cs{ifdim}\cs{captionwidth=}\cs{z@}}
% \changes{v1.0g}{2006/01/12}{Improvement: Takes care of list environment now}
-% \changes{v1.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore),
-% use \cs{linewidth} instead of \cs{hsize}}
+% \changes{v1.1}{2006/05/13}{Check of \cs{@listdepth} removed (not necessary anymore), use \cs{linewidth} instead of \cs{hsize}}
% \changes{v1.5}{2012/12/26}{max-margin stuff moved from \cs{caption@@make} to here}
+% \changes{v1.8f}{2019/12/18}{Usage of \cs{linewidth} replaced by \cs{hsize}}
% |\caption at calcmargin|\par
% Calculate |\captionmargin| \& |\captionwidth|, so both contain valid
% values.
@@ -3265,11 +3266,11 @@
% \end{macrocode}
% \begin{macrocode}
\ifdim\captionwidth=\z@
- \captionwidth\linewidth
+ \captionwidth\hsize
\advance\captionwidth by -2\captionmargin
\advance\captionwidth by -\captionmargin@
\else
- \captionmargin\linewidth
+ \captionmargin\hsize
\advance\captionmargin by -\captionwidth
\divide\captionmargin by 2
\captionmargin@\z@
@@ -3278,12 +3279,9 @@
% \begin{macrocode}
\caption at Debug{%
\string\hsize=\the\hsize,
- \string\linewidth=\the\linewidth,\MessageBreak
- \string\leftmargin=\the\leftmargin,
- \string\rightmargin=\the\rightmargin,\MessageBreak
- \string\margin=\the\captionmargin,
- \string\margin@=\the\captionmargin@,
- \string\width=\the\captionwidth}%
+ \string\captionwidth=\the\captionwidth,\MessageBreak
+ \string\captionmargin=\the\captionmargin,
+ \string\captionmargin@=\the\captionmargin@}%
% \end{macrocode}
% \begin{macrocode}
}
Modified: trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/source/latex/caption/subcaption.dtx 2020-01-01 21:50:58 UTC (rev 53291)
@@ -102,10 +102,10 @@
% \newcommand\NEWdescription{\NEW{New description}}
%
% \makeatletter
-% \newcommand*\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
-% \newcommand*\@Ref[2]{#1{#2}: \textit{\nameref{#2}}}
+% \def\Ref{\@ifstar{\@Ref\ref}{\@Ref\autoref}}
+% \def\@Ref#1#2{#1{#2}: \textit{\nameref{#2}}}
% \makeatother
-% \newcommand*\See[1]{\nopagebreak{\small (See #1)}}
+% \def\See#1{\nopagebreak{\small (See #1)}}
%
% \GetFileInfo{subcaption.drv}
% \let\docdate\filedate
Modified: trunk/Master/texmf-dist/tex/latex/caption/caption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption.sty 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption.sty 2020-01-01 21:50:58 UTC (rev 53291)
@@ -6,7 +6,7 @@
%%
%% caption.dtx (with options: `package')
%%
-%% Copyright (C) 1994-2019 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
+%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt at f-m.fm)
%%
%% https://gitlab.com/axelsommerfeldt/caption
%%
@@ -34,8 +34,8 @@
%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2019/10/18 v3.4a Customizing captions (AR)]
-\RequirePackage{caption3}[2019/09/09] % needs v1.8e or newer
+\ProvidesPackage{caption}[2020/01/01 v3.4c Customizing captions (AR)]
+\RequirePackage{caption3}[2019/12/31] % needs v1.8f or newer
\caption at ifbool{documentclass}{}{%
\caption at WarningNoLine{%
Unknown document class (or package),\MessageBreak
@@ -457,7 +457,6 @@
\let\label\caption at xlabel
\fi
\caption at start}}
-\newcommand*\caption at typehook{}
\newcommand*\caption at iftype{\caption at ifdefined\@captype}
\caption at ifeTeX{%
\newcommand*\caption at checkgrouplevel[2]{%
@@ -963,6 +962,7 @@
\caption at setstyle*\float at style
\caption at setoptions\float at style
}{}%
+ \caption at float@setname{#1}%
\caption at freezeHref % will be defrosted in \float at makebox
\caption at ORI@float at setevery{#1}}%
\caption at AtBeginDocument{\caption at ifcompatibility{}{%
@@ -972,7 +972,7 @@
\renewcommand\float at makebox[1]{%
\caption at ORI@float at makebox{#1\relax \caption at defrostHref}}%
}}%
- \g at addto@macro\caption at typehook{%
+ \newcommand*\caption at float@setname[1]{%
\expandafter\ifx\csname #1name\endcsname\relax
\expandafter\let\csname #1name\expandafter\endcsname
\csname fname@#1\endcsname
@@ -1175,15 +1175,30 @@
\renewcommand*\caption at hypcapspace{\hypcapspace}%
\fi}{}
\caption at IfPackageLoaded{listings}[2004/02/13 v1.2]{%
+%% \caption at setbool{lst at Init}{0}%
+%% \lst at AddToHook{Init}{\caption at setbool{lst at Init}{1}}%
\let\caption at ORI@lst at MakeCaption\lst at MakeCaption
\def\lst at MakeCaption#1{% #1 is `t' or `b'
\begingroup
- \@tempdima\linewidth
- \advance\@tempdima\lst at xleftmargin
- \advance\@tempdima\lst at xrightmargin
- \ifdim\hsize>\@tempdima
- \hsize\@tempdima
- \fi
+%% \caption at Debug{%
+%% linewidth=\lst at linewidth,
+%% xleftmargin=\lst at xleftmargin,\MessageBreak
+%% xrightmargin=\lst at xrightmargin,
+%% resetmargins=\lst at ifresetmargins true\else false\fi}%
+%% \caption at iflst@Init{}{%\lsthk at PreInit\lsthk at Init => has unwanted side-effects (like an extra horizontal line)
+%% \linewidth\lst at linewidth\relax
+%% \lst at ifresetmargins
+%% \advance\linewidth\@totalleftmargin
+%% \advance\linewidth\rightmargin
+%% \@totalleftmargin\z@
+%% \fi
+%% \advance\linewidth-\lst at xleftmargin
+%% \advance\linewidth-\lst at xrightmargin
+%% \advance\@totalleftmargin\lst at xleftmargin\relax}%
+ \l at addto@macro\caption at beginhook{%
+ \@tempdima\leftmargin
+ \multiply\@tempdima\@listdepth
+ \hskip-\@tempdima\relax}%
\caption at setposition{#1}%
\caption at iftop{%
\@tempdima\belowcaptionskip
Modified: trunk/Master/texmf-dist/tex/latex/caption/caption3.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/caption/caption3.sty 2020-01-01 21:50:17 UTC (rev 53290)
+++ trunk/Master/texmf-dist/tex/latex/caption/caption3.sty 2020-01-01 21:50:58 UTC (rev 53291)
@@ -25,19 +25,16 @@
%% This Current Maintainer of this work is Axel Sommerfeldt.
%%
%% This work consists of the files
-%% CHANGELOG, README, SUMMARY, caption.ins,
-%% caption.dtx, caption2.dtx, caption3.dtx,
-%% bicaption.dtx, ltcaption.dtx, subcaption.dtx,
-%% newfloat.dtx, and totalcount.dtx
+%% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
+%% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
%% the derived files
%% caption.sty, caption2.sty, caption3.sty,
-%% bicaption.sty, ltcaption.sty, subcaption.sty,
-%% newfloat.sty, and totalcount.sty
+%% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
%% and the user manuals
-%% caption-deu.tex, caption-eng.tex, and caption-rus.tex.
+%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2019/09/09 v1.8e caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2019/12/31 v1.8f caption3 kernel (AR)]
\providecommand\caption at FixArabTeX{%
\def\caption at tempa##1{}%
\ifx\caption at tempa\@gobble
@@ -568,7 +565,8 @@
\DeclareCaptionBox{colorbox}{\colorbox{\caption at boxcolor}{%
\setlength\caption at tempdima{#1}%
\addtolength\caption at tempdima{-2\fboxsep}%
- \linewidth=\caption at tempdima\hsize=\caption at tempdima
+ \linewidth\caption at tempdima
+ \hsize\caption at tempdima
#2}}
\DeclareCaptionOption{boxcolor}{\def\caption at boxcolor{#1}}
\DeclareCaptionOption{boxsep}{\setlength\fboxsep{#1}}
@@ -1290,7 +1288,7 @@
\newcommand\caption@@make@[2]{%
\caption at stepthecounter
\caption at beginhook
- \caption at box\linewidth{%
+ \caption at box\hsize{%
\caption at ifslc{\caption at slc{#1}{#2}\caption at singleline\relax}{}%
\caption at calcmargin
\caption at tempdima\captionmargin
@@ -1331,11 +1329,11 @@
\fi
\fi
\ifdim\captionwidth=\z@
- \captionwidth\linewidth
+ \captionwidth\hsize
\advance\captionwidth by -2\captionmargin
\advance\captionwidth by -\captionmargin@
\else
- \captionmargin\linewidth
+ \captionmargin\hsize
\advance\captionmargin by -\captionwidth
\divide\captionmargin by 2
\captionmargin@\z@
@@ -1342,12 +1340,9 @@
\fi
\caption at Debug{%
\string\hsize=\the\hsize,
- \string\linewidth=\the\linewidth,\MessageBreak
- \string\leftmargin=\the\leftmargin,
- \string\rightmargin=\the\rightmargin,\MessageBreak
- \string\margin=\the\captionmargin,
- \string\margin@=\the\captionmargin@,
- \string\width=\the\captionwidth}%
+ \string\captionwidth=\the\captionwidth,\MessageBreak
+ \string\captionmargin=\the\captionmargin,
+ \string\captionmargin@=\the\captionmargin@}%
}
\newcommand\caption at slc[4]{%
\caption at Debug{Begin SLC}%
More information about the tex-live-commits
mailing list