summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/hvfloat/latex/hvfloat.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/hvfloat/latex/hvfloat.sty')
-rw-r--r--macros/latex/contrib/hvfloat/latex/hvfloat.sty479
1 files changed, 286 insertions, 193 deletions
diff --git a/macros/latex/contrib/hvfloat/latex/hvfloat.sty b/macros/latex/contrib/hvfloat/latex/hvfloat.sty
index 61222e4aca..1f56977f93 100644
--- a/macros/latex/contrib/hvfloat/latex/hvfloat.sty
+++ b/macros/latex/contrib/hvfloat/latex/hvfloat.sty
@@ -1,4 +1,4 @@
-%% $Id: hvfloat.sty 75 2021-05-04 19:52:22Z herbert $
+%% $Id: hvfloat.sty 86 2021-05-12 19:25:56Z herbert $
%%
%%
%% IMPORTANT NOTICE:
@@ -15,8 +15,8 @@
%% `hvfloat' offers rotating of captions and objects for floats
%%
\NeedsTeXFormat{LaTeX2e}
-\def\fileversion{2.22}
-\def\filedate{2021/05/06}
+\def\fileversion{2.24}
+\def\filedate{2021/05/09}
\message{`hvfloat' v\fileversion, \filedate\space (Herbert Voss)}
\ProvidesPackage{hvfloat}[\filedate\ rotating of floating objects]
\let\hvFloatFileVersion\fileversion
@@ -151,21 +151,28 @@
\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@]{debug}[true]{}% give more infos in the terminal
+\define@boolkey{hvSet}[hv@]{Debug}[true]{}% give more infos in the terminal
-\newcommand\hv@typeout[1]{\ifhv@debug\typeout{#1}\fi}
+\newcommand\hv@typeout[1]{\ifhv@Debug\typeout{#1}\fi}
\newif\ifhv@fullpage
\newif\ifhv@FULLPAGE
\newif\ifhv@doubleFULLPAGE
\newif\ifhv@doublePAGE
\newif\ifhv@doublePage
+\newif\ifhv@setObjectLabel
-\define@key{hvSet}{fullpage}[true]{\global\@nameuse{hv@fullpage#1}}% wegen \afterpage problem
+\newlength\hvSet@bindCorrection
+\newlength\hv@leftPageObjectWidth% for doublepage images
+\newlength\hv@tempWidthA
+\newlength\hv@tempWidthB
+
+\define@key{hvSet}{fullpage}[true]{\global\@nameuse{hv@fullpage#1}}%
\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@key{hvSet}{bindCorr}[\z@]{\setlength\hvSet@bindCorrection{#1}}% for doublepage objects
\define@boolkey{hvSet}[hv@]{subFloat}[true]{% typeset values as subfloats
\ifhv@subFloat\setkeys{hvSet}{multiFloat=false}\fi%
@@ -181,8 +188,8 @@
{\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}}%
+\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
@@ -200,7 +207,7 @@
multiFloat=false,subFloat=false,
separatorLine,objectFrame=false,multiFloatSkip=\normalbaselineskip,
capFormat={}, subcapFormat={},
- floatRef=object,
+ floatRef=object, bindCorr=\z@,
}%
}
@@ -517,7 +524,7 @@
\saveCaptionSkip% we put this space ourselve
\ifx\hvSet@capAngle\hv@Zero% need rotation?
\savebox\hvCaptionBox{% NO rotation
- \begin{minipage}[b]{\hvCapWidth}% minipage, to get hyphenation
+ \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
@@ -556,7 +563,7 @@
\else
\savebox\hvCaptionBox{% Rotation
\rotatebox{\hvSet@capAngle}{%
- \begin{minipage}[b]{\hvCapWidth}% minipage, to get hyphenation
+ \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
@@ -907,300 +914,381 @@
\endgroup% startet at main \hvFloat
}
%
+%% ||1in+evenside --- |1in+oddside ---||
%
-\def\do@hvFloat@doublePage#1{% image on left and right page with caption on the right ----------------------------------
+\def\do@hvFloat@doublePage#1{% image on left and right page with caption on the right page ----------------------------------
% #1-> 0/1 caption under/right
\checkoddpage
- \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \global\setlength\hv@leftPageObjectWidth{\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection}%
+ \global\setlength\hv@tempWidthA{\the\dimexpr-1in-\oddsidemargin+\hvSet@bindCorrection-\parindent}%
+ \hv@typeout{>>>>do@hvFloat@doublePage #1}%
\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
+ \hv@typeout{>>>>do@hvFloat@doublePage->oddpage}%
+ \hv@typeout{>>>>do@hvFloat@doublePage->oddpage->bindCorr=\the\hvSet@bindCorrection}%
+ \hv@typeout{>>>>do@hvFloat@doublePage->oddpage->hv@leftPageObjectWidth=\the\hv@leftPageObjectWidth}%
\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}%
+ \noindent
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \clipbox*{0 -\depth{} \hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}%
+ \par\bigskip
+ \afterpage{%
+ \newpage
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \hspace*{\hv@tempWidthA}%
+ \noindent
+ \clipbox*{\hv@leftPageObjectWidth{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}%
\ifnum#1>0
\medskip
\ifdim\dp\hvObjectBox > \z@
\rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
}}%
\else
\rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
}}%
\fi
\else
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
\fi
}%
}%
\else
+ \hv@typeout{>>>>do@hvFloat@doublePage->evenpage}%
+ \hv@typeout{>>>>do@hvFloat@doublePage->evenpage->bindCorr=\the\hvSet@bindCorrection}%
+ \hv@typeout{>>>>do@hvFloat@doublePage->evenpage->hv@leftPageObjectWidth=\the\hv@leftPageObjectWidth}%
+ \global\setlength\hv@tempWidthA{\the\dimexpr-1in-\oddsidemargin+\hvSet@bindCorrection}%
+ \global\setlength\hv@leftPageObjectWidth{\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection}%
\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{%
+ \let\hv@fptop\c@fptop
+ \global\setlength{\@fptop}{0pt}%
+ \let\hv@c@topnumber\c@topnumber
+ \setcounter{topnumber}{1}%
+ \begin{\hv@floatType}[t]
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \clipbox*{0 -\depth{} \hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}%
+ \end{\hv@floatType}%
+ \begin{\hv@floatType}[t]
\global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \hspace*{\hv@tempWidthA}%
\noindent
- \hspace*{\dimexpr-1in-\marginparwidth}%
- \clipbox*{\@tempdima{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}%
+ \clipbox*{\hv@leftPageObjectWidth{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}%
\ifnum#1>0
\medskip
\ifdim\dp\hvObjectBox > \z@
\rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
}}%
\else
\rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
}}%
\fi
\else
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
\fi
- }}}%
+ \end{\hv@floatType}%
+ \let\c@topnumber\hv@c@topnumber
+ \let\c@fptop\hv@fptop
+ }}%
\fi
- \endgroup
+ \endgroup% started at main macro \hvFloat
}
-
+\newsavebox\hv@boxLeftPage
+\newsavebox\hv@boxRightPage
+%
+%% ||1in+evenside --- |1in+oddside ---||
+%
\def\do@hvFloat@doublePAGE#1{% image on left and right page with caption on the right ----------------------------------
% #1-> 0/1 caption under/right
\hv@typeout{>>>>do@hvFloat@doublePAGE}%
+ \global\setlength\hv@tempWidthA{\the\dimexpr1in+\oddsidemargin-\hvSet@bindCorrection+\parindent}%
+ \global\setlength\hv@leftPageObjectWidth{\the\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection}%
+ \expandafter\global\expandafter\savebox\expandafter\hvObjectBox\expandafter{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \expandafter\global\expandafter\savebox\expandafter\hv@boxLeftPage\expandafter{\clipbox*{0 -\depth{} \hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}}%
+ \expandafter\global\expandafter\savebox\expandafter\hv@boxRightPage\expandafter{\clipbox*{\hv@leftPageObjectWidth{} -\depth{} \width{} \height}{\usebox\hvObjectBox}}%
\checkoddpage
\ifoddpage
+ \hv@typeout{>>>>do@hvFloat@doublePAGE->oddpage}%
+ \hv@typeout{>>>>do@hvFloat@doublePAGE->oddpage->bindCorr=\the\hvSet@bindCorrection}%
+ \hv@typeout{>>>>do@hvFloat@doublePAGE->oddpage->hv@leftPageObjectWidth=\the\hv@leftPageObjectWidth}%
\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
+ \noindent
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \null
+ \global\savebox\hv@boxLeftPage{\clipbox*{0 -\depth{} \hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}}%
+ \usebox\hv@boxLeftPage
+ \newpage
+ \expandafter\global\expandafter\savebox\expandafter\hvObjectBox\expandafter{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \hspace*{-\dimexpr\hv@tempWidthA}%
+ \noindent
+% \usebox\hv@boxRightPage
+ \clipbox*{\the\hv@leftPageObjectWidth{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}%
+ \ifnum#1>0
\medskip
\ifdim\dp\hvObjectBox > \z@
\rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
}}%
\else
\rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
}}%
\fi
+ \else
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \fi
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
+ \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 % caption right and rotated
+ \afterpage{%
+ \noindent
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \null
+ \global\savebox\hv@boxLeftPage{\clipbox*{0 -\depth{} \hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}}%
+ \usebox\hv@boxLeftPage
+ \newpage
+ \expandafter\global\expandafter\savebox\expandafter\hvObjectBox\expandafter{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \hspace*{-\dimexpr\hv@tempWidthA}%
+ \noindent
+% \usebox\hv@boxRightPage
+ \clipbox*{\the\hv@leftPageObjectWidth{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}%
+ \ifnum#1>0
\medskip
\ifdim\dp\hvObjectBox > \z@
\rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
}}%
\else
\rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
}}%
\fi
+ \else
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\else
- \ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \fi
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\ifx\hv@label\@empty\else\expandafter\global\expandafter\label\expandafter{\hv@label}\fi}%
\fi
- \newpage
+ \fi
+ \newpage
}}%
\fi
\endgroup
}
%
-\def\do@hvFloat@doubleFULLPAGE#1{% image on left and right page with caption on the right ----------------------------------
+%% ||1in+evenside --- |1in+oddside ---||
+%
+\def\do@hvFloat@doubleFULLPAGE#1{% image on left and right page with caption before/below/right/after
% #1-> 0/1 caption under/right
- \hv@typeout{>>>>do@hvFloat@doubleFULLPAGE}%
+ \ifx\hvSet@capPos\hv@After \hv@@capPos=1
+ \else
+ \ifx\hvSet@capPos\hv@Before \hv@@capPos=0
+ \else
+ \hv@@capPos=2 % other caption type
+ \fi\fi
\checkoddpage
\global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \global\setlength\hv@tempWidthA{\the\dimexpr-\oddsidemargin-1in-\parindent+\hvSet@bindCorrection}%
+ \global\setlength\hv@leftPageObjectWidth{\the\dimexpr\paperwidth-\hvSet@bindCorrection}%
+ \expandafter\captionsetup\expandafter{\hv@caption@format}%
\ifoddpage
- \hv@typeout{>>>>>doubleFULLPAGE->oddpage}%
+ \ifcase\hv@@capPos
+ \do@hvFloat@doubleFULLPAGE@CaptionBefore
+ \or
+ \do@hvFloat@doubleFULLPAGE@CaptionAfter
+ \else
+ \do@hvFloat@doubleFULLPAGE@CaptionOther{#1}%
+ \fi% \ifcase
+ \else% we have an even page
+ \hv@typeout{>>>>>doubleFULLPAGE->evenpage}%
+ \ifcase\hv@@capPos% Before
+ \afterpage{\do@hvFloat@doubleFULLPAGE@CaptionBefore}%
+ \or
+ \afterpage{\do@hvFloat@doubleFULLPAGE@CaptionAfter}%
+ \else % Any other caption
+ \afterpage{\do@hvFloat@doubleFULLPAGE@CaptionOther{#1}}%
+ \fi%% \ifcase
+ \fi% main ifoddpage
+ \endgroup% started at main macro \hvFloat
+}
+
+\def\do@hvFloat@doubleFULLPAGE@CaptionBefore{%
+ \begin{\hv@floatType}[b]
+ \ifhv@separatorLine\drawSepLine\vspace{\smallskipamount}\fi
+ \expandafter\captionsetup\expandafter{\hv@caption@format}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label-cap}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label-cap}}%
+ \fi
+ \global\addtocounter{\hv@floatType}{-1}% to get the same <object>-ref as "label"-cap
+ \end{\hv@floatType}%
+ \afterpage{%
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% no interlineskip
+ \hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}%
+ \thispagestyle{empty}%
+ \refstepcounter{\hv@floatType}%
+ \expandafter\label\expandafter{\hv@label}%
+ \global\addtocounter{\hv@floatType}{-1}% to get the same <object>-ref as "label"-cap
+ \clipbox*{0 0 \the\hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}%
\afterpage{%
- \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
- \begingroup
- \nointerlineskip
- \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% no interlineskip
- \hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}%
- \endgroup
- \AtBeginShipoutNext{\thispagestyle{empty}}%
- \clipbox*{0 0 \paperwidth{} \height}{\usebox\hvObjectBox}%
- \newpage
- \AtBeginShipoutNext{\thispagestyle{empty}}%
- \begingroup
- \nointerlineskip
- \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% -0.5\paperheight+0.5\ht\hvObjectBox
- \hspace*{\the\dimexpr-\oddsidemargin-\parindent-1in}%
- \endgroup
- \clipbox*{\paperwidth{} 0 \wd\hvObjectBox{} \paperheight{}}{\usebox\hvObjectBox}%
- \savebox\hvCaptionBox{\parbox{0.9\ht\hvObjectBox}{%
- \captionof*{\hv@floatType}{\hv@longCap}}}%
-% \captionof*{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
- \ifnum#1>0
- \ifdim\dimexpr\ht\hvCaptionBox+\wd\hvObjectBox\relax < 2\paperwidth
- \hv@typeout{>>>>>doubleFULLPAGE->oddpage->floatRefToObject=false}%
- \rotatebox{90}{\qquad\parbox{0.9\ht\hvObjectBox}{%
- \if$\hv@shortCap$
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \fi
- }}%
-% \fi
- \else
- \put(-\ht\hvCaptionBox,0.5\ht\hvObjectBox){\makebox(0,0){\rotatebox{90}{\minipage{\textwidth}\centering
- \parbox{0.8\textwidth}{%
- \hv@typeout{>>>>>doubleFULLPAGE->oddpage->#1<0->floatRefToObject=false}%
- \ifx\relax\hv@shortCap\relax
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \fi
- }%
- \endminipage}}}%
- \fi
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \thispagestyle{empty}%
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% -0.5\paperheight+0.5\ht\hvObjectBox
+ \hspace*{\hv@tempWidthA}%
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \clipbox*{\the\hv@leftPageObjectWidth{} \dp\hvObjectBox{} \wd\hvObjectBox{} \ht\hvObjectBox}{\usebox\hvObjectBox}%
+ \refstepcounter{\hv@floatType}%
+ \expandafter\label\expandafter{\hv@label-2}%
+ \newpage
+ }}%
+}
+
+\def\do@hvFloat@doubleFULLPAGE@CaptionAfter{%
+ \afterpage{%
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% no interlineskip
+ \hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}%
+ \thispagestyle{empty}%
+ \refstepcounter{\hv@floatType}%
+ \expandafter\label\expandafter{\hv@label}%
+ \global\addtocounter{\hv@floatType}{-1}% to get the same <object>-ref as "label"-cap
+ \clipbox*{0 0 \the\hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}%
+ \afterpage{%
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \thispagestyle{empty}%
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% -0.5\paperheight+0.5\ht\hvObjectBox
+ \hspace*{\hv@tempWidthA}%
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \clipbox*{\the\hv@leftPageObjectWidth{} \dp\hvObjectBox{} \wd\hvObjectBox{} \ht\hvObjectBox}{\usebox\hvObjectBox}%
+ \refstepcounter{\hv@floatType}%
+ \expandafter\label\expandafter{\hv@label-2}%
+ \global\addtocounter{\hv@floatType}{-1}% to get the same <object>-ref as "label"-cap
+ \newpage
+ \begin{\hv@floatType}[b]
+ \ifhv@separatorLine\drawSepLine\vspace{\smallskipamount}\fi
+ \expandafter\captionsetup\expandafter{\hv@caption@format}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label-cap}}%
\else
- \ifx\relax\hv@shortCap\relax
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label-cap}}%
+ \fi
+ \end{\hv@floatType}%
+ }}%
+}
+
+\def\do@hvFloat@doubleFULLPAGE@CaptionOther#1{%
+ \afterpage{%
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \thispagestyle{empty}%
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% -0.5\paperheight+0.5\ht\hvObjectBox
+ \hspace*{\hv@tempWidthA}%
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \clipbox*{0 0 \the\hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}%
+ \refstepcounter{\hv@floatType}%
+ \expandafter\label\expandafter{\hv@label}%
+ \global\addtocounter{\hv@floatType}{-1}% to get the same <object>-ref as "label"-cap
+ \afterpage{%
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \thispagestyle{empty}%
+ \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% -0.5\paperheight+0.5\ht\hvObjectBox
+ \hspace*{\hv@tempWidthA}%
+ \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
+ \clipbox*{\the\hv@leftPageObjectWidth{} \dp\hvObjectBox{} \wd\hvObjectBox{} \ht\hvObjectBox}{\usebox\hvObjectBox}%
+ \refstepcounter{\hv@floatType}%
+ \expandafter\label\expandafter{\hv@label-2}%
+ \global\addtocounter{\hv@floatType}{-1}% to get the same <object>-ref as "label"-cap
+ \savebox\hvCaptionBox{\parbox{0.9\ht\hvObjectBox}{\captionof*{\hv@floatType}{\hv@longCap}}}%
+ \ifnum#1 > 0
+ \setlength\hv@tempWidthA{\dimexpr\ht\hvCaptionBox+\wd\hvObjectBox+2\hvSet@bindCorrection}%
+ \ifdim\hv@tempWidthA < 2\paperwidth
+ \rotatebox{90}{\qquad\parbox{0.9\ht\hvObjectBox}{%
+ \expandafter\captionsetup\expandafter{\hv@caption@format}%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label-cap}}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label-cap}}%
\fi
+ }}% rotatebox
+ \else% ifdim: no space left on page
+ \put(-\ht\hvCaptionBox,0.5\ht\hvObjectBox){\makebox(0,0){\rotatebox{90}{\minipage{\textwidth}\centering
+ \parbox{0.8\textwidth}{%
+ \ifx\hv@shortCap\@empty
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label-cap}}%
+ \else
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label-cap}}%
+ \fi
+ }%
+ \endminipage}}}%
\fi
- \newpage
- }%
- \else
- \hv@typeout{>>>>>doubleFULLPAGE->evenpage}%
- \afterpage{%
- \AddToHookNext{shipout/before}{%
- \newpage
- \AddToHook{begin/page}{\thispagestyle{empty}}
- \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
- \begingroup
- \nointerlineskip
- \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% no interlineskip
- \hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}%
- \endgroup
- \AtBeginShipoutNext{\thispagestyle{empty}}%
- \clipbox*{0 0 \paperwidth{} \paperheight}{\usebox\hvObjectBox}%
- \newpage
- \begingroup
- \nointerlineskip
- \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip+2\lineskip}% no interlineskip
- \hspace*{\the\dimexpr-\oddsidemargin-\parindent-1in}%
- \endgroup
- \clipbox*{\paperwidth{} 0 \wd\hvObjectBox{} \paperheight{}}{\usebox\hvObjectBox}%
- \AtBeginShipoutNext{\thispagestyle{empty}}%
- \savebox\hvCaptionBox{\parbox{0.9\ht\hvObjectBox}{\captionof*{\hv@floatType}[\hv@shortCap]{\hv@longCap}}}%
-% \captionof*{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}}}%
- \ifnum#1>0
- \ifdim\dimexpr\ht\hvCaptionBox+\wd\hvObjectBox\relax < 2\paperwidth
- \rotatebox{90}{\minipage{\the\ht\hvObjectBox}\centering\parbox{0.75\textwidth}{%
- \ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \fi
- }%
- \endminipage}%
- \else% no space on the right, put it over the imag
- \put(-\ht\hvCaptionBox,0.5\ht\hvObjectBox){\makebox(0,0){\rotatebox{90}{\minipage{\the\dimexpr\ht\hvObjectBox}%
- \centering\parbox{0.8\textwidth}{%
- \ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
- \fi
- }%
- \endminipage}}}%
- \fi
- \else
+ \else% ifnum, caption not rotated, under or over the right page
+ \setlength\hv@tempWidthA{\dimexpr\paperheight-\ht\hvObjectBox}%
+ \ifdim\hv@tempWidthA > \ht\hvCaptionBox
+ \else
+ \put(\the\dimexpr-\textwidth-1in,\the\dimexpr\ht\hvCaptionBox+\abovecaptionskip+\belowcaptionskip){\makebox[0pt][l]{\parbox{\textwidth}{%%
+ \expandafter\captionsetup\expandafter{\hv@caption@format}%
\ifx\hv@shortCap\@empty
- \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}{\hv@longCap\expandafter\label\expandafter{\hv@label-cap}}%
\else
- \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label}}%
+ \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap\expandafter\label\expandafter{\hv@label-cap}}%
\fi
+ }}}%
\fi
- \newpage
- }%
+ \fi% end \ifnum#1>0
+ \newpage
}%
- \fi
- \endgroup
+ }%
}
+
\def\setBottomCaption{%
\begin{\hv@floatType}[!b]%
\ifhv@separatorLine\drawSepLine\fi
@@ -1295,7 +1383,7 @@
\def\getMultiSubCaptionAndLabel{%
\global\sbox\hvCaptionBox{\minipage{\linewidth}%
- \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi
+ \ifx\hv@caption@format\@empty\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
@@ -1312,7 +1400,11 @@
\def\getMultiSubObjectAndLabel{%
\global\sbox\hvObjectBox{\minipage{\linewidth}%
- \ifx\relax\hv@subcaption@format\relax\else\captionsetup[sub]{\hv@subcaption@format}\fi
+ \ifx\hv@subcaption@format\@empty\else
+ \expandafter
+ \captionsetup\expandafter[\expandafter s\expandafter u\expandafter b\expandafter]\expandafter
+ {\hv@subcaption@format}%
+ \fi
\ifx\hvSet@objectPos\hv@Right\raggedleft\else
\ifx\hvSet@objectPos\hv@Left\raggedleft\else
\ifx\hvSet@objectPos\hv@Center\centering
@@ -1339,12 +1431,13 @@
\endgroup
\ifnum\hv@cnta<\clist_count:N\l_clist_Type\par\hv@vskip\fi
\advance\hv@cnta by \@ne
- \ifnum\hv@cnta<\hv@cntb
+ \ifnum\hv@cnta<\hv@cntb
\repeat
\edef\@tempa{\clist_item:Nn\l_clist_Label{1}}% the main label at the end
\ifx\@tempa\@empty
\else
- \refstepcounter{\@captype}
+ \addtocounter{\@captype}{-1}% to get the same <object>-ref as "label"-cap
+ \refstepcounter{\@captype}%
\expandafter\label\expandafter{\@tempa}%
\fi
\endminipage}%