From 667ed445792613a39df20686582bb5d167317779 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 3 Apr 2022 20:55:41 +0000 Subject: hvfloat (3apr22) git-svn-id: svn://tug.org/texlive/trunk@62893 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/hvfloat/Changes | 2 + Master/texmf-dist/doc/latex/hvfloat/hvfloat.pdf | Bin 5029031 -> 5031955 bytes Master/texmf-dist/doc/latex/hvfloat/hvfloat.tex | 28 +++++- Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty | 120 +++++++++++++++--------- 4 files changed, 104 insertions(+), 46 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/hvfloat/Changes b/Master/texmf-dist/doc/latex/hvfloat/Changes index 578c9be771e..5cd0c94e9d1 100644 --- a/Master/texmf-dist/doc/latex/hvfloat/Changes +++ b/Master/texmf-dist/doc/latex/hvfloat/Changes @@ -1,4 +1,6 @@ hvfloat.sty: +2.38 2022-04-02 - added option l for capWidth to get a caption with linewidth, + if also using the option wide for the object 2.37 2022-02-28 - fix bug for doublepage floats in twoside and twocolumn mode and captions after the image 2.36 2022-02-22 - fix bug for outer captions (was wrong) diff --git a/Master/texmf-dist/doc/latex/hvfloat/hvfloat.pdf b/Master/texmf-dist/doc/latex/hvfloat/hvfloat.pdf index 10e1519bf17..856cdd1ffb3 100644 Binary files a/Master/texmf-dist/doc/latex/hvfloat/hvfloat.pdf and b/Master/texmf-dist/doc/latex/hvfloat/hvfloat.pdf differ diff --git a/Master/texmf-dist/doc/latex/hvfloat/hvfloat.tex b/Master/texmf-dist/doc/latex/hvfloat/hvfloat.tex index 70113c0a7e0..820136ff360 100644 --- a/Master/texmf-dist/doc/latex/hvfloat/hvfloat.tex +++ b/Master/texmf-dist/doc/latex/hvfloat/hvfloat.tex @@ -1,4 +1,4 @@ -%% $Id: hvfloat.tex 318 2021-11-20 07:30:54Z herbert $ +%% $Id: hvfloat.tex 488 2022-04-02 19:32:17Z herbert $ \listfiles \errorcontextlines=100 \documentclass[twoside,paper=a4,usegeometry]{scrartcl} @@ -1038,8 +1038,6 @@ change its side due to the setting \Lkeyset{capPos=outer}. \hvblindtext - - \begin{lstlisting} \hvFloat[wide, capPos=inner, @@ -1086,6 +1084,30 @@ the option \texttt{wide}.}{fig:812} \endgroup +With the optional argument \Lkeyset{capWidth=l} the caption can be terminated +to the current line width. With the optional argument \Lkeyset{capHPos=right} one cat set +the caption to the left, center, or right of the full width which is linewidth and margin width. + + +\begin{lstlisting} +\hvFloat[capPos=bottom,capWidth=l,wide,capHPos=right]{figure} + {\includegraphics[width=0.49\hvWideWidth]{images/CTAN}\quad + \includegraphics[width=0.49\hvWideWidth]{images/CTAN}} + {\hvblindtext} + {label} +\end{lstlisting} + + +\marginnote{Fig.~\ref{label}} +\hvFloat[capPos=bottom,capWidth=l,wide,capHPos=right]{figure} + {\includegraphics[width=0.49\hvWideWidth]{images/CTAN}\quad + \includegraphics[width=0.49\hvWideWidth]{images/CTAN}} + {\hvblindtext} + {label} + + +\hvblindtext + \section{The star version \Lcs{hvFloat*}}\label{star-version0} In the \Index{twocolumn} mode the floating environment can be set over both diff --git a/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty b/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty index 739d7599940..c3d8d0e57d3 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 392 2022-01-09 10:20:33Z herbert $ +%% $Id: hvfloat.sty 488 2022-04-02 19:32:17Z herbert $ %% %% %% IMPORTANT NOTICE: @@ -15,8 +15,8 @@ %% `hvfloat' offers rotating of captions and objects for floats %% \NeedsTeXFormat{LaTeX2e} -\def\fileversion{2.36} -\def\filedate{2022/02/22} +\def\fileversion{2.38} +\def\filedate{2022/04/02} %\message{`hvfloat' v\fileversion, \filedate\space (Herbert Voss)} \ProvidesPackage{hvfloat}[\filedate\space v\fileversion\space special floating objects (hv)] \let\hvFloatFileVersion\fileversion @@ -68,6 +68,8 @@ \newlength\hvMaxCapWidth %\AtBeginDocument{% % \setlength\hv@BottomSpace{\dimexpr\paperheight-1in-\topmargin-\headheight-\headsep-\textheight}} +\newlength\hvFullWidth % only for user purpose +\setlength\hvFullWidth{\dimexpr\textwidth+\marginparwidth+\marginparsep} \newsavebox\hvObjectBox \newsavebox\hvCaptionBox @@ -92,6 +94,7 @@ \def\hv@Even{evenPage} \def\hv@Odd{oddPage} \def\hv@Natural{n} +\def\hv@LineWidth{l} \def\hv@Width{w} \def\hv@Height{h} \def\hv@Zero{0} @@ -104,7 +107,7 @@ \define@key{hvSet}{rotAngle}[0]{% rotates caption AND image together \def\hvSet@rotAngle{#1}% } -\define@key{hvSet}{capWidth}[n]{% (n)atural width|object (w)idth)|object (h)eight| +\define@key{hvSet}{capWidth}[n]{% (l)inewidth|(n)atural width|object (w)idth)|object (h)eight| \def\hvSet@capWidth{#1}% } \define@key{hvSet}{capAngle}[0]{% -360..+360, only integers @@ -619,37 +622,42 @@ \ifx\hvSet@capWidth\hv@Height% captionwidth=objectheight \setlength\hvCapWidth{\ht\hvObjectBox}% \else - \ifx\hvSet@capWidth\hv@Natural% captionwidth=\linewidth-\objectwidth-separation - \ifhv@capbeside - \ifhv@wide - \setlength\hvCapWidth{\the\dimexpr\hvWideWidth-\hvObjectWidth-\hv@floatCapSep\relax}% - \else - \ifhv@star - \setlength\hvCapWidth{\the\dimexpr\textwidth-\hvObjectWidth-\hv@floatCapSep\relax}% + \ifx\hvSet@capWidth\hv@LineWidth% captionwidth=objectheight + \setlength\hvCapWidth{\linewidth}% + \typeout{>>>>\the\hvCapWidth}% + \else + \ifx\hvSet@capWidth\hv@Natural% captionwidth=\linewidth-\objectwidth-separation + \ifhv@capbeside + \ifhv@wide + \setlength\hvCapWidth{\the\dimexpr\hvWideWidth-\hvObjectWidth-\hv@floatCapSep\relax}% \else - \setlength\hvCapWidth{\the\dimexpr\linewidth-\hvObjectWidth-\hv@floatCapSep\relax}% + \ifhv@star + \setlength\hvCapWidth{\the\dimexpr\textwidth-\hvObjectWidth-\hv@floatCapSep\relax}% + \else + \setlength\hvCapWidth{\the\dimexpr\linewidth-\hvObjectWidth-\hv@floatCapSep\relax}% + \fi \fi - \fi - \else - \setlength\hvCapWidth{\columnwidth}% - \fi - \else - \ifhv@capbeside - \ifhv@wide - \setlength\hvCapWidth{\hvSet@capWidth\hvWideWidth}% - \setlength\@tempdima{\the\dimexpr\hvWideWidth-\hvObjectWidth-\hv@floatCapSep\relax}% \else - \setlength\hvCapWidth{\hvSet@capWidth\columnwidth}% - \setlength\@tempdima{\the\dimexpr\columnwidth-\hvObjectWidth-\hv@floatCapSep\relax}% - \fi - \ifdim\hvCapWidth>\@tempdima - \setlength\hvCapWidth{\@tempdima}% + \setlength\hvCapWidth{\columnwidth}% \fi \else - \ifhv@wide - \setlength\hvCapWidth{\hvSet@capWidth\hvWideWidth}% + \ifhv@capbeside + \ifhv@wide + \setlength\hvCapWidth{\hvSet@capWidth\hvWideWidth}% + \setlength\@tempdima{\the\dimexpr\hvWideWidth-\hvObjectWidth-\hv@floatCapSep\relax}% + \else + \setlength\hvCapWidth{\hvSet@capWidth\columnwidth}% + \setlength\@tempdima{\the\dimexpr\columnwidth-\hvObjectWidth-\hv@floatCapSep\relax}% + \fi + \ifdim\hvCapWidth>\@tempdima + \setlength\hvCapWidth{\@tempdima}% + \fi \else - \setlength\hvCapWidth{\hvSet@capWidth\columnwidth}% + \ifhv@wide + \setlength\hvCapWidth{\hvSet@capWidth\hvWideWidth}% + \else + \setlength\hvCapWidth{\hvSet@capWidth\columnwidth}% + \fi \fi \fi \fi @@ -658,6 +666,7 @@ \saveCaptionSkip% we put this space ourselve \ifnum\hvSet@capAngle=0 % need rotation? \savebox\hvCaptionBox{% NO rotation + \typeout{>>>>\the\hvCapWidth}% \minipage[b]{\hvCapWidth}%% minipage, to get hyphenation % \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi \ifhv@nonFloat @@ -688,9 +697,9 @@ \fi \fi \endminipage - }% + }% end CaptionBox without rotation \else - \savebox\hvCaptionBox{% Rotation + \savebox\hvCaptionBox{% with Rotation \rotatebox{\hvSet@capAngle}{% \minipage[b]{\hvCapWidth}%% minipage, to get hyphenation % \ifx\relax\hv@caption@format\relax\else\expandafter\captionsetup\expandafter{\hv@caption@format}\fi @@ -777,11 +786,12 @@ \ifoddpageoroneside\hv@@capPos=0\else\hv@@capPos=2\fi \else \ifx\hvSet@capPos\hv@Outer - \ifoddpageoroneside\hv@@capPos=2\else\hv@@capPos=0\fi + \ifoddpage\hv@@capPos=2\else\hv@@capPos=0\fi +% \ifoddpageoroneside\hv@@capPos=2\else\hv@@capPos=0\fi % even page (left=0) | odd page (oneside) (right=2) \else \ifx\hvSet@capPos\hv@Before - \hv@@capPos=0% same as cappos=right + \hv@@capPos=0% same as cappos=left \else \ifx\hvSet@capPos\hv@After \hv@@capPos=2% same as capPos=right @@ -796,7 +806,8 @@ %%%% %\typeout{>>>>>>>>>Pos: \the\hv@@capPos}% \savebox{\@tempboxa}{% ***** @tempbox start - \expandafter\ifcase\the\hv@@capPos% 0 is LEFT START \ifcase + \expandafter% + \ifcase\the\hv@@capPos % 0 is LEFT START \ifcase \ifx\hvSet@capVPos\hv@Center \put@CaptionBox \hspace{\hv@floatCapSep}% capfloatsep @@ -846,7 +857,7 @@ \hspace{\hv@floatCapSep}% capfloatsep \put@CaptionBox[1]% \else - \put@ObjectBox[2]% + \put@ObjectBox[2]% bottom \hspace{\hv@floatCapSep}% capfloatsep \put@CaptionBox[2]% \fi @@ -1122,12 +1133,17 @@ \ifoddpage \if@twocolumn \if@firstcolumn + \hv@typeout{do@hvFloat@doublePage:oddpage->twocolumn->firstcolumn}% \ifhv@switchType + \hv@typeout{hvfloat: switched to floattype p}% \afterpage{\do@hvFloat@doublePAGECaptionRight{#1}}% \else - \afterpage{\afterpage{\do@hvFloat@doublePageCaptionRight{#1}}}% + \hv@typeout{calling do@hvFloat@doublePageCaptionRight}% + %\afterpage{ + \afterpage{\do@hvFloat@doublePageCaptionRight{#1}}%}% \fi \else + \hv@typeout{do@hvFloat@doublePage:oddpage->twocolumn->secondcolumn}% \ifhv@tugboat \do@hvFloat@doublePageCaptionRight{#1}% \else @@ -1174,19 +1190,20 @@ } % \def\do@hvFloat@doublePageCaptionRight#1{% image on left and right page with caption on the right page ---------------------------------- - \do@hvFloat@doublePageCaptionRightObjectLeft{0pt}% + \hv@typeout{do@hvFloat@doublePageCaptionRight->start}% + \do@hvFloat@doublePageCaptionRightObjectLeft{0pt}% \afterpage{\do@hvFloat@doublePageCaptionRightObjectRight{#1}}% } % \def\do@hvFloat@doublePageCaptionRightObjectLeft#1{% left part of the object + \hv@typeout{do@hvFloat@doublePageCaptionRightObjectLeft: start}% \begin{\hv@floatType*}[!t] \hv@set@noverticalSpace \hfuzz=\maxdimen \let\c@hv@tempCNTfigA\c@figure \let\c@hv@tempCNTtabA\c@table \expandafter\hvFloatSet\expandafter{\hv@save@setting}% - \expandafter\hvFloatSet\expandafter{\hv@save@setting}% - \hv@typeout{Floatpositionsparameter: !t}% + \hv@typeout{Float position parameter is for left page: !t}% \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% \clipbox*{0 -\depth{} \hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}% \ifx\hv@label\@empty @@ -1295,16 +1312,20 @@ \expandafter\global\expandafter\savebox\expandafter\hv@boxRightPage\expandafter{\clipbox*{\hv@leftPageObjectWidth{} -\depth{} \width{} \height}{\usebox\hvObjectBox}}% \checkoddpage \ifoddpage + \hv@typeout{do@hvFloat@doublePAGE: oddpage}% \if@twocolumn \if@firstcolumn + \hv@typeout{do@hvFloat@doublePAGE: ifoddpage->twocolumn->firstcolumn}% \afterpage{\do@hvFloat@doublePAGECaptionRight{#1}}% \else + \hv@typeout{do@hvFloat@doublePAGE: ifoddpage->twocolumn->secondcolumn}% \do@hvFloat@doublePAGECaptionRight{#1}% \fi \else \do@hvFloat@doublePAGECaptionRight{#1}% \fi \else + \hv@typeout{do@hvFloat@doublePAGE: evenpage}% \if@twocolumn \if@firstcolumn \afterpage{\afterpage{\afterpage{\do@hvFloat@doublePAGECaptionRight{#1}}}}% @@ -1320,6 +1341,7 @@ % \def\do@hvFloat@doublePAGECaptionRight#1{% image on left and right page with caption on the right ---------------------------------- % #1-> 0/1 caption under/right + \hv@typeout{do@hvFloat@doublePAGECaptionRight->start}% \afterpage{% \hfuzz=\maxdimen \expandafter\hvFloatSet\expandafter{\hv@save@setting}% @@ -1395,10 +1417,15 @@ % \savebox\hv@rightBox{\clipbox*{\the\hv@leftPageObjectWidth{} \depth{} \width{} \height}{\usebox\hvObjectBox}}% % \expandafter\captionsetup\expandafter{\hv@caption@format}% \ifoddpage + \hv@typeout{do@hvFloat@doubleFULLPAGE: ifoddpage=true}% \ifcase\hv@@capPos % =0 Caption before + \hv@typeout{do@hvFloat@doubleFULLPAGE: caption before}% \if@twocolumn + \hv@typeout{do@hvFloat@doubleFULLPAGE: twocolumn=true}% \if@firstcolumn + \hv@typeout{do@hvFloat@doubleFULLPAGE: firstcolumn=true}% \ifhv@twoColumnCaption + \hv@typeout{do@hvFloat@doubleFULLPAGE: twoColumnCaption=true}% \set@Normal@Bottom@Caption* \afterpage{\do@hvFloat@doubleFULLPAGE@CaptionBefore}% \else @@ -1413,10 +1440,14 @@ \do@hvFloat@doubleFULLPAGE@CaptionBefore \fi \or % =1 Caption after + \hv@typeout{do@hvFloat@doubleFULLPAGE: caption after}% \ifhv@twoColumnCaption + \hv@typeout{do@hvFloat@doubleFULLPAGE: twoColumnCaption=true}% \if@firstcolumn + \hv@typeout{do@hvFloat@doubleFULLPAGE: firstcolumn=true}% \afterpage{\do@hvFloat@doubleFULLPAGE@CaptionAfterTwoCol}% \else + \hv@typeout{do@hvFloat@doubleFULLPAGE: firstcolumn=false}% \do@hvFloat@doubleFULLPAGE@CaptionAfterTwoCol \fi \else @@ -1573,8 +1604,7 @@ \refstepcounter{hv@tempCNTtabA}% before caption \fi \ifx\hv@label\@empty\else\label{\hv@label}\fi - \newpage - \if@twocolumn\null\newpage\fi + \newpage\if@twocolumn\null\newpage\fi \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% \thispagestyle{empty}% \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip-\parskip+1.5\lineskip}% -0.5\paperheight+0.5\ht\hvObjectBox @@ -1606,7 +1636,9 @@ } \def\do@hvFloat@doubleFULLPAGE@CaptionAfterTwoCol{% + \hv@typeout{do@hvFloat@doubleFULLPAGE@CaptionAfterTwoCol: start} % \afterpage{% + \hv@typeout{do@hvFloat@doubleFULLPAGE@CaptionAfterTwoCol: afterpage start} % \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip-\parskip+1.5\lineskip}% no interlineskip \hspace*{\the\dimexpr-\evensidemargin-\parindent-1in}% @@ -1618,7 +1650,8 @@ \fi \ifx\hv@label\@empty\else\label{\hv@label}\fi \clipbox*{0 0 \the\hv@leftPageObjectWidth{} \height}{\usebox\hvObjectBox}% - \newpage\if@twocolumn\null\newpage\fi + \newpage\if@twocolumn\null\newpage\fi + \hv@typeout{do@hvFloat@doubleFULLPAGE@CaptionAfterTwoCol: insert newpage} % \global\savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% \thispagestyle{empty}% \vspace*{\the\dimexpr-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip-\parskip+1.5\lineskip}% -0.5\paperheight+0.5\ht\hvObjectBox @@ -1631,7 +1664,7 @@ \refstepcounter{hv@tempCNTtabB}% before caption \fi \ifx\hv@label\@empty\else\label{\hv@label-2}\fi - \newpage + \newpage\if@twocolumn\null\newpage\fi \begin{\hv@floatType*}[!b] \hv@twoColumnCaptiontrue \ifhv@separatorLine\drawSepLine\fi @@ -1648,6 +1681,7 @@ \ifx\hv@label\@empty\else\label{\hv@label-cap}\fi \end{\hv@floatType*}% }% + \hv@typeout{do@hvFloat@doubleFULLPAGE@CaptionAfterTwoCol: afterpage done} % } \def\do@hvFloat@doubleFULLPAGE@CaptionOther#1{% -- cgit v1.2.3