diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/easyfloats/easyfloats.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/easyfloats/easyfloats.sty | 74 |
1 files changed, 64 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/easyfloats/easyfloats.sty b/Master/texmf-dist/tex/latex/easyfloats/easyfloats.sty index 33c5ae754c6..7f5c7c63583 100644 --- a/Master/texmf-dist/tex/latex/easyfloats/easyfloats.sty +++ b/Master/texmf-dist/tex/latex/easyfloats/easyfloats.sty @@ -28,8 +28,9 @@ %% This work consists of the files listed in easyfloats-file-list.txt. + \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{easyfloats}[2020/12/20 v1.0.0] +\ProvidesPackage{easyfloats}[2024/10/28 v1.1.0] \newif\ifesf@loadgraphics @@ -132,10 +133,12 @@ \newif\ifobject@isgraphic \newcommand{\object@hook}{} +\newcommand{\object@endhook}{} \newcommand{\subobject@hook}{} \newcommand{\object@graphic@hook}{} \newrobustcmd{\AtBeginObject}[1]{\appto\object@hook{#1}} +\newrobustcmd{\AtEndObject}[1]{\appto\object@endhook{#1}} \newrobustcmd{\AtBeginSubobject}[1]{\appto\subobject@hook{#1}} \newrobustcmd{\AtBeginGraphicObject}[1]{\appto\object@graphic@hook{#1}} @@ -685,11 +688,13 @@ type/.code={% \def\object@longtable@caption@sep{\ObjectDefineEnvargs{longtable}{\\}}% } +\newtoks\object@last@arg \newenvironment{object}[1]{% #1: options \if@inobject \PackageError{easyfloats}{object environment may not be nested}{Did you mean to use the subobject environment instead?}% \fi \@inobjecttrue +\object@last@arg={#1}% \object@restorestandardfloats \object@hook \ifobject@isgraphic @@ -738,11 +743,18 @@ env/.esf@mandatory=It should be the name of an environment like tabular or empty \fi \edef\object@floatenv@begin{\expandonce{\csname\esf@tmp@type\endcsname}}% \edef\object@floatenv@end{\expandonce{\csname end\esf@tmp@type\endcsname}}% +\def\esf@text@I{I}% \pgfkeysgetvalue{/object/placement}{\esf@tmp@placement}% \ifx \esf@tmp@placement \@empty +\else\ifx \esf@tmp@placement \esf@text@I +\preto\object@floatenv@begin{% +\columnwidth = \linewidth +\let \float@endH = \esf@float@endI +}% +\appto\object@floatenv@begin{[H]}% \else \eappto\object@floatenv@begin{[\esf@tmp@placement]}% -\fi +\fi \fi \fi \pgfkeysgetvalue{/object/details}{\object@details}% \ifx \object@details \@empty @@ -767,6 +779,7 @@ env/.esf@mandatory=It should be the name of an environment like tabular or empty \fi \global \@firstsubobjecttrue \object@floatenv@begin +\preto\par{\global\@firstsubobjecttrue}% \let\esf@original@label=\label \let\esf@original@caption=\caption \let\label=\object@label @@ -781,18 +794,34 @@ env/.esf@mandatory=It should be the name of an environment like tabular or empty \PackageWarning{easyfloats}{'contains subobjects' is true but the object does not contain any subobjects.}% \fi \fi +\object@endhook \let\label=\esf@original@label \let\caption=\esf@original@caption \object@processCaptionAndLabel \object@floatenv@end } +\newcommand\esf@float@endI{% +\@endfloatbox +\vskip\intextsep +\if@flstyle +\setbox\@currbox\float@makebox\columnwidth +\fi +\leavevmode% added by me +\box\@currbox +\vskip\intextsep\relax +} + \newcommand{\object@processCaptionAndLabel}{% \esf@ifpgfkeyhasvalue{/object/caption}{% \esf@ifpgfkeyhasvalue{/object/list caption}% {\pgfkeysgetvalue{/object/list caption}{\esf@tmp@caption@short}}% {\pgfkeysgetvalue{/object/caption}{\esf@tmp@caption@short}}% -\caption[\esf@tmp@caption@short]{\pgfkeysvalueof{/object/caption}\object@details}% +\ifx \esf@tmp@caption@short \@empty +\else +\edef \esf@tmp@caption@short {{\expandonce{\esf@tmp@caption@short}}}% +\fi +\expandafter\caption\expandafter[\esf@tmp@caption@short]{\pgfkeysvalueof{/object/caption}\object@details}% }{% \ifobject@warnnocaption \PackageWarning{easyfloats}{% @@ -861,6 +890,17 @@ This warning occured% } +\newcommand{\splitobject}{% +\expanded{% +\noexpand\end{\@currenvir}% +\noexpand\begin{\@currenvir}{\the\object@last@arg, warn no label=false, list caption=, exec+={\unexpanded{% +\pgfkeyssetvalue{/object/label}{\pgfkeysnovalue}% +\ContinuedFloat +}}}% +}% +} + + \newcommand{\object@lookahead@nosubobject}{% \object@lookahead@begin } @@ -1115,24 +1155,27 @@ auto caption strip path/.is if=graphicobject@autocaption@strippath, auto caption strip path=false, auto label strip path/.is if=graphicobject@autolabel@strippath, auto label strip path=false, +auto label prefix/.initial=, +auto label prefix/.value required, warn env/.is if=graphicobject@warnenv, warn env=true, no env/.is if=graphicobject@noenv, no env=true, +before graphic/.initial=, +before graphic/.value required, +after graphic/.initial=, +after graphic/.value required, } \newrobustcmd{\includegraphicobject}{% [#1: graphicstyle], [#2: options], #3: graphic filename without extension -\let\includegraphicobject@after=\@empty +\begingroup \@ifnextchar [% \includegraphicobject@firstarg \includegraphicobject@parseoptions } \def\includegraphicobject@firstarg[#1]{% -\begingroup \@ifnextchar [% {% -\begingroup -\let\includegraphicobject@after=\endgroup \graphicobjectstyle{#1}% \includegraphicobject@parseoptions }% @@ -1182,6 +1225,7 @@ no env=true, \ifgraphicobject@autolabel@strippath \protected@edef\graphicobject@label{\strippath\graphicobject@label}% \fi +\epreto\graphicobject@label{\pgfkeysvalueof{/graphicobject/auto label prefix}}% \pgfkeyslet{\object@graphic@path/label}{\graphicobject@label}% }% \fi @@ -1204,16 +1248,18 @@ no env=true, \fi , } +\pgfkeysvalueof{/graphicobject/before graphic}% \expandafter\includegraphics\expandafter[\object@graphic@options@tmp]{#3}% +\pgfkeysvalueof{/graphicobject/after graphic}% \end{#1}% -\includegraphicobject@after +\endgroup +\ignorespaces } \newrobustcmd{\includegraphicsubobject}{% \begingroup \def\object@graphic@env{subobject}% \def\object@graphic@path{/subobject}% -\def\includegraphicobject@after{\endgroup\ignorespaces}% \includegraphicobject@parseoptions } @@ -1418,9 +1464,17 @@ env=, \caption@iftop {\eappto\subobject@subpage@begin{[T]}}% {\eappto\subobject@subpage@begin{[B]}}% +}{\ifdefstring \subobject@outerpos {auto-inverted}{% +\caption@iftop +{\eappto\subobject@subpage@begin{[b]}}% +{\eappto\subobject@subpage@begin{[t]}}% +}{\ifdefstring \subobject@outerpos {Auto-inverted}{% +\caption@iftop +{\eappto\subobject@subpage@begin{[B]}}% +{\eappto\subobject@subpage@begin{[T]}}% }{% \eappto\subobject@subpage@begin{[\subobject@outerpos]}% -}}\fi +}}}}\fi \pgfkeysgetvalue{/subobject/subpage height}{\subobject@height}% \ifx \subobject@height \@empty \else |