Debian Codegraph @

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

raw
1 %% Herbert Voss <[email protected]>
2 %% Copyright (C) 2026
3 %%
4 %% This program can be redistributed and/or modified under the terms
5 %% of the LaTeX Project Public License Distributed from CTAN archives
6 %% in directory macros/latex/base/lppl.txt.
7 %%
8 %% width=2\paperwidth, height=variable
9 %%
10 %% ||1in+evenside --- |1in+oddside ---|| Image is 2\paperwidth wide, height is variable or user set
11 %
12 \def\do@hvFloat@doubleFullPage#1{% image on left and right page with caption before/below/right/after
13 % #1-> not used, caption always below lefr or below right
14 \setcounter{topnumber}{1}%
15 \setcounter{dbltopnumber}{1}%
16 \expandafter\hvFloatSet\expandafter{\hv@save@setting}%
17 % \ifx\hvSet@capPos\hv@Right\else\ifx\hvSet@capPos\hv@Left\else
18 % \let\hvSet@capPos\hv@Right
19 % \fi\fi
20 \ifx\hv@caption@format\@empty\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi
21 \ifx\hv@subcaption@format\@empty\else
22 \expandafter
23 \captionsetup\expandafter[\expandafter s\expandafter u\expandafter b\expandafter]\expandafter
24 {\hv@subcaption@format}%
25 \fi
26 \let\c@hv@tempCNTfigA\c@figure
27 \let\c@hv@tempCNTtabA\c@table
28 \checkoddpage
29 \ifoddpage
30 \if@twocolumn
31 \if@firstcolumn
32 \afterpage{afterpage{\do@hvFloat@doubleFullPage@ObjectAndCaption}}% 2nd Col and newpage
33 \else
34 \do@hvFloat@doubleFullPage@ObjectAndCaption% odd, 2nd col -> no newpage
35 \fi
36 \else % onecol
37 \afterpage{\do@hvFloat@doubleFullPage@ObjectAndCaption}% oddpage->newpage
38 \fi % end \if@twocolumn
39 \else% evenpage
40 %---------
41 \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
42 \if@twocolumn
43 \if@firstcolumn
44 \afterpage{\afterpage{\afterpage{\do@hvFloat@doubleFullPage@ObjectAndCaption}}}% ->2nd Col left page and newpage
45 \else
46 \afterpage{\afterpage{\do@hvFloat@doubleFullPage@ObjectAndCaption}}% ->newpage ( 2columns)
47 \fi
48 \else % onecol
49 \afterpage{\afterpage{\do@hvFloat@doubleFullPage@ObjectAndCaption}}% evenpage->newpage->newpage
50 \fi % end \if@twocolumn
51 \fi% main ifoddpage
52 \endgroup% started at main macro \hvFloat
53 }
54
55 \def\do@hvFloat@doubleFullPage@ObjectAndCaption{%
56 \begin{\hv@floatType*}[t]
57 \hv@set@noverticalSpace
58 \hfuzz=\maxdimen
59 \vfuzz=\maxdimen
60 \expandafter\hvFloatSet\expandafter{\hv@save@setting}%
61 \hv@leftPageObjectWidth=\dimexpr\paperwidth-\hvSet@bindCorrection%
62 \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
63 \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep}%-\baselineskip-\parskip+1.5\lineskip}% no interlineskip
64 \hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}%
65 \clipbox*{0 -\depth{} \hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}%
66 \ifx\hvSet@capPos\hv@Left % left side a caption
67 \ifhv@onlyText
68 \hv@longCap
69 \else
70 \ifx\hv@shortCap\@empty
71 \captionof{\hv@floatType}{\hv@longCap}%
72 \else
73 \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap}%
74 \fi
75 \fi
76 \ifx\hv@label\@empty\else
77 \expandafter\label\expandafter{\hv@label-cap}%
78 \expandafter\label\expandafter{\hv@label}%
79 \fi
80 \else
81 \ifx\hv@floatType\hv@figure
82 \global\refstepcounter{hv@tempCNTfigA}%
83 \else
84 \global\refstepcounter{hv@tempCNTtabA}% before caption
85 \fi
86 \ifx\hv@label\@empty\else
87 \expandafter\label\expandafter{\hv@label}%
88 \fi
89 \ifhv@global@sameHeight
90 \par\noindent\phantom{\parbox{\textwidth}{\caption*{\hv@longCap}}}%
91 % \vspace{-2pt}%
92 \fi
93 \fi
94 \hv@reset@noverticalSpace
95 \end{\hv@floatType*}%
96 % start right half of the image ----------------- RIGHT
97 \begin{\hv@floatType*}[t]
98 \hv@set@noverticalSpace
99 \hfuzz=\maxdimen
100 \expandafter\hvFloatSet\expandafter{\hv@save@setting}%
101 \hv@leftPageObjectWidth=\dimexpr\paperwidth-\hvSet@bindCorrection
102 \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}%
103 \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep}%-\baselineskip-\parskip+1.5\lineskip}% no interlineskip
104 \hspace*{\the\dimexpr-1in-\oddsidemargin+\hvSet@bindCorrection}%
105 \clipbox*{\the\hv@leftPageObjectWidth{} -\depth{} \width{} \height{}}{\usebox\hvObjectBox}%
106 \ifx\hvSet@capPos\hv@Left % caption is already set on the left side
107 \expandafter\label\expandafter{\hv@label-2}%
108 \ifhv@global@sameHeight
109 \par\noindent\phantom{\parbox{\textwidth}{\caption*{\hv@longCap}}}%
110 \fi
111 \else % Caption on right
112 \ifhv@onlyText
113 \hv@longCap
114 \else
115 \ifx\hv@shortCap\@empty
116 \captionof{\hv@floatType}{\hv@longCap}%
117 \else
118 \captionof{\hv@floatType}[\hv@shortCap]{\hv@longCap}%
119 \fi
120 \fi
121 \ifx\hv@label\@empty\else
122 \expandafter\label\expandafter{\hv@label-cap}%
123 \expandafter\label\expandafter{\hv@label-2}%
124 \fi
125 \fi
126 \hv@reset@noverticalSpace
127 \end{\hv@floatType*}%
128 }