diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/swfigure/swfigure.sty | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/latex/swfigure/swfigure.sty b/Master/texmf-dist/tex/latex/swfigure/swfigure.sty index 8b6fdca0b9b..a12aaee0882 100644 --- a/Master/texmf-dist/tex/latex/swfigure/swfigure.sty +++ b/Master/texmf-dist/tex/latex/swfigure/swfigure.sty @@ -11,7 +11,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2020/01/01] \ProvidesPackage{swfigure}% - [2020-10-13 v.0.9.08 Managing large and spread wide figures] + [2020-10-18 v.0.9.11 Managing large and spread wide figures] \RequirePackage{etoolbox} \RequirePackage{xfp} @@ -52,8 +52,22 @@ \IfValueT{#3}{\label{#3}}\relax% } -\DeclareRobustCommand\cleartoevenpage{% - \clearpage\ifodd\value{page}\null\clearpage\fi} +\newcommand\set@tmode@newpage{% +\ifvmode + \@SWtmodefalse +\else + \@SWtmodetrue + \@bsphack\vadjust{\vspace{0pt plus1fill}\@esphack\newpage}% +\fi} + +\newcommand\reset@tmode{\if@SWtmode\expandafter\noindent\ignorespaces\fi} + +\NewDocumentCommand\cleartoeven{ o }{% + \IfValueTF{#1}% + {\set@tmode@newpage + \ifodd\value{page}\afterpage{#1}\else#1\fi}% + {\ifodd\value{page}\null\clearpage\fi}} + \NewDocumentEnvironment{DFimage}{% O{SW} m O{#4} m o D(){0.8} D<>{0} D||{0.25}}{% \ifstrequal{#1}{SW}% @@ -79,9 +93,9 @@ {\PackageWarning{swfigure}% {% **************************************\MessageBreak - Option #1\space is not valid \MessageBreak - Nothing done \MessageBreak - Image #2\space was not processed \MessageBreak + Option #1\space is not valid \MessageBreak + Nothing done \MessageBreak + Image #2\space was not processed \MessageBreak **************************************\MessageBreak}% }% }% @@ -91,14 +105,6 @@ }% \NewDocumentCommand\SWfigure{m O{#3} m o}{% -\ifvmode - \@SWtmodefalse -\else - \@SWtmodetrue - \csuse{@bsphack}% - \vadjust{\vspace{0pt plus1fill}\csuse{@esphack}\newpage}% -\fi -\cleartoevenpage \setbox\DFtotalimage=\hbox{\includegraphics{#1}}% \DFwidth=\wd\DFtotalimage \DFhalfwidth=0.5\DFwidth \DFheight=\ht\DFtotalimage @@ -114,17 +120,20 @@ trim = \the\DFhalfwidth\space 0 0 0]}\x{#1}}% {\edef\DFscalefactor{\fpeval{\FigSpace/\DFhalfwidth}}}% \setbox\DFimageI=\hbox{\scalebox{\DFscalefactor}{\usebox{\DFimageI}}}% \setbox\DFimageII=\hbox{\scalebox{\DFscalefactor}{\usebox{\DFimageII}}}% -\begin{figure}[p]% -\vbox to\textheight{\vss\hsize=\textwidth%\ -\makebox[\hsize][l]{\makebox[\FigSpace][r]{\box\DFimageI}}\vss}% -\end{figure}\clearpage -\begin{figure}[p]% -\vbox to\textheight{\vss\hsize=\textwidth -\makebox[\hsize][r]{\makebox[\FigSpace][l]{\box\DFimageII}% -\makebox(0,0)[lb]{\hspace*{1em}\raisebox{0.5\textheight}{% -\rotatebox[origin=tc]{90}{\DFcaption[#2]{#3}[#4]% -}}}}\vss}% -\end{figure}\clearpage\if@SWtmode\noindent\fi} +\cleartoeven[% + \begin{figure}[p]% + \vbox to\textheight{\vss\hsize=\textwidth%\ + \makebox[\hsize][l]{\makebox[\FigSpace][r]{\box\DFimageI}}\vss}% + \end{figure}\clearpage + \begin{figure}[p]% + \vbox to\textheight{\vss\hsize=\textwidth + \makebox[\hsize][r]{\makebox[\FigSpace][l]{\box\DFimageII}% + \makebox(0,0)[lb]{\hspace*{1em}\raisebox{0.5\textheight}{% + \rotatebox[origin=tc]{90}{\DFcaption[#2]{#3}[#4]% + % + }}}}\vss}% + \end{figure}% +]\clearpage\reset@tmode} \NewDocumentCommand\NFfigure{m O{#3} m o d()}{% \begin{figure}[p] @@ -196,14 +205,10 @@ trim = \the\DFhalfwidth\space 0 0 0]}\x{#1}}% }% \NewDocumentCommand\HSfigure{m o m o d()}{% - \unless\ifvmode - \csuse{@bsphack}% - \vadjust{\vspace{0pt plus1fill}\csuse{@esphack}\newpage}% - \fi - \cleartoevenpage + \cleartoeven \setbox\DFtotalimage=\hbox{\includegraphics{#1}} \DFwidth=\wd\DFtotalimage \DFhalfwidth=0.5\DFwidth - \FigSpace=0.5\spreadwidth% W + \FigSpace=0.5\spreadwidth% \setbox\DFimageI\hbox{\bgroup \edef\x{\egroup\noexpand\includegraphics*[% trim = 0 0 \the\DFhalfwidth\space 0]}\x{#1}}% |