From 9a1c781313c984e8d5c88b832b1c08e1da3fe155 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 14 Jun 2016 22:40:56 +0000 Subject: latex2e (14jun16) git-svn-id: svn://tug.org/texlive/trunk@41447 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/base/classes.dtx | 2 +- Master/texmf-dist/source/latex/base/ltfinal.dtx | 20 +- Master/texmf-dist/source/latex/base/ltvers.dtx | 2 +- Master/texmf-dist/source/latex/graphics/color.dtx | 15 +- .../texmf-dist/source/latex/graphics/drivers.dtx | 24 +- .../texmf-dist/source/latex/graphics/graphics.dtx | 15 +- .../texmf-dist/source/latex/graphics/graphics.ins | 2 + .../texmf-dist/source/latex/graphics/rotating.dtx | 688 +++++++++++++++++++++ Master/texmf-dist/source/latex/tools/shellesc.dtx | 12 +- 9 files changed, 767 insertions(+), 13 deletions(-) create mode 100644 Master/texmf-dist/source/latex/graphics/rotating.dtx (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/base/classes.dtx b/Master/texmf-dist/source/latex/base/classes.dtx index 885b85c6f51..c8092012147 100644 --- a/Master/texmf-dist/source/latex/base/classes.dtx +++ b/Master/texmf-dist/source/latex/base/classes.dtx @@ -263,7 +263,7 @@ % \end{macro} % % \begin{macro}{\if@restonecol} -% When the document has to printed in two columns, we sometimes +% When the document has to be printed in two columns, we sometimes % have to temporarily switch to one column. This switch is used to % remember to switch back. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/base/ltfinal.dtx b/Master/texmf-dist/source/latex/base/ltfinal.dtx index 5103c8b4ebe..05b09ea2934 100644 --- a/Master/texmf-dist/source/latex/base/ltfinal.dtx +++ b/Master/texmf-dist/source/latex/base/ltfinal.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltfinal.dtx} - [2016/01/05 v2.0p LaTeX Kernel (Final Settings)] + [2016/04/22 v2.0q LaTeX Kernel (Final Settings)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltfinal.dtx} @@ -149,6 +149,7 @@ % \changes{v2.0b}{2015/01/23}{use reserved count 257} % \changes{v2.0f}{2015/04/28}{define \cs{xe@alloc@intercharclass} for compatibility with older xelatex initilisation} %\begin{macro}{\xe@alloc@intercharclass} +%\begin{macro}{\e@alloc@intercharclass@top} % \changes{v2.0j}{2016/01/04}{Start allocation at one not three} % \changes{v2.0k}{2016/01/05}{Remove duplicated code} % Allocate |\XeTeXintercharclass| types if xetex is active. @@ -161,13 +162,25 @@ % {\newXeTeXintercharclass}{Extended Allocation}% % \end{macrocode} % -% Classes allocated 1 to 254 (early 1, 2 and 3 were pre-set for CJK). +% Classes allocated 1 to 4094 (or 254 on older xetex) +% (In earlier XeLaTeX versions 1, 2 and 3 were pre-set for CJK). % \changes{v2.0g}{2015/06/19}{Use $-1$ for first range to get contiguous allocation} +% \changes{v2.0q}{2016/04/22}{XeTeX 0.99996 has 4096 char classes not 256} % \begin{macrocode} \ifx\XeTeXcharclass\@undefined \else +% \end{macrocode} +% \begin{macrocode} +\ifdim\the\XeTeXversion\XeTeXrevision\p@>0.99993\p@ + \chardef\e@alloc@intercharclass@top=4095 +\else + \chardef\e@alloc@intercharclass@top=255 +\fi +% \end{macrocode} +% \begin{macrocode} \def\newXeTeXintercharclass{% - \e@alloc\XeTeXcharclass\chardef\xe@alloc@intercharclass\m@ne\@cclv} + \e@alloc\XeTeXcharclass + \chardef\xe@alloc@intercharclass\m@ne\e@alloc@intercharclass@top} \fi % \end{macrocode} % @@ -221,6 +234,7 @@ % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} % % % diff --git a/Master/texmf-dist/source/latex/base/ltvers.dtx b/Master/texmf-dist/source/latex/base/ltvers.dtx index f0bde869bd5..5dab5b2175c 100644 --- a/Master/texmf-dist/source/latex/base/ltvers.dtx +++ b/Master/texmf-dist/source/latex/base/ltvers.dtx @@ -95,7 +95,7 @@ {2016/03/31} % %<*2ekernel> -\def\patch@level{0} +\def\patch@level{1} % \end{macrocode} % \end{macro} % \end{macro} diff --git a/Master/texmf-dist/source/latex/graphics/color.dtx b/Master/texmf-dist/source/latex/graphics/color.dtx index 0ef43f209be..14bd364f4fc 100644 --- a/Master/texmf-dist/source/latex/graphics/color.dtx +++ b/Master/texmf-dist/source/latex/graphics/color.dtx @@ -19,7 +19,7 @@ % \ProvidesFile{color.drv} % \fi % \ProvidesFile{color.dtx} - [2016/05/09 v1.1c Standard LaTeX Color (DPC)] + [2016/06/02 v1.1d Standard LaTeX Color (DPC)] % % \iffalse %<*driver> @@ -142,6 +142,19 @@ % \end{macrocode} % \end{option} % +% \begin{option}{setpagesize} +% \begin{option}{nosetpagesize} +% The |setpagesize| option requests that the driver option sets the page size. +% \changes{v1.1d}{2016/06/02} +% {(no)setpagesize options added} +% \begin{macrocode} +\newif\ifGin@setpagesize\Gin@setpagesizetrue +\DeclareOption{setpagesize}{\Gin@setpagesizetrue} +\DeclareOption{nosetpagesize}{\Gin@setpagesizefalse} +% \end{macrocode} +% \end{option} +% \end{option} +% % Now the options for supported drivers. % % \begin{option}{dvips} diff --git a/Master/texmf-dist/source/latex/graphics/drivers.dtx b/Master/texmf-dist/source/latex/graphics/drivers.dtx index e50aa55d6fd..31c3f1c5507 100644 --- a/Master/texmf-dist/source/latex/graphics/drivers.dtx +++ b/Master/texmf-dist/source/latex/graphics/drivers.dtx @@ -3,7 +3,7 @@ % %% drivers.dtx Copyright (C) 1994 David Carlisle Sebastian Rahtz %% Copyright (C) 1995 1996 1997 1998 1999 David Carlisle -%% Copyright (C) 2000--2015 David Carlisle, LaTeX3 Project +%% Copyright (C) 2000--2016 David Carlisle, LaTeX3 Project %% %% This file is part of the Standard LaTeX `Graphics Bundle'. %% It may be distributed under the terms of the LaTeX Project Public @@ -37,7 +37,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesFile{drivers.dtx} % - [2015/12/30 v3.0k Driver-dependent file (DPC,SPQR)] + [2016/06/02 v3.0l Driver-dependent file (DPC,SPQR)] % %<*driver> \documentclass{ltxdoc} @@ -548,6 +548,26 @@ \def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}} % \end{macrocode} % +% \section{Page Size} +% +% \changes{v3.0l}{2016/06/02}{page size special added to patch pdftex.def} +% \begin{macrocode} +\ifGin@setpagesize + \AtBeginDocument{\AtBeginDvi{% + \begingroup + \ifx\stockwidth\@undefined\else + \paperwidth\stockwidth + \paperheight\stockheight + \fi + \ifdim\paperwidth>\z@ + \ifdim\paperheight>\z@ + \special{papersize=\the\paperwidth,\the\paperheight}% + \fi + \fi + \endgroup}} +\fi +% \end{macrocode} +% % \begin{macrocode} % % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/graphics/graphics.dtx b/Master/texmf-dist/source/latex/graphics/graphics.dtx index cfdfa929864..feca08c1e8f 100644 --- a/Master/texmf-dist/source/latex/graphics/graphics.dtx +++ b/Master/texmf-dist/source/latex/graphics/graphics.dtx @@ -19,7 +19,7 @@ % \ProvidesFile{graphics.drv} % \fi % \ProvidesFile{graphics.dtx} - [2016/05/09 v1.0r Standard LaTeX Graphics (DPC,SPQR)] + [2016/06/02 v1.0s Standard LaTeX Graphics (DPC,SPQR)] % % \iffalse %<*driver> @@ -512,6 +512,19 @@ % \end{macrocode} % \end{option} % +% \begin{option}{setpagesize} +% \begin{option}{nosetpagesize} +% The |setpagesize| option requests that the driver option sets the page size. +% \changes{v1.0s}{2016/06/02} +% {(no)setpagesize options added} +% \begin{macrocode} +\newif\ifGin@setpagesize\Gin@setpagesizetrue +\DeclareOption{setpagesize}{\Gin@setpagesizetrue} +\DeclareOption{nosetpagesize}{\Gin@setpagesizefalse} +% \end{macrocode} +% \end{option} +% \end{option} +% % \begin{macro}{\Gin@driver} % Driver in use. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/graphics/graphics.ins b/Master/texmf-dist/source/latex/graphics/graphics.ins index ef0ba6edf46..e4aeeb0f04a 100644 --- a/Master/texmf-dist/source/latex/graphics/graphics.ins +++ b/Master/texmf-dist/source/latex/graphics/graphics.ins @@ -38,4 +38,6 @@ reports for it can be opened at http://latex-project.org/bugs.html \generate{\file{lscape.sty}{\from{lscape.dtx}{package}}} +\generate{\file{rotating.sty}{\from{rotating.dtx}{package}}} + \endbatchfile diff --git a/Master/texmf-dist/source/latex/graphics/rotating.dtx b/Master/texmf-dist/source/latex/graphics/rotating.dtx new file mode 100644 index 00000000000..f36174a7ece --- /dev/null +++ b/Master/texmf-dist/source/latex/graphics/rotating.dtx @@ -0,0 +1,688 @@ +% +% \iffalse +% +% $Id: rotating.dtx,v 1.21 2010/01/26 13:25:07 rf10 Exp rf10 $ +% +% File: rotating.dtx +%% Copyright 1995--1999 Sebastian Rahtz and Leonor Barroca +%% Copyright 2001--2003,2007--2009 Robin Fairbairns +%% Copyright 2016 LaTeX3 Project +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3c +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Robin Fairbairns. +% +% This work consists of the files rotating.dtx and rotating.ins, +% and the derived file rotating.sty, and testing material +% rotex.tex and cat.eps +% +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +%<*dtx> +\ProvidesFile{rotating.dtx}% +% +%\ProvidesPackage{rotating}% + [2016/05/22 v2.16c +% rotated objects in LaTeX% +%<*dtx> + rotating package source file% +% + ] +%<*dtx> +\documentclass{ltxdoc} +\GetFileInfo{rotating.dtx} +\begin{document} + \title{A package for rotated objects in \LaTeX\thanks{This file has + version number \fileversion, last revised \filedate}} + \author{Robin Fairbairns + \and Sebastian Rahtz \and Leonor Barroca} + \date{printed \today} + \MaintainedByLaTeXTeam{graphics} + \maketitle + \tableofcontents +% \listoffigures +% \listoftables + \DocInput{rotating.dtx} +\end{document} +% +% \fi +% +% \begin{abstract} +% This article documents a \LaTeX\ package, `rotating.sty', +% which performs most sorts of +% rotation one might like, including rotation of complete floating +% figures and tables. +% \end{abstract} +% +% \section{Introduction} +% +% The package provides: +% \begin{itemize} +% \item two new environments, \texttt{sidewaystable} and +% \texttt{sidewaysfigure}, each of which produces a single page-size +% float with contents rotated $\pm90$\,degrees; and +% \item a variety of other rotation-related commands and environments. +% \end{itemize} +% +% Note that the package uses rotation facilities from the +% \textsf{graphicx} package. When generating DVI output, users should +% note that rotation is typically \emph{not} visible in a DVI viewer: +% conversion to, and viewing, PostScript or PDF is necessary. +% +% \section{Usage} +% +% \subsection{Package options} +% +% Sideways figures and tables always take up the whole page. In +% single-sided documents, they may be rotated so that the bottom of +% the figures is on the left (package option +% `\texttt{counterclockwise}') or the right (package option +% `\texttt{clockwise}'). The default is to turn so that the bottom is +% on the right (option `\texttt{clockwise}'). +% +% Option `\texttt{anticlockwise}' is an alias for +% `\texttt{counterclockwise}'. +% +% If the `\texttt{twoside}' option has been given to the main document +% class (either explicitly, or implicitly as in the default for book +% class), the package will rotate sideways figures according to the +% page number (this requires at least two passes through \LaTeX{}). +% If you want the `\texttt{twoside}' option, but want the figures +% always in one direction, use the `\texttt{figuresright}' or +% `\texttt{figuresleft}' options to the package. +% +% The package can produce a lot of logging information; the +% amount of information is controlled by the package options +% `\texttt{quiet}' (fewest messages; default), `\texttt{log}' and +% `\texttt{chatter}' (most messages). +% +% All other options are passed to the \textsf{graphicx} package when +% it is loaded to provide rotation functions. +% +% \subsection{Float environments} +% +% The environments \texttt{sidewaystable} and \texttt{sidewaysfigure} +% introduce landscape-form floating tables and figures, respectively. +% (Each of the environments has a ``starred'' version, such as +% \texttt{sidewaystable*}, for a single-column float in a double-column +% area of the document.) +% +% New rotated environments may be declared using the combined +% facilities of the float and rotfloat packages. +% +% \subsection{Other environments and commands} +% The package provides other \LaTeX\ environments: +% \begin{description} +% \item[\mdseries\ttfamily sideways] prints the contents of the +% environment turned through 90 degrees counterclockwise; +% \item[\mdseries\ttfamily turn] prints the contents turned through an +% arbitrary angle (the argument to the environment); +% \item[\mdseries\ttfamily rotate] prints the contents turned through +% an arbitrary angle but does \emph{not} leave any space for the result +% \end{description} +% +% The command \cs{turnbox}\marg{angle}\marg{matter to turn} is a macro +% version of the \texttt{rotate} environment. +% +% A set of examples is given in the file \texttt{examples.tex} +% +% \subsection{Positioning} +% +% Floats appear one to a page, and are positioned by spacer skips that +% appear (logically) above and below the floating object. The skips, +% \cs{rotFPtop} and \cs{rotFPbot}, are initialised from the standard +% \LaTeX{} (internal) \cs{@fptop} and \cs{@fpbot} skips. As a result, +% by default, rotated floats appear horizontally centred on their +% float pages. +% +% Some sensible values for the registers are: +% \par\noindent +% \begin{tabular}{@{}llp{3in}@{}} +% \cs{rotFPtop} & \cs{rotFPbot} & Effect \\ +% \hline +% 0pt plus 1fil & 0pt plus 1fil & figure/table appears in middle +% (default value) \\ +% 0pt & 0pt plus 1fil & figure/table appears with its top +% nearest the edge of the page \\ +% 0pt plus 1fil & 0pt plus 2fil & figure/table's bottom appears +% twice as far from the edge as the +% top does +% \end{tabular} +% +% \StopEventually{} +% +% \section{Setup} +% Now we present the documented code. First, package options. +% +% Note that the \texttt{clockwise} and \texttt{counterclockwise} +% options are present for compatibility only. +% \begin{macrocode} +%<*package> +\DeclareOption{clockwise}{% + \AtBeginDocument{\setkeys{Grot}{units=360}}% +} +\DeclareOption{counterclockwise}{% + \AtBeginDocument{\setkeys{Grot}{units=-360}}% +} +\DeclareOption{anticlockwise}{\ds@counterclockwise} +% \end{macrocode} +% Control figure orientation +% \begin{macrocode} +\DeclareOption{figuresleft}{% + \@rot@twosidefalse + \def\rot@LR{0}% +} +\DeclareOption{figuresright}{% + \@rot@twosidefalse + \def\rot@LR{-1}% +} +% \end{macrocode} +% +% control messages: +% \begin{macrocode} +\newif\ifrot@messages +\DeclareOption{quiet}{% + \rot@messagesfalse + \let\rot@message\@gobble % pro tem -- should suppress altogether +} +\DeclareOption{log}{% + \rot@messagestrue + \def\rot@message{\PackageInfo{rotating}}% +} +\DeclareOption{chatter}{% + \rot@messagestrue + \def\rot@message{\PackageWarning{rotating}}% +} +% \end{macrocode} +% +% \begin{macro}{\if@rot@twoside} +% \begin{macro}{\rot@LR} +% A couple of commands for passing rotation direction around +% \begin{macrocode} +\newif\if@rot@twoside +\if@twoside + \@rot@twosidetrue +\else + \@rot@twosidefalse +\fi +\def\rot@LR{-1} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Pass any unknown options to the \textsf{graphicx} package, and +% set up defaults and process the options. +% \begin{macrocode} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}} +\ExecuteOptions{clockwise,quiet} +\ProcessOptions +% \end{macrocode} +% +% Other initialisation +% \begin{macrocode} +\RequirePackage{graphicx} +\RequirePackage{ifthen} +% \end{macrocode} +% +% \begin{macro}{\rotdriver} +% The command \cs{rotdriver} allows a user to specify an initialisation file, +% a sort of non-automatically-loaded driver (in the graphics, hyperref +% sense). +% \begin{macrocode} +\def\rotdriver#1{\makeatletter\input{#1.def}\makeatother} +% \end{macrocode} +% \end{macro} +% +% The \texttt{r@tfl@t} counter is used when generating `labels' for +% determining what side of the page the float is on, in twoside mode. +% \begin{macrocode} +\newcounter{r@tfl@t} +\setcounter{r@tfl@t}{0} +% \end{macrocode} +% +% Positioning skips (see above). +% \begin{macrocode} +\newskip\rotFPtop \rotFPtop=\@fptop +\newskip\rotFPbot \rotFPbot=\@fpbot +% \end{macrocode} +% +% \section{Turning and rotation environments} +% \begin{macro}{sideways} +% Environment to turn the contents through 90 degrees. +% \begin{macrocode} +\def\sideways{% + \Grot@setangle{90}% + \setbox\z@\color@hbox\ignorespaces} +\def\endsideways{% + \unskip\color@endbox + \Grot@x\z@ + \Grot@y\z@ + \Grot@box +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{turn} +% Rotate the contents of the environment, leaving the appropriate space +% \begin{macrocode} +\def\turn#1{% + \Grot@setangle{#1}% + \setbox\z@\color@hbox\ignorespaces} +\def\endturn{% + \unskip\color@endbox + \Grot@x\z@ + \Grot@y\z@ + \Grot@box +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{rotate} +% Rotate the contents of the environment, leaving \emph{no space}. +% \begin{macrocode} +\def\rotate#1{% + \Grot@setangle{#1}% + \setbox\z@\color@hbox\ignorespaces} +\def\endrotate{% + \unskip\color@endbox + \Grot@x\z@ + \Grot@y\z@ + \wd0\z@\dp0\z@\ht0\z@ + \Grot@box +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\turnbox} +% A macro version of the `rotate' environment. +% \begin{macrocode} +\def\turnbox#1#2{% + \Grot@setangle{#1}% +% \end{macrocode} +% Note: grouping within the box makes \cs{color@hbox} unnecessary, I think. +% \begin{macrocode} + \setbox\z@\hbox{{#2}}% + \Grot@x\z@\Grot@y\z@ + \wd0\z@\dp0\z@\ht0\z@ + \Grot@box +} +% \end{macrocode} +% \end{macro} +% \section{Sideways figures and tables} +% Now for the macros to provide a complete +% environment for sideways figures and tables. +% We define two environments |sidewaysfigure| and +% |sidewaystable| that +% fit in with the normal table and figure floats. These are `fixed' +% environments that just do 90 degree rotation, but it would be easy +% to parameterize this to do other rotations if needed (the mind +% boggles\ldots) +% +% \begin{macro}{\@rotfloat} +% \begin{macro}{\@xrotfloat} +% \begin{macro}{\rot@float@box} +% First a generalised `rotfloat' environment. We need to intercept +% \LaTeX's float macros, in order to change the assumed width of a +% float being |\columnwidth|. We want it to work on a width of +% |\textheight| so that when we rotate the float, it comes out +% the right height. This is not actually very satisfactory, since what +% we \emph{really} want is for rotated floats to occupy the space they +% actually \emph{use}. The captions are a problem --- since they can +% precede the figure or table, we cannot set them in a box of the +% right width (ie the \emph{height} of the forthcoming object), because +% it has not happened yet. The result of these difficulties is that +% rotated figures always end up as full page figures. +% \begin{macrocode} +\newsavebox\rot@float@box +\def\@rotfloat#1{% + \@ifnextchar[% + {\@xrotfloat{#1}}% + {\edef\@tempa{\noexpand\@xrotfloat{#1}[\csname fps@#1\endcsname]}\@tempa}% +} +\def\@xrotfloat#1[#2]{% + \@float{#1}[#2]% +% \end{macrocode} +% Set the float contents in +% a box of width \cs{textheight} instead of \cs{columnwidth}. +% \begin{macrocode} + \begin{lrbox}\rot@float@box + \begin{minipage}\textheight + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\end@rotfloat} +% We call \LaTeX's \cs{end@float} macro having previously rotated +% the box \cs{@currbox}. +% The rotation is either clockwise or +% anti-clockwise, depending on whether the page is odd or even; +% in oneside mode it is always odd. +% \begin{macrocode} +\def\end@rotfloat{% +% \end{macrocode} +% If we are going to know whether pages are odd or even, +% we need to use the a variant \cs{pageref} mechanism and our own +% specialised labels. +% \begin{macrocode} + \end{minipage}\end{lrbox}% + \stepcounter{r@tfl@t}% + \rot@label{RF\ther@tfl@t}% + \rot@pageref{RF\ther@tfl@t}{\R@@page}% + \edef\@tempa{Adding sideways \@captype\space on page \R@@page\space} + \rot@mess@toks\expandafter{\@tempa} + \wd\rot@float@box\z@ + \ht\rot@float@box\z@ + \dp\rot@float@box\z@ + \vbox to \textheight{% +% \end{macrocode} +% We need to know for sure which direction rotation is going to +% be in, so locally reset the graphics units. +% \begin{macrocode} + \setkeys{Grot}{units=360}% + \if@rot@twoside + \else + \let\R@@page\rot@LR + \fi + \ifthenelse{\isodd{\R@@page}}{% + \if@rot@twoside + \rot@mess@toks\expandafter{\the\rot@mess@toks (right hand page)}% + \fi + \vfill + \@@line{% + \hskip\rotFPtop + \rotatebox{90}{\box\rot@float@box}% + \hskip\rotFPbot + }% + }{% + \if@rot@twoside + \rot@mess@toks\expandafter{\the\rot@mess@toks (left hand page)}% + \fi + \@@line{% + \hskip\rotFPbot + \rotatebox{-90}{\box\rot@float@box}% + \hskip\rotFPtop + }% + \vfill + }% + \rot@message{\the\rot@mess@toks} + }% + \end@float +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sidewaysfigure} +% \begin{macro}{\endsidewaysfigure} +% \begin{macro}{\sidewaystable} +% \begin{macro}{\endsidewaystable} +% The following definitions set up two environments, +% \texttt{sidewaystable} and \texttt{sidewaysfigure}, which uses this +% type of float. Naturally, users may need to change these to suit +% their local style. Both contribute to the normal lists of figures +% and tables. +% \begin{macrocode} +\def\sidewaysfigure{\@rotfloat{figure}} +% +\let\endsidewaysfigure\end@rotfloat +% +\def\sidewaystable{\@rotfloat{table}} +\let\endsidewaystable\end@rotfloat +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@rotdblfloat} +% \begin{macro}{\end@rotdblfloat} +% Handling double column floats +% \begin{macrocode} +\def\@rotdblfloat{% + \if@twocolumn\expandafter\@rotdbflt\else\expandafter\@rotfloat\fi +} +\def\@rotdbflt#1{\@ifnextchar[{\@rotxdblfloat{#1}}{\@rotxdblfloat{#1}[tp]}} +\def\@rotxdblfloat#1[#2]{% + \@float{#1}[#2]% + \hsize\textwidth\linewidth\textwidth + \begin{lrbox}\rot@float@box + \begin{minipage}\textheight +} +\def\end@rotdblfloat{% +% \end{macrocode} +% If we are going to know whether pages are odd or even, +% we need to use the \cs{pageref} mechanism, and labels. But +% Labels won't work \emph{unless} the user has put in a +% caption. Beware! +% \begin{macrocode} + \end{minipage}\end{lrbox}% + \stepcounter{r@tfl@t}% + \rot@label{RF\ther@tfl@t}% + \rot@pageref{RF\ther@tfl@t}{\R@@page}% + \edef\@tempa{Adding sideways \@captype\space on page \R@@page\space} + \rot@mess@toks\expandafter{\@tempa} + \@tempdima\ht\rot@float@box + \advance\@tempdima by \dp\rot@float@box +% \ifrot@messages +% \rot@message{BOX wd: \the\wd\rot@float@box, +% ht: \the\ht\rot@float@box, dp: \the\dp\rot@float@box: +% so shift by .5 of \the\@tempdima}% +% \fi + \wd\rot@float@box\z@ + \ht\rot@float@box\z@ + \dp\rot@float@box\z@ + \vbox to \textheight{% +% \end{macrocode} +% We need to know for sure which direction rotation is going to +% be in, so locally reset the graphics units. +% \begin{macrocode} + \setkeys{Grot}{units=360}% + \if@rot@twoside + \else + \let\R@@page\rot@LR + \fi + \ifthenelse{\isodd{\R@@page}}{% + \ifrot@messages + \if@rot@twoside + \rot@mess@toks\expandafter{\the\rot@mess@toks (right hand page)}% + \fi + \fi + \vfill + \@@line{% + \hskip\rotFPtop + \rotatebox{90}{\box\rot@float@box}% + \hskip\rotFPbot + }% + }{% + \ifrot@messages + \if@rot@twoside + \rot@mess@toks\expandafter{\the\rot@mess@toks (left hand page)}% + \fi + \fi% + \@@line{% + \hskip\rotFPbot + \rotatebox{-90}{\box\rot@float@box}% + \hskip\rotFPtop + }% + \vfill + }% + \rot@message{\the\rot@mess@toks}% + }% + \end@dblfloat +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{environment}{sidewaysfigure*} +% \begin{environment}{sidewaystable*} +% \begin{macrocode} +\newenvironment{sidewaystable*} + {\@rotdblfloat{table}} + {\end@rotdblfloat} +\newenvironment{sidewaysfigure*} + {\@rotdblfloat{figure}} + {\end@rotdblfloat} + +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \begin{macro}{\rot@label} +% \begin{macro}{\rot@thepage} +% \begin{macro}{\rot@pageref} +% \begin{macro}{\rot@protected@write} +% \begin{macro}{\if@rot@refundefined} +% Note that we used \cs{rot@label}, not \cs{label}; this +% variant writes (just) the \emph{true} page number, not the +% value of \cs{thepage}; this ``true'' value then needs special +% treatment in \cs{protected@write}, just as +% \cs{thepage} already has. +% \cs{rot@pageref}\marg{generated label name}\marg{cs to set to +% pageno} then returns the labelled page's number (or 0 if label not +% yet defined). If label not defined, flags using +% \cs{rot@refundefinedtrue} for end-document to pick up. (later...) +% \begin{macrocode} +\def\rot@thepage{\@arabic\c@page} +\def\rot@label#1{\@bsphack + \rot@protected@write{\@auxout}{}% + {\string\newlabel{#1}{\rot@thepage}}% + \@esphack} +\def\rot@pageref#1#2{% + \expandafter\ifx\csname r@#1\endcsname\relax + \global\@rot@refundefinedtrue + \def#2{0}% + \else + \edef#2{\csname r@#1\endcsname}% + \fi +} +\long\def\rot@protected@write#1#2#3{% + \begingroup + \let\rot@thepage\relax + #2% + \let\protect\@unexpandable@protect + \edef\reserved@a{\write#1{#3}}% + \reserved@a + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi +} +\newif\if@rot@refundefined +\global\@rot@refundefinedfalse +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\rot@mess@toks} +% A token register to build up debugging messages +% \begin{macrocode} +\newtoks\rot@mess@toks +% \end{macrocode} +% \end{macro} +% +% \subsection{Rotated captions only} +% +% \begin{macro}{\rotcaption} +% \begin{macro}{\@makerotcaption} +% Sometimes you may find that the rotation of complete figures does +% not give quite the right result, since they always take up the whole +% page. You may prefer to rotate the caption and the float contents +% separately within a conventional figure. Here we offer a suggestion +% for a \cs{rotcaption} command, which inserts the caption rotated +% by 90 degrees. It is essentially a copy of the normal captioning +% code. +% Packages which define the \cs{@makecaption} command may also need +% to define \cs{@makerotcaption}. +% \begin{macrocode} +\def\rotcaption{\refstepcounter\@captype\@dblarg{\@rotcaption\@captype}} +\long\def\@rotcaption#1[#2]#3{% + \addcontentsline{\csname ext@#1\endcsname}{#1}{% + \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}% + \par + \begingroup + \@parboxrestore + \normalsize + \@makerotcaption{\csname fnum@#1\endcsname}{#3}% + \endgroup} + \long\def\@makerotcaption#1#2{% + \setbox\@tempboxa\color@hbox#1: #2\color@endbox + \ifdim \wd\@tempboxa > .8\vsize + \rotatebox{90}{% + \begin{minipage}{.8\textheight}#1: #2\end{minipage}% + }% + \else% + \rotatebox{90}{\box\@tempboxa}% + \fi + \nobreak + \hspace{12pt}% +} +% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Last-minute infrastructure} +% +% \begin{macro}{\color@hbox} +% \begin{macro}{\color@endbox} +% These macros aren't provided in \LaTeX{}, by default (I seem to have +% assumed that they were\dots) +% \begin{macrocode} +\AtBeginDocument{% + \providecommand\color@hbox{\hbox\bgroup}% + \providecommand\color@vbox{\vbox\bgroup}% + \providecommand\color@endbox{\egroup}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{History} +% +% Version 2.0 is a complete re-write, with most of the work now +% being done by the \LaTeXe\ graphics package. +% +% Version 2.1 provides a `clockwise' option to reinstate the behaviour +% described in the `\LaTeX\ Companion' +% +% Version 2.2 just intercepts the standard float macros instead +% of copying and changing the. The `twoside' option is obeyed. +% +% Version 2.5 corrects problems in sideways figures. +% +% Version 2.6 is a rewrite of the sideways floats via Frank Mittelbach +% (to whom many thanks for looking at the mangy code). +% +% Version 2.7 is checked for \LaTeX\ of December 94, and adds the option +% of twoside behaviour independent of the general twoside. +% +% Version 2.8 cleans up some mistakes pointed out by Harald Axel +% Sommerfeldt. +% +% Version 2.9 cleans up some (more) mistakes pointed out by Harald +% Axel Sommerfeldt. +% +% Version 2.13a permits positioning of rotated floats in the same way +% as they are positioned in `normal' floats. +% +% Version 2.14 is the first to be published anywhere as the outcome of +% maintenance by Robin Fairbairns. +% +% Version 2.15 deals with page-numbering bug for auto-float-rotation, +% and tidying of messages; published to ctan +% +% Version 2.16 uses colour boxes as necessary; published to ctan. +% Version 2.16a provides the colour box commands \cs{AtBeginDocument}. +% +% \Finale +\endinput +% diff --git a/Master/texmf-dist/source/latex/tools/shellesc.dtx b/Master/texmf-dist/source/latex/tools/shellesc.dtx index d33678caa31..ebc436ad96e 100644 --- a/Master/texmf-dist/source/latex/tools/shellesc.dtx +++ b/Master/texmf-dist/source/latex/tools/shellesc.dtx @@ -10,12 +10,14 @@ % %\ifx\ProvidesPackage\undefined %\def\next#1#2[#3]{\wlog{#2 #3}} +%\ifx\PackageInfo\undefined\def\PackageInfo#1#2{\wlog{#1: #2}}\fi +%\ifx\PackageWarning\undefined\def\PackageWarning#1#2{\wlog{#1: #2}}\fi %\expandafter\next\fi %\ProvidesPackage{shellesc} % \ProvidesFile{shellesc.drv} % \fi % \ProvidesFile{shellesc.dtx} - [2016/04/29 v0.01c unified shell escape interface for LaTeX] + [2016/06/07 v0.02a unified shell escape interface for LaTeX] % % \iffalse %<*driver> @@ -36,6 +38,7 @@ % \maketitle % % \changes{v0.1b}{2016/02/02}{Doc typo fixes (JB)} +% \changes{v0.2a}{2016/06/07}{Improve use with plain TeX} % \section{Introduction} % % @@ -92,6 +95,7 @@ % \subsection{Status Check} % % +% \changes{v0.2a}{2016/06/07}{spelling in messages} % \begin{macrocode} \ifcase \ifx\pdfshellescape\@undefined @@ -110,9 +114,9 @@ \fi \PackageWarning{shellesc}{Shell escape disabled} \or - \PackageInfo {shellesc}{Unrestricted shell escape ensabled} + \PackageInfo {shellesc}{Unrestricted shell escape enabled} \else - \PackageInfo {shellesc}{Restricted shell escape ensabled} + \PackageInfo {shellesc}{Restricted shell escape enabled} \fi % \end{macrocode} % @@ -180,7 +184,7 @@ % immediate form, which is overwhelmingly more commonly used with % |\write18|. % -% stop at this point if not a recent Lua\TeX. +% Stop at this point if not a recent Lua\TeX. % \begin{macrocode} \ifx\lastsavedimageresourcepages\@undefined\expandafter\endinput\fi % \end{macrocode} -- cgit v1.2.3