From b86ebaa1aaa88bc9dee6503795da8b37647f4763 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 1 Sep 2019 21:36:30 +0000 Subject: hvfloat (1sep19) git-svn-id: svn://tug.org/texlive/trunk@52010 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty | 83 ++++++++++++++++++------- 1 file changed, 61 insertions(+), 22 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty b/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty index 6f94d80bac6..7eda015ab85 100644 --- a/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty +++ b/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty @@ -1,7 +1,7 @@ -%% $Id: hvfloat.sty 1042 2019-04-08 18:34:25Z herbert $ +%% $Id: hvfloat.sty 1054 2019-05-13 08:20:11Z herbert $ %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{hvfloat}[2019/04/08 rotating of floating objects] +\ProvidesPackage{hvfloat}[2019/05/13 rotating of floating objects] %% %% IMPORTANT NOTICE: %% @@ -16,8 +16,8 @@ %% DESCRIPTION: %% `hvfloat' offers rotating of captions and objects for floats %% -\def\fileversion{2.14} -\def\filedate{2019/05/10} +\def\fileversion{2.15} +\def\filedate{2019/08/31} \message{`hvfloat' v\fileversion, \filedate\space (Herbert Voss)} \let\hvFileVersion\fileversion % @@ -129,9 +129,18 @@ \define@boolkey{hvSet}[hv@]{nonFloat}[true]{}% Do not use float environment \define@boolkey{hvSet}[hv@]{onlyText}[true]{}% Write the caption only as text \define@boolkey{hvSet}[hv@]{wide}[true]{}% Write the caption only as text -\define@boolkey{hvSet}[hv@]{fullpage}[true]{}% fullpage float with caption on other page + + +\newif\ifhv@fullpage +\newif\ifhv@FULLPAGE + +%\define@boolkey{hvSet}[hv@]{fullpage}[true]{}% fullpage float with caption on other page %\define@boolkey{hvSet}[hv@]{FullPage}[true]{}% fullpage float with caption on other page -\define@boolkey{hvSet}[hv@]{FULLPAGE}[true]{}% fullpage float with caption on other page +%\define@boolkey{hvSet}[hv@]{FULLPAGE}[true]{}% fullpage float with caption on other page + +\define@key{hvSet}{fullpage}[true]{\global\@nameuse{hv@fullpage#1}}% wegen \afterpage problem +\define@key{hvSet}{FULLPAGE}[true]{\global\@nameuse{hv@FULLPAGE#1}} + \define@boolkey{hvSet}[hv@]{subFloat}[true]{% typeset values as subfloats \ifhv@subFloat\setkeys{hvSet}{multiFloat=false}\fi% }% @@ -146,6 +155,9 @@ {\begingroup \edef\x{\endgroup\noexpand\setkeys{hvSet}{\@nameuse{hv@#1}}}\x}% use a defined style } +\define@key{hvSet}{capFormat}[]{\def\hv@caption@format{#1}}% +\define@key{hvSet}{subcapFormat}[]{\def\hv@subcaption@format{#1}}% + \def\hv@set#1{\begingroup\edef\x{\endgroup\noexpand\setkeys{hvSet}{#1}}\x} \let\hvFloatSet\hv@set % @@ -159,10 +171,13 @@ onlyText=false, wide=false, fullpage=false, FULLPAGE=false, multiFloat=false,subFloat=false, separatorLine,objectFrame=false,multiFloatSkip=\normalbaselineskip, + capFormat={}, subcapFormat={}, }% } \newcommand\reset@special@float{% - \hv@set{subFloat=false,fullpage=false,multiFloat=false,FULLPAGE=false}} + \hv@set{subFloat=false,%fullpage=false, + multiFloat=false,%FULLPAGE=false +}} \def\hv@vskip{\vspace{\hvMultiFloatSkip}} @@ -188,9 +203,15 @@ } % \newcommand\figcaption[2][]{\def\@captype{figure}% - \begingroup\ifx\relax#1\relax \caption{#2}\else\caption[#1]{#2}\fi\endgroup} + \begingroup + \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi + \ifx\relax#1\relax \caption{#2}\else\caption[#1]{#2}\fi + \endgroup} \newcommand\tabcaption[2][]{\def\@captype{table}% - \begingroup\ifx\relax#1\relax \caption{#2}\else\caption[#1]{#2}\fi\endgroup} + \begingroup + \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi + \ifx\relax#1\relax \caption{#2}\else\caption[#1]{#2}\fi + \endgroup} % \newlength\hv@maxImageWidth \AtBeginDocument{\hv@maxImageWidth=\columnwidth} @@ -271,8 +292,8 @@ \setDefaults \def\hvFloat{\@ifnextchar*% Main macro - {\hv@startrue\hv@maxImageWidth=\textwidth\hvFloat@i}% - {\hv@starfalse\hv@maxImageWidth=\columnwidth\hvFloat@i*}% + {\global\hv@startrue\hv@maxImageWidth=\textwidth\hvFloat@i}% + {\global\hv@starfalse\hv@maxImageWidth=\columnwidth\hvFloat@i*}% } %\newcommand*{\hvFloat}[5][]+{% @@ -289,7 +310,7 @@ \begingroup \setlength\hvWideWidth{\dimexpr\linewidth+\marginparwidth}% \hv@maxImageWidth=\textwidth - \hv@capbesidefalse +% \hv@capbesidefalse \reset@special@float \setcounter{hv@pfigure}{\value{figure}}% \setcounter{hv@ptable}{\value{table}}% @@ -361,7 +382,7 @@ \def\hvFloat@ii[#1]#2#3{% \hv@maxImageWidth=\textwidth - \hv@capbesidefalse +% \hv@capbesidefalse \ifx\relax#1\relax\else\setkeys{hvSet}{#1}\fi \gdef\hv@floatType{#2}% \ifx\relax#2\relax \setkeys{hvSet}{nonFloat=true}\fi @@ -419,7 +440,11 @@ \ifhv@wide \setlength\hvCapWidth{\the\dimexpr\hvWideWidth-\hvObjectWidth-\hvSet@floatCapSep\relax}% \else - \setlength\hvCapWidth{\the\dimexpr\columnwidth-\hvObjectWidth-\hvSet@floatCapSep\relax}% + \ifhv@star + \setlength\hvCapWidth{\the\dimexpr\textwidth-\hvObjectWidth-\hvSet@floatCapSep\relax}% + \else + \setlength\hvCapWidth{\the\dimexpr\linewidth-\hvObjectWidth-\hvSet@floatCapSep\relax}% + \fi \fi \else \setlength\hvCapWidth{\columnwidth}% @@ -450,6 +475,7 @@ \ifx\hvSet@capAngle\hv@Zero % need rotation? \sbox\hvCaptionBox{% NO rotation \begin{minipage}[b]{\hvCapWidth}% minipage, to get hyphenation + \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi \ifhv@nonFloat \ifhv@onlyText\hv@longCap \else @@ -470,6 +496,7 @@ \sbox\hvCaptionBox{% Rotation \rotatebox{\hvSet@capAngle}{% \begin{minipage}[b]{\hvCapWidth}% minipage, to get hyphenation + \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi \ifhv@nonFloat \ifhv@onlyText\hv@longCap \else @@ -496,11 +523,14 @@ \def\fps@figure{\hvSet@floatPos}% \ifhv@nonFloat \begingroup% Start the nonfloat part - \checkoddpage - \else - \begin{\hv@floatType}% Start the floating environment - \checkoddpage + \else + \ifhv@star + \@nameuse{\hv@floatType*}% Start the floating environment ***************************** + \else + \begin{\hv@floatType} % Start the floating environment + \fi \fi + \checkoddpage \ifx\hvSet@objectPos\hv@Right\raggedleft\fi \ifx\hvSet@objectPos\hv@Center \ifhv@nonFloat\hspace*{\fill}\else\centering\fi @@ -551,7 +581,7 @@ \fi \fi %%%% - \savebox{\@tempboxa}{% + \savebox{\@tempboxa}{% ***** @tempbox start \expandafter\ifcase\the\hv@@capPos% 0 is LEFT START \ifcase \ifx\hvSet@capVPos\hv@Center \put@CaptionBox @@ -615,7 +645,7 @@ \fi \end{minipage}% \fi% \ifcase\the\hv@@capPos - }% End savebox Object and caption + }% End savebox Object and caption %%%%%%%%%%%%%%%%% @tempboxa % % now we rotate the object and caption, if needed % @@ -635,7 +665,11 @@ \fi \endgroup% End the nonfloat part \else - \end{\hv@floatType}% End the floating environment + \ifhv@star + \@nameuse{end\hv@floatType*}% End the floating environment + \else + \end{\hv@floatType}% End the floating environment + \fi \fi \endgroup% startet at main \hvFloat } @@ -712,7 +746,7 @@ \else % onecolumn \ifoddpage \setPageObject\setBottomCaption - \else + \else% even page \afterpage{\setPageObject\setBottomCaption}% \fi \fi @@ -844,6 +878,7 @@ \def\getMultiCaptionAndLabel{% \global\sbox\hvCaptionBox{\minipage[b]{\linewidth}% + \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi \setlength\belowcaptionskip{5pt}% \setlength\abovecaptionskip{0pt}% \hv@cntb=\clist_count:N\l_clist_Type @@ -868,6 +903,7 @@ } \def\getMultiObjectAndLabel{% \global\sbox\hvObjectBox{\minipage{\linewidth}% + \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi \ifx\hvSet@objectPos\hv@Right\raggedleft\else \ifx\hvSet@objectPos\hv@Left\raggedleft\else \ifx\hvSet@objectPos\hv@Center\centering @@ -893,6 +929,7 @@ \def\getMultiSubCaptionAndLabel{% \global\sbox\hvCaptionBox{\minipage{\linewidth}% + \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi \setlength\belowcaptionskip{5pt}% \setlength\abovecaptionskip{0pt}% \xdef\@captype{\clist_item:Nn\l_clist_Type{1}}% the same for all subfloats @@ -909,6 +946,7 @@ \def\getMultiSubObjectAndLabel{% \global\sbox\hvObjectBox{\minipage{\linewidth}% + \ifx\relax\hv@subcaption@format\relax\else\captionsetup[sub]{\hv@subcaption@format}\fi \ifx\hvSet@objectPos\hv@Right\raggedleft\else \ifx\hvSet@objectPos\hv@Left\raggedleft\else \ifx\hvSet@objectPos\hv@Center\centering @@ -949,6 +987,7 @@ \def\getSingleCaptionAndLabel{% \global\sbox\hvCaptionBox{\minipage{\linewidth}% + \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi \setlength\belowcaptionskip{5pt}% \setlength\abovecaptionskip{0pt}% \edef\@captype{\hv@floatType}% -- cgit v1.2.3