Debian Codegraph @

texmf-dist/tex/latex/hvfloat/hvfloat-2.inc

raw
1 %%
2 %% Herbert Voss <[email protected]>
3 %% Copyright (C) 2026
4 %%
5 %% This program can be redistributed and/or modified under the terms
6 %% of the LaTeX Project Public License Distributed from CTAN archives
7 %% in directory macros/latex/base/lppl.txt.
8 %%
9 %% width=2\textwidth+\leftmargin+\rightmargin height=variable
10 %% _Without_ additional text on the doublepage
11 %%
12 %% ||1in+evenside --- |1in+oddside ---||
13 %
14
15 \def\do@hvFloat@doublePAGE#1{% image on left and right page with caption on the right ----------------------------------
16 % #1-> 0/1 caption under/right
17 % \global\setlength\hv@tempWidthA{\the\dimexpr1in+\oddsidemargin-\hvSet@bindCorrection}%
18 % \global\setlength\hv@leftPageObjectWidth{\the\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection}%
19 \expandafter\global\expandafter\savebox\expandafter\hvObjectBox\expandafter{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
20 \expandafter\global\expandafter\savebox\expandafter\hv@boxLeftPage\expandafter{\clipbox*{0 -\depth{} \hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}}%
21 \expandafter\global\expandafter\savebox\expandafter\hv@boxRightPage\expandafter{\clipbox*{\hv@leftPageObjectWidth{} -\depth{} \width{} \height}{\usebox\hvObjectBox}}%
22 \checkoddpage
23 \ifoddpage
24 \if@twocolumn
25 \if@firstcolumn
26 \afterpage{\do@hvFloat@doublePAGECaptionRight{#1}}%
27 \else
28 \do@hvFloat@doublePAGECaptionRight{#1}%
29 \fi
30 \else
31 \afterpage{\do@hvFloat@doublePAGECaptionRight{#1}}%
32 \fi
33 \else
34 \if@twocolumn
35 \if@firstcolumn
36 \afterpage{\afterpage{\afterpage{\afterpage{\do@hvFloat@doublePAGECaptionRight{#1}}}}}%
37 \else
38 \afterpage{\afterpage{\afterpage{\do@hvFloat@doublePAGECaptionRight{#1}}}}%
39 \fi
40 \else
41 \afterpage{\afterpage{\do@hvFloat@doublePAGECaptionRight{#1}}}% onecolumn/left page
42 \fi
43 \fi
44 \endgroup% startet at main macro
45 }
46 %
47 \def\do@hvFloat@doublePAGECaptionRight#1{% image on left and right page with caption on the right ----------------------------------
48 % #1-> 0/1 caption under/right
49 \hfuzz=\maxdimen
50 \let\c@hv@tempCNTfigA\c@figure
51 \let\c@hv@tempCNTtabA\c@table
52 \expandafter\hvFloatSet\expandafter{\hv@save@setting}%
53 \ifx\hv@caption@format\@empty\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi
54 \ifx\hv@subcaption@format\@empty\else
55 \expandafter
56 \captionsetup\expandafter[\expandafter s\expandafter u\expandafter b\expandafter]\expandafter
57 {\hv@subcaption@format}%
58 \fi
59 \ifhv@useOBox
60 \global\let\hvObjectBox\hvOBox
61 \else
62 \global\savebox\hvObjectBox{\hv@floatObject}%
63 \fi
64 \noindent
65 \global\hv@tempWidthA=\the\dimexpr1in+\oddsidemargin-\hvSet@bindCorrection%
66 \global\hv@leftPageObjectWidth=\the\dimexpr\paperwidth-1in-\evensidemargin-\hvSet@bindCorrection%
67 \clipbox*{0 -\depth{} \hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}%
68 \ifx\hv@label\@empty
69 \else
70 \ifx\hv@floatType\hv@figure
71 \global\refstepcounter{hv@tempCNTfigB}%
72 \else
73 \global\refstepcounter{hv@tempCNTtabB}% before caption
74 \fi
75 \label{\hv@label}
76 \fi
77 \null\newpage\if@twocolumn\null\newpage\fi
78 \expandafter\global\expandafter\savebox\expandafter\hvObjectBox\expandafter{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
79 \noindent
80 \hspace*{\dimexpr-\hv@tempWidthA}%
81 \clipbox*{\the\hv@leftPageObjectWidth{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}%
82 \ifx\hv@label\@empty
83 \else
84 \ifx\hv@floatType\hv@figure
85 \global\refstepcounter{hv@tempCNTfigB}%
86 \else
87 \global\refstepcounter{hv@tempCNTtabB}% before caption
88 \fi
89 \label{\hv@label-2}%
90 \fi
91 \begingroup
92 \ifnum#1>0
93 \medskip
94 \ifdim\dp\hvObjectBox > \z@
95 \rotatebox[origin=c]{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
96 \ifx\relax\hv@shortCap\relax
97 \captionof{\hv@floatType}{\hv@longCap}%
98 \else
99 \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap}%
100 \fi
101 \ifx\hv@label\@empty\else\label{\hv@label-cap}\fi
102 }}%
103 \else
104 \rotatebox{90}{\parbox{\the\dimexpr\ht\hvObjectBox+\dp\hvObjectBox}{%
105 \ifx\relax\hv@shortCap\relax
106 \captionof{\hv@floatType}{\hv@longCap}%
107 \else
108 \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap}%
109 \fi
110 \ifx\hv@label\@empty\else\label{\hv@label-cap}\fi
111 }}%
112 \fi
113 \else% caption not rotated
114 \par\noindent
115 \parbox{\textwidth}{%
116 \expandafter\hvFloatSet\expandafter{\hv@save@setting,capFormat={font={tiny},labelsep=newline}}%
117 \ifx\relax\hv@shortCap\relax
118 \captionof{\hv@floatType}{\hv@longCap}%
119 \else
120 \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap}%
121 \fi
122 \ifx\hv@label\@empty\else\label{\hv@label-cap}\fi
123 }%
124 \fi
125 \endgroup
126 \newpage\if@twocolumn\null\newpage\fi
127 }
128 %