From cf0fa0dcc6bbb280dc18c7fe6c6d38b16c3f26b3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 12 Mar 2021 22:59:59 +0000 Subject: hvfloat (12mar21) git-svn-id: svn://tug.org/texlive/trunk@58295 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty | 216 +++++++++++++++++++++--- 1 file changed, 195 insertions(+), 21 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty b/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty index 622c1fba502..ff8fb42a4ce 100644 --- a/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty +++ b/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty @@ -1,4 +1,4 @@ -%% $Id: hvfloat.sty 36 2020-10-31 08:22:30Z herbert $ +%% $Id: hvfloat.sty 41 2020-11-21 21:03:28Z herbert $ %% %% %% IMPORTANT NOTICE: @@ -15,8 +15,8 @@ %% `hvfloat' offers rotating of captions and objects for floats %% \NeedsTeXFormat{LaTeX2e} -\def\fileversion{2.17} -\def\filedate{2020/10/31} +\def\fileversion{2.18} +\def\filedate{2021/03/12} \message{`hvfloat' v\fileversion, \filedate\space (Herbert Voss)} \ProvidesPackage{hvfloat}[\filedate\ rotating of floating objects] \let\hvFloatFileVersion\fileversion @@ -32,7 +32,7 @@ \RequirePackage{caption} \PassOptionsToPackage{hypcap}{subcaption} \RequirePackage{subcaption} -\RequirePackage{atbegshi} +\RequirePackage{atbegshi,picture,trimclip} \RequirePackage{expl3,multido} \RequirePackage{graphicx} @@ -64,6 +64,8 @@ \newsavebox\hvOBox \newsavebox\@tempbox \newsavebox\hv@caption@box +\newsavebox\hv@leftBox +\newsavebox\hv@rightBox \newif\ifhv@capbeside \hv@capbesidefalse @@ -133,13 +135,15 @@ \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 +\newif\ifhv@doubleFULLPAGE +\newif\ifhv@doublePAGE +\newif\ifhv@doublePage \define@key{hvSet}{fullpage}[true]{\global\@nameuse{hv@fullpage#1}}% wegen \afterpage problem \define@key{hvSet}{FULLPAGE}[true]{\global\@nameuse{hv@FULLPAGE#1}} +\define@key{hvSet}{doubleFULLPAGE}[true]{\global\@nameuse{hv@doubleFULLPAGE#1}\hv@doublePagefalse\hv@doublePAGEfalse} +\define@key{hvSet}{doublePAGE}[true]{\global\@nameuse{hv@doublePAGE#1}\hv@doublePagefalse\hv@doubleFULLPAGEfalse} +\define@key{hvSet}{doublePage}[true]{\global\@nameuse{hv@doublePage#1}\hv@doublePAGEfalse\hv@doubleFULLPAGEfalse} \define@boolkey{hvSet}[hv@]{subFloat}[true]{% typeset values as subfloats \ifhv@subFloat\setkeys{hvSet}{multiFloat=false}\fi% @@ -168,7 +172,8 @@ floatPos=htbp, rotAngle=0, capWidth=n, capAngle=0, capPos=bottom, capVPos=center, objectPos=center, objectAngle=0, floatCapSep=5pt, useOBox=false, nonFloat=false, - onlyText=false, wide=false, fullpage=false, FULLPAGE=false, + onlyText=false, wide=false, fullpage=false, FULLPAGE=false, + doubleFULLPAGE=false, doublePage=false, doublePAGE=false, multiFloat=false,subFloat=false, separatorLine,objectFrame=false,multiFloatSkip=\normalbaselineskip, capFormat={}, subcapFormat={}, @@ -232,8 +237,6 @@ \Gin@boolkey{false}{iso}% } \newcommand\IncludeGraphics[2][]{% -% \newpage -%\iffalse \vspace*{\the\dimexpr-1in-\voffset+\topskip-\headheight-0.5\baselineskip}% \leavevmode\checkoddpage \ifoddpage @@ -242,9 +245,6 @@ \hspace*{\dimexpr-\evensidemargin-\parindent-1in}% \fi\noindent \includegraphics[#1,width=\paperwidth,height=\paperheight,keepaspectratio=false]{#2}% -%\fi -% \includepdf[#1]%,width=\paperwidth,height=\paperheight,keepaspectratio=false] -% {#2}% } \newcommand\put@CaptionBox[1][0]{% @@ -305,12 +305,10 @@ % #6: label % \def\hvFloat@i*{\@ifnextchar[{\do@hvFloat}{\do@hvFloat[]}} - \def\do@hvFloat[#1]{% \begingroup \setlength\hvWideWidth{\dimexpr\linewidth+\marginparwidth}% \hv@maxImageWidth=\textwidth -% \hv@capbesidefalse \reset@special@float \setcounter{hv@pfigure}{\value{figure}}% \setcounter{hv@ptable}{\value{table}}% @@ -382,7 +380,6 @@ \def\hvFloat@ii[#1]#2#3{% \hv@maxImageWidth=\textwidth -% \hv@capbesidefalse \ifx\relax#1\relax\else\setkeys{hvSet}{#1}\fi \gdef\hv@floatType{#2}% \ifx\relax#2\relax \setkeys{hvSet}{nonFloat=true}\fi @@ -393,6 +390,7 @@ \gdef\hv@shortCap{#1}% \gdef\hv@longCap{#2}% \gdef\hv@label{#3}% + \ifhv@capbeside\def\@@temp{1}\else\def\@@temp{0}\fi \ifhv@fullpage \def\hvSet@CapWidth{n}% relative value \do@@@@hvFloat% fullpage with caption on other page @@ -401,9 +399,23 @@ \def\hvSet@CapWidth{n}% relative value \do@@@@hvFloat% fullpage with caption on other page \else - \do@@@hvFloat + \ifhv@doubleFULLPAGE + \setlength\hvCapWidth{\textheight} + \do@hvFloat@doubleFULLPAGE% fullpage with caption rotated or under on an odd page + \else + \ifhv@doublePAGE + \expandafter\do@hvFloat@doublePAGE\@@temp% fullpage with caption rotated or under on an odd page + \else + \ifhv@doublePage + \expandafter\do@hvFloat@doublePage\@@temp% fullpage with caption rotated or under on an odd page + \else + \do@@@hvFloat + \fi + \fi + \fi \fi \fi +% \global\hv@capbesidefalse } % \def\do@@@hvFloat{% no special float page @@ -473,7 +485,7 @@ \fi \saveCaptionSkip % we put this space ourselve \ifx\hvSet@capAngle\hv@Zero % need rotation? - \sbox\hvCaptionBox{% NO rotation + \savebox\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 @@ -505,7 +517,7 @@ \end{minipage}% }% \else - \sbox\hvCaptionBox{% Rotation + \savebox\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 @@ -845,8 +857,170 @@ \fi \fi \endgroup% startet at main \hvFloat -}% +} +% +% +\def\do@hvFloat@doublePage#1{% image on left and right page with caption on the right ---------------------------------- + \checkoddpage + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \ifoddpage + \afterpage{% + \noindent + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \global\@tempdima=\dimexpr\paperwidth-1in-\evensidemargin\relax + \clipbox*{0 -\depth{} \@tempdima{} \height}{\usebox\hvObjectBox}% + \par\bigskip + \afterpage{% + \newpage + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \hspace*{\dimexpr-1in-\oddsidemargin-\parindent}% + \clipbox*{\@tempdima{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}% + \ifnum#1>0 + \medskip + \ifdim\dp\hvObjectBox > \z@ + \rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{% + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}% + \else + \rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{% + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}% + \fi + \else + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}% + \fi + }% + }% + \else + \afterpage{% + \afterpage{% +% \newpage + \noindent\null + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \global\@tempdima=\dimexpr\paperwidth-1in-\evensidemargin\relax{} + \hspace*{\@tempdima}% + \clipbox*{0 -\depth{} \@tempdima{} \height}{\usebox\hvObjectBox}% + \par\bigskip + \afterpage{% + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \noindent + \hspace*{\dimexpr-1in-\marginparwidth}% + \clipbox*{\@tempdima{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}% + \ifnum#1>0 + \medskip + \ifdim\dp\hvObjectBox > \z@ + \rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{% + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}% + \else + \rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{% + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}% + \fi + \else + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}% + \fi + }}}% + \fi + \endgroup +} + +\def\do@hvFloat@doublePAGE#1{% image on left and right page with caption on the right ---------------------------------- + \checkoddpage + \ifoddpage + \afterpage{% + \newpage + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}% + \clipbox*{0 -\depth{} \paperwidth{} \height}{\usebox\hvObjectBox}% + \newpage + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \hspace*{\the\dimexpr-\oddsidemargin-\parindent-1in}% + \clipbox*{\paperwidth{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}% + \ifnum#1>0 + \medskip + \ifdim\dp\hvObjectBox > \z@ + \rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{% + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}% + \else + \rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{% + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}% + \fi + \else + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}% + \fi + \newpage + }% + \else + \afterpage{% + \AddToHookNext{shipout/before}{% +% \newpage + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \hspace*{\dimexpr-\evensidemargin-1in-\parindent}% + \clipbox*{0 -\depth{} \paperwidth{} \height}{\usebox\hvObjectBox}% + \newpage + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \hspace*{\the\dimexpr-1in-\oddsidemargin-\parindent\relax}% + \clipbox*{\paperwidth{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}% + \ifnum#1>0 + \medskip + \ifdim\dp\hvObjectBox > \z@ + \rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{% + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}% + \else + \rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{% + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}% + \fi + \else + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}% + \fi + \newpage + }}% + \fi + \endgroup +} % +\def\do@hvFloat@doubleFULLPAGE{% image on left and right page with caption on the right ---------------------------------- + \checkoddpage + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \ifoddpage + \afterpage{% + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep+0.5\paperheight-0.5\ht\hvObjectBox-\normalbaselineskip}% + \hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}% + \thispagestyle{empty}% + \clipbox*{0 0 \paperwidth{} \height}{\usebox\hvObjectBox}% + \newpage + \thispagestyle{empty}% + \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-0.5\paperheight+0.5\ht\hvObjectBox-\normalbaselineskip}% + \hspace*{\the\dimexpr-\oddsidemargin-\parindent-1in}% + \clipbox*{\paperwidth{} 0 \wd\hvObjectBox{} \paperheight{}}{\usebox\hvObjectBox}% + \savebox\hvCaptionBox{\parbox{0.9\ht\hvObjectBox}{% + \captionof*{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}% + \put(-\ht\hvCaptionBox,0.5\ht\hvObjectBox){\makebox(0,0){\rotatebox{90}{\parbox{0.9\ht\hvObjectBox}{% + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}}} + \newpage + }% + \else + \afterpage{% + \AddToHookNext{shipout/before}{% + \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% + \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-0.75\paperheight+0.75\ht\hvObjectBox}% + \hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}% + \thispagestyle{empty}% + \clipbox*{0 0 \paperwidth{} \paperheight}{\usebox\hvObjectBox}% + \newpage + \thispagestyle{empty}% + \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-0.5\paperheight+0.5\ht\hvObjectBox-\normalbaselineskip}% + \hspace*{\the\dimexpr-\oddsidemargin-\parindent-1in}% + \clipbox*{\paperwidth{} 0 \wd\hvObjectBox{} \paperheight{}}{\usebox\hvObjectBox}% + \savebox\hvCaptionBox{\parbox{0.9\ht\hvObjectBox}{% + \captionof*{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}% + \put(-\ht\hvCaptionBox,0.5\ht\hvObjectBox){\makebox(0,0){\rotatebox{90}{\parbox{0.9\ht\hvObjectBox}{% + \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}}} + \newpage + }% + }% + \fi + \endgroup +} + \def\setBottomCaption{% \begin{\hv@floatType}[!b] \ifhv@separatorLine\drawSepLine\fi -- cgit v1.2.3