From 562c23a85a90c442a2b6fe5dde23b3a33e8c4acd Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 19 Sep 2017 23:23:23 +0000 Subject: hvfloat (18sep17) git-svn-id: svn://tug.org/texlive/trunk@45347 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/hvfloat/hvfloat-fps.sty | 27 +++++ Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty | 125 ++++++++++----------- 2 files changed, 88 insertions(+), 64 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/hvfloat/hvfloat-fps.sty (limited to 'Master/texmf-dist/tex/latex/hvfloat') diff --git a/Master/texmf-dist/tex/latex/hvfloat/hvfloat-fps.sty b/Master/texmf-dist/tex/latex/hvfloat/hvfloat-fps.sty new file mode 100644 index 00000000000..fb58251bae9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/hvfloat/hvfloat-fps.sty @@ -0,0 +1,27 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{hvfloat-fps}[2017/09/16 setting float objects] +%% +%% IMPORTANT NOTICE: +%% +%% This is file `hvfloat-fps.sty', +%% +%% Herbert Voss +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. +%% +%% DESCRIPTION: +%% `hvfloat-fps' offers global placement of floats +%% +\def\fileversion{0.01} +\def\filedate{2017/09/16} +\message{`hvfloat-fps' v\fileversion, \filedate\space (Herbert Voss)} +% +\RequirePackage{xkeyval} +% +\DeclareOptionX{figure}{\renewcommand*\fps@figure{#1}} +\DeclareOptionX{table}{\renewcommand*\fps@table{#1}} +\ProcessOptionsX\relax +% +\endinput diff --git a/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty b/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty index d3fcaf319df..91ad3afb6a0 100644 --- a/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty +++ b/Master/texmf-dist/tex/latex/hvfloat/hvfloat.sty @@ -1,12 +1,11 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{hvfloat}[2012/03/04 rotating of floating objects] +\ProvidesPackage{hvfloat}[2017/01/28 rotating of floating objects] %% %% IMPORTANT NOTICE: %% %% This is file `hvfloat.sty', %% -%% Herbert Voss -%% march 04, 2017 +%% Herbert Voss %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN archives @@ -15,8 +14,8 @@ %% DESCRIPTION: %% `hvfloat' offers rotating of captions and objects for floats %% -\def\fileversion{1.2} -\def\filedate{2017/01/28} +\def\fileversion{1.2a} +\def\filedate{2017/09/16} \message{`hvfloat' v\fileversion, \filedate\space (Herbert Voss)} % \newif\ifhv@fbox \hv@fboxfalse @@ -25,7 +24,6 @@ % \RequirePackage{graphicx} \RequirePackage{keyval} -%\RequirePackage{ifthen} \RequirePackage{caption} % \newlength\hvObjectWidth @@ -43,34 +41,34 @@ % \def\hvSet@boolkey#1#2{\csname hv@#2\ifx\relax#1\relax true\else#1\fi\endcsname} % -\define@key{hvSet}{floatPos}[htbp]{ % LaTeX's position parameters htbp +\define@key{hvSet}{floatPos}[htbp]{% LaTeX's position parameters htbp \def\hvSet@floatPos{#1}% } -\define@key{hvSet}{rotAngle}[0]{ % rotates caption AND image together +\define@key{hvSet}{rotAngle}[0]{% rotates caption AND image together \def\hvSet@rotAngle{#1}% } -\define@key{hvSet}{capWidth}[.8]{ % object (w)idth)|object (h)eight| +\define@key{hvSet}{capWidth}[.8]{% object (w)idth)|object (h)eight| \def\hvSet@capWidth{#1}% } -\define@key{hvSet}{capAngle}[0]{ % -360..+360 +\define@key{hvSet}{capAngle}[0]{% -360..+360 \def\hvSet@capAngle{#1}% } -\define@key{hvSet}{capPos}[b]{ % (l)eft|(b)ottom|(t)op|(r)ight - \def\hvSet@capPos{#1}% it is relativ to the object +\define@key{hvSet}{capPos}[b]{% (l)eft|(b)ottom|(t)op|(r)ight + \def\hvSet@capPos{#1}% it is relativ to the object } -\define@key{hvSet}{capVPos}[c]{ % (b)ottom|(c)enter|(t)op - \def\hvSet@capVPos{#1}% it is relativ to the object +\define@key{hvSet}{capVPos}[c]{% (b)ottom|(c)enter|(t)op + \def\hvSet@capVPos{#1}% it is relativ to the object } -\define@key{hvSet}{objectPos}[c]{ % (l)eft|(c)enter|(r)ight - \def\hvSet@objectPos{#1}% it is relativ to the document +\define@key{hvSet}{objectPos}[c]{% (l)eft|(c)enter|(r)ight + \def\hvSet@objectPos{#1}% it is relativ to the document } -\define@key{hvSet}{objectAngle}[0]{ % -360..+360 +\define@key{hvSet}{objectAngle}[0]{% -360..+360 \def\hvSet@objectAngle{#1}% } -\define@key{hvSet}{floatCapSep}[5]{ % a width with the unit pt +\define@key{hvSet}{floatCapSep}[5]{% a width with the unit pt \def\hvSet@floatCapSep{#1}% } -\define@key{hvSet}{useOBox}[false]{ % use of the hvOBox contents +\define@key{hvSet}{useOBox}[false]{% use of the hvOBox contents \lowercase{\hvSet@boolkey{#1}}{useOBox}% } \define@key{hvSet}{nonFloat}[false]{% Do not use float environment @@ -82,9 +80,9 @@ % \newcommand{\setDefaults}{% \setkeys{hvSet}{% - floatPos=htbp, rotAngle=0, capWidth=.8, capAngle=0,% - capPos=b, capVPos=c, objectPos=c, objectAngle=0,% - floatCapSep=5, useOBox=false, nonFloat=false,% + floatPos=htbp, rotAngle=0, capWidth=.8, capAngle=0, + capPos=b, capVPos=c, objectPos=c, objectAngle=0, + floatCapSep=5, useOBox=false, nonFloat=false, onlyText=false}% } % @@ -118,7 +116,6 @@ \ifx\relax#1\relax \caption{#2}\else\caption[#1]{#2}\fi} % % -% \def\hvFloat{\@ifnextchar[{\do@hvFloat}{\do@hvFloat[]}} \def\do@hvFloat[#1]#2#3{% \setDefaults @@ -129,9 +126,9 @@ \@ifnextchar[{\do@@hvFloat}{\do@@hvFloat[]}% } \def\do@@hvFloat[#1]#2#3{% - \def\hv@shortCap{#1} - \def\hv@longCap{#2} - \def\hv@label{#3} + \def\hv@shortCap{#1}% + \def\hv@longCap{#2}% + \def\hv@label{#3}% %\newcommand*{\hvFloat}[5][]{% % [#1}: keyvalues % #2: type figure | table | ... @@ -143,34 +140,34 @@ % \def\@tempa{#1}% % \ifx\@tempa\empty\else\setkeys{hvSet}{#1}\fi% set options, only when not empty \def\@tempa{90}% - \ifx\hvSet@rotAngle\@tempa \setlength{\hvMaxCapWidth}{\textheight} - \else \setlength{\hvMaxCapWidth}{\linewidth} + \ifx\hvSet@rotAngle\@tempa \setlength{\hvMaxCapWidth}{\textheight}% + \else \setlength{\hvMaxCapWidth}{\linewidth}% \fi % % First we save the object in \hvObjectBox % \ifx\hvSet@objectAngle\hv@Zero % rotate the object? - \savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi} + \savebox{\hvObjectBox}{\ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}% \else \savebox{\hvObjectBox}{% \rotatebox{\hvSet@objectAngle}{% - \ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}} + \ifhv@useOBox\usebox{\hvOBox}\else\hv@floatObject\fi}}% \fi - \setlength{\hvObjectWidth}{\wd\hvObjectBox} + \setlength{\hvObjectWidth}{\wd\hvObjectBox}% % % Now we save the caption with its defined \hvCapWidth % - \ifx\hvSet@capWidth\hv@Width\setlength{\hvCapWidth}{\hvObjectWidth} + \ifx\hvSet@capWidth\hv@Width\setlength{\hvCapWidth}{\hvObjectWidth}% \else - \ifx\hvSet@capWidth\hv@Height\setlength{\hvCapWidth}{\ht\hvObjectBox} + \ifx\hvSet@capWidth\hv@Height\setlength{\hvCapWidth}{\ht\hvObjectBox}% \else - \setlength{\hvCapWidth}{\hvObjectWidth} + \setlength{\hvCapWidth}{\hvObjectWidth}% \ifx\hvSet@capPos\hv@Left\addtolength{\hvMaxCapWidth}{-\hvObjectWidth}\fi \ifx\hvSet@capPos\hv@Right\addtolength{\hvMaxCapWidth}{-\hvObjectWidth}\fi \ifdim\hvSet@capWidth\columnwidth<\hvMaxCapWidth - \setlength{\hvCapWidth}{\hvSet@capWidth\columnwidth} + \setlength{\hvCapWidth}{\hvSet@capWidth\columnwidth}% \else - \setlength{\hvCapWidth}{\hvMaxCapWidth} + \setlength{\hvCapWidth}{\hvMaxCapWidth}% \fi \fi \fi @@ -178,7 +175,7 @@ % now we have the object and the caption with the right % rotated angles saved in boxes % - \def\fps@figure{\hvSet@floatPos} + \def\fps@figure{\hvSet@floatPos}% \ifhv@nonFloat\begingroup% Start the nonfloat part \else \begin{\hv@floatType}% Start the floating environment \fi @@ -192,7 +189,7 @@ \ifx\hv@floatType\hv@figure \ifx\relax#1\relax \figcaption{#2}\else\figcaption[#1]{#2}\fi \else - \ifx\relax#1\relax \tabcaption{#2}\else\tabcaption[#1]{#2}\fi% + \ifx\relax#1\relax \tabcaption{#2}\else\tabcaption[#1]{#2}\fi \fi \fi \else @@ -211,11 +208,11 @@ \ifx\hv@floatType\hv@figure \ifx\relax#1\relax \figcaption{#2}\else\figcaption[#1]{#2}\fi \else - \ifx\relax#1\relax \tabcaption{#2}\else\tabcaption[#1]{#2}\fi% + \ifx\relax#1\relax \tabcaption{#2}\else\tabcaption[#1]{#2}\fi \fi \fi \else - \expandafter\ifx\expandafter\relax\hv@shortCap\relax \caption{#2}\else\caption[#1]{#2}\fi% + \expandafter\ifx\expandafter\relax\hv@shortCap\relax \caption{#2}\else\caption[#1]{#2}\fi \fi \label{#3}% \end{minipage}% @@ -225,26 +222,26 @@ %% \restoreCaptionSkip% save old values \ifx\hvSet@objectPos\hv@Right\raggedleft% - \else% + \else \ifx\hvSet@objectPos\hv@Center - \ifhv@nonFloat\hspace*{\fill}\else\centering\fi% - \fi% - \fi% + \ifhv@nonFloat\hspace*{\fill}\else\centering\fi + \fi + \fi % % to rotate object and caption together, we save all in another box % the caption comes first, if its on the left or the top % \savebox{\@tempboxa}{% \ifx\hvSet@capPos\hv@Left % caption on left side - \ifx\hvSet@capVPos\hv@Center% + \ifx\hvSet@capVPos\hv@Center \ifhv@fbox\fbox{\parbox{\wd\hvCaptionBox}{\usebox{\hvCaptionBox}}}% \else \parbox{\wd\hvCaptionBox}{\usebox{\hvCaptionBox}}% - \fi% + \fi \hspace{\hvSet@floatCapSep pt}% capfloatsep - \ifhv@fbox\fbox{\parbox{\wd\hvObjectBox}{\usebox{\hvObjectBox}}} - \else \parbox{\wd\hvObjectBox}{\usebox{\hvObjectBox}} - \fi% - \else% + \ifhv@fbox\fbox{\parbox{\wd\hvObjectBox}{\usebox{\hvObjectBox}}}% + \else \parbox{\wd\hvObjectBox}{\usebox{\hvObjectBox}}% + \fi + \else \ifx\hvSet@capVPos\hv@Top % caption at top \ifhv@fbox\fbox{\raisebox{-\height}{\usebox{\hvCaptionBox}}}% \else \raisebox{-\height}{\usebox{\hvCaptionBox}}% @@ -252,33 +249,33 @@ \hspace{\hvSet@floatCapSep pt}% capfloatsep \ifhv@fbox\fbox{\raisebox{-\height}{\usebox{\hvObjectBox}}}% \else \raisebox{-\height}{\usebox{\hvObjectBox}}% - \fi% + \fi \else% caption on bottom - \ifhv@fbox\fbox{\usebox{\hvCaptionBox}} - \else\usebox{\hvCaptionBox} + \ifhv@fbox\fbox{\usebox{\hvCaptionBox}}% + \else\usebox{\hvCaptionBox}% \fi% \hspace{\hvSet@floatCapSep pt}% - \ifhv@fbox\fbox{\usebox{\hvObjectBox}} - \else \usebox{\hvObjectBox} - \fi% - \fi% - \fi% + \ifhv@fbox\fbox{\usebox{\hvObjectBox}}% + \else \usebox{\hvObjectBox}% + \fi + \fi + \fi \else \ifx\hvSet@capPos\hv@Top \ifdim\wd\hvCaptionBox>\wd\hvObjectBox - \begin{minipage}{\wd\hvCaptionBox} + \begin{minipage}{\wd\hvCaptionBox}% \else - \begin{minipage}{\wd\hvObjectBox} + \begin{minipage}{\wd\hvObjectBox}% \fi \centering \ifhv@fbox \fbox{\usebox{\hvCaptionBox}}\\[\hvBelowCaptionSkip] - \fbox{\usebox{\hvObjectBox}} + \fbox{\usebox{\hvObjectBox}}% \else \usebox{\hvCaptionBox}\\[\hvBelowCaptionSkip] - \usebox{\hvObjectBox} - \fi% - \end{minipage} + \usebox{\hvObjectBox}% + \fi + \end{minipage}% \else \ifx\hvSet@capPos\hv@Bottom \ifdim\wd\hvCaptionBox>\wd\hvObjectBox -- cgit v1.2.3