| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% File: pdflscape.dtx |
| 4 |
% Version: 2025-06-23 v0.14 |
| 5 |
% Info: Display of landscape pages in PDF |
| 6 |
% |
| 7 |
% Copyright (C) |
| 8 |
% 2001, 2004, 2006-2008 Heiko Oberdiek |
| 9 |
% 2016-2025 Oberdiek Package Support Group |
| 10 |
% https://github.com/ho-tex/pdflscape/issues |
| 11 |
% |
| 12 |
% This work may be distributed and/or modified under the |
| 13 |
% conditions of the LaTeX Project Public License, either |
| 14 |
% version 1.3c of this license or (at your option) any later |
| 15 |
% version. This version of this license is in |
| 16 |
% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 17 |
% and the latest version of this license is in |
| 18 |
% https://www.latex-project.org/lppl.txt |
| 19 |
% and version 1.3 or later is part of all distributions of |
| 20 |
% LaTeX version 2005/12/01 or later. |
| 21 |
% |
| 22 |
% This work has the LPPL maintenance status "maintained". |
| 23 |
% |
| 24 |
% The Current Maintainers of this work are |
| 25 |
% Heiko Oberdiek and the Oberdiek Package Support Group |
| 26 |
% https://github.com/ho-tex/pdflscape/issues |
| 27 |
% |
| 28 |
% This work consists of the main source file pdflscape.dtx |
| 29 |
% and the derived files |
| 30 |
% pdflscape.sty, pdflscape-nometadata, pdflscape.pdf, |
| 31 |
% pdflscape.ins, pdflscape.drv, |
| 32 |
% |
| 33 |
% Distribution: |
| 34 |
% CTAN:macros/latex/contrib/pdflscape/pdflscape.dtx |
| 35 |
% CTAN:macros/latex/contrib/pdflscape/pdflscape.pdf |
| 36 |
% |
| 37 |
% Unpacking: |
| 38 |
% (a) If pdflscape.ins is present: |
| 39 |
% tex pdflscape.ins |
| 40 |
% (b) Without pdflscape.ins: |
| 41 |
% tex pdflscape.dtx |
| 42 |
% (c) If you insist on using LaTeX |
| 43 |
% latex \let\install=y\input{pdflscape.dtx} |
| 44 |
% (quote the arguments according to the demands of your shell) |
| 45 |
% |
| 46 |
% Documentation: |
| 47 |
% (a) If pdflscape.drv is present: |
| 48 |
% latex pdflscape.drv |
| 49 |
% (b) Without pdflscape.drv: |
| 50 |
% latex pdflscape.dtx; ... |
| 51 |
% The class ltxdoc loads the configuration file ltxdoc.cfg |
| 52 |
% if available. Here you can specify further options, e.g. |
| 53 |
% use A4 as paper format: |
| 54 |
% \PassOptionsToClass{a4paper}{article} |
| 55 |
% |
| 56 |
% Programm calls to get the documentation (example): |
| 57 |
% pdflatex pdflscape.dtx |
| 58 |
% makeindex -s gind.ist pdflscape.idx |
| 59 |
% pdflatex pdflscape.dtx |
| 60 |
% makeindex -s gind.ist pdflscape.idx |
| 61 |
% pdflatex pdflscape.dtx |
| 62 |
% |
| 63 |
% Installation: |
| 64 |
% TDS:tex/latex/pdflscape/pdflscape.sty |
| 65 |
% TDS:tex/latex/pdflscape/pdflscape-nometadata.sty |
| 66 |
% TDS:doc/latex/pdflscape/pdflscape.pdf |
| 67 |
% TDS:source/latex/pdflscape/pdflscape.dtx |
| 68 |
% |
| 69 |
%<*ignore> |
| 70 |
\begingroup |
| 71 |
\catcode123=1 % |
| 72 |
\catcode125=2 % |
| 73 |
\def\x{LaTeX2e}% |
| 74 |
\expandafter\endgroup |
| 75 |
\ifcase 0\ifx\install y1\fi\expandafter |
| 76 |
\ifx\csname processbatchFile\endcsname\relax\else1\fi |
| 77 |
\ifx\fmtname\x\else 1\fi\relax |
| 78 |
\else\csname fi\endcsname |
| 79 |
%</ignore> |
| 80 |
%<*install> |
| 81 |
\input docstrip.tex |
| 82 |
\Msg{************************************************************************} |
| 83 |
\Msg{* Installation} |
| 84 |
\Msg{* Package: pdflscape 2025-06-23 v0.14 Display of landscape pages in PDF (HO)} |
| 85 |
\Msg{************************************************************************} |
| 86 |
|
| 87 |
\keepsilent |
| 88 |
\askforoverwritefalse |
| 89 |
|
| 90 |
\let\MetaPrefix\relax |
| 91 |
\preamble |
| 92 |
|
| 93 |
This is a generated file. |
| 94 |
|
| 95 |
Project: pdflscape |
| 96 |
Version: 2025-06-23 v0.14 |
| 97 |
|
| 98 |
Copyright (C) |
| 99 |
2001, 2004, 2006-2008 Heiko Oberdiek |
| 100 |
2016-2025 Oberdiek Package Support Group |
| 101 |
|
| 102 |
This work may be distributed and/or modified under the |
| 103 |
conditions of the LaTeX Project Public License, either |
| 104 |
version 1.3c of this license or (at your option) any later |
| 105 |
version. This version of this license is in |
| 106 |
https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 107 |
and the latest version of this license is in |
| 108 |
https://www.latex-project.org/lppl.txt |
| 109 |
and version 1.3 or later is part of all distributions of |
| 110 |
LaTeX version 2005/12/01 or later. |
| 111 |
|
| 112 |
This work has the LPPL maintenance status "maintained". |
| 113 |
|
| 114 |
The Current Maintainers of this work are |
| 115 |
Heiko Oberdiek and the Oberdiek Package Support Group |
| 116 |
https://github.com/ho-tex/pdflscape/issues |
| 117 |
|
| 118 |
|
| 119 |
This work consists of the main source file pdflscape.dtx |
| 120 |
and the derived files |
| 121 |
pdflscape.sty, pdflscape-nometadata.sty, pdflscape.pdf, |
| 122 |
pdflscape.ins, pdflscape.drv, |
| 123 |
|
| 124 |
\endpreamble |
| 125 |
\let\MetaPrefix\DoubleperCent |
| 126 |
|
| 127 |
\generate{% |
| 128 |
\file{pdflscape.ins}{\from{pdflscape.dtx}{install}}% |
| 129 |
\file{pdflscape.drv}{\from{pdflscape.dtx}{driver}}% |
| 130 |
\usedir{tex/latex/pdflscape}% |
| 131 |
\file{pdflscape-nometadata.sty}{\from{pdflscape.dtx}{package}}% |
| 132 |
\file{pdflscape.sty}{\from{pdflscape.dtx}{package-new}}% |
| 133 |
} |
| 134 |
|
| 135 |
\catcode32=13\relax% active space |
| 136 |
\let =\space% |
| 137 |
\Msg{************************************************************************} |
| 138 |
\Msg{*} |
| 139 |
\Msg{* To finish the installation you have to move the following} |
| 140 |
\Msg{* file into a directory searched by TeX:} |
| 141 |
\Msg{*} |
| 142 |
\Msg{* pdflscape.sty} |
| 143 |
\Msg{* pdflscape-nometadata.sty} |
| 144 |
\Msg{*} |
| 145 |
\Msg{* To produce the documentation run the file `pdflscape.drv'} |
| 146 |
\Msg{* through LaTeX.} |
| 147 |
\Msg{*} |
| 148 |
\Msg{* Happy TeXing!} |
| 149 |
\Msg{*} |
| 150 |
\Msg{************************************************************************} |
| 151 |
|
| 152 |
\endbatchfile |
| 153 |
%</install> |
| 154 |
%<*ignore> |
| 155 |
\fi |
| 156 |
%</ignore> |
| 157 |
%<*driver> |
| 158 |
\NeedsTeXFormat{LaTeX2e} |
| 159 |
\ProvidesFile{pdflscape.drv}% |
| 160 |
[2025-06-23 v0.14 Display of landscape pages in PDF (HO)]% |
| 161 |
\documentclass{ltxdoc} |
| 162 |
\usepackage{holtxdoc}[2011/11/22] |
| 163 |
\usepackage{graphics} |
| 164 |
\begin{document} |
| 165 |
\DocInput{pdflscape.dtx}% |
| 166 |
\end{document} |
| 167 |
%</driver> |
| 168 |
% \fi |
| 169 |
% |
| 170 |
% |
| 171 |
% |
| 172 |
% \GetFileInfo{pdflscape.drv} |
| 173 |
% |
| 174 |
% \title{The \xpackage{pdflscape} package} |
| 175 |
% \date{2025-06-23 v0.14} |
| 176 |
% \author{Heiko Oberdiek\thanks |
| 177 |
% {Please report any issues at \url{https://github.com/ho-tex/pdflscape/issues}}} |
| 178 |
% |
| 179 |
% \maketitle |
| 180 |
% |
| 181 |
% \begin{abstract} |
| 182 |
% Package \xpackage{pdflscape} adds PDF support to the |
| 183 |
% environment \texttt{landscape} of package \xpackage{lscape} |
| 184 |
% by setting the PDF page attribute \texttt{/Rotate}. |
| 185 |
% \end{abstract} |
| 186 |
% |
| 187 |
% \tableofcontents |
| 188 |
% |
| 189 |
% \section{Documentation} |
| 190 |
% |
| 191 |
% \subsection{Supported drivers} |
| 192 |
% |
| 193 |
% If the PDF management is loaded by the use of \verb+\DocumentMetadata{}+ at |
| 194 |
% the beginning of the document, the engines and backends supported by \texttt{l3backend} |
| 195 |
% can be used. Driver options are passed to graphics and are typically only needed if |
| 196 |
% \LaTeX{} is used with \texttt{dvipdfmx}. |
| 197 |
% |
| 198 |
% Without the PDF management the following driver options can be used (many are |
| 199 |
% simply aliases to each other): |
| 200 |
% |
| 201 |
% \begin{itemize} |
| 202 |
% \item \xoption{pdftex},\xoption{luatex} |
| 203 |
% \item \xoption{dvips}, \xoption{dvipsone}, |
| 204 |
% \xoption{pctexps} |
| 205 |
% (and other drivers that provide a non-empty \cs{Gin@PS@raw}) |
| 206 |
% \item \xoption{dvipdfm}, \xoption{dvipdfmx}, \xoption{xetex} |
| 207 |
% \end{itemize} |
| 208 |
% |
| 209 |
% \subsection{Caveat} |
| 210 |
% |
| 211 |
% Depending on the configuration Ghostscript |
| 212 |
% adds a guessed rotation entry by its own. |
| 213 |
% This can lead to two |/Rotate| entries per page. |
| 214 |
% To prevent this behaviour set the parameter |
| 215 |
% |AutoRotatePages| to |/None|, eg: |
| 216 |
% \begin{quote} |
| 217 |
% |ps2pdf -dAutoRotatePages=/None| |
| 218 |
% \end{quote} |
| 219 |
% |
| 220 |
% \subsection{Requirements} |
| 221 |
% |
| 222 |
% \begin{itemize} |
| 223 |
% \item The package \xpackage{lscape}. |
| 224 |
% \item The package \xpackage{atbegshi} for all drivers |
| 225 |
% except \xoption{pdftex},\xoption{luatex}. |
| 226 |
% \end{itemize} |
| 227 |
% |
| 228 |
% \subsection{Usage} |
| 229 |
% |
| 230 |
% Load this package instead of or after package \xpackage{lscape}: |
| 231 |
% \begin{quote} |
| 232 |
% |\usepackage{pdflscape}|\\ |
| 233 |
% |\begin{landscape}|\dots|\end{landscape}| |
| 234 |
% \end{quote} |
| 235 |
% |
| 236 |
% \StopEventually{ |
| 237 |
% } |
| 238 |
% |
| 239 |
% \section{Implementation} |
| 240 |
% \subsection{New version using the methods of the PDF management} |
| 241 |
% Identification |
| 242 |
% \begin{macrocode} |
| 243 |
%<*package-new> |
| 244 |
\NeedsTeXFormat{LaTeX2e}[2020/10/01] |
| 245 |
\ProvidesExplPackage{pdflscape}{2025-06-23}{0.14} |
| 246 |
{Display of landscape pages in PDF}% |
| 247 |
% \end{macrocode} |
| 248 |
% Testing if the pdfmanagement is used |
| 249 |
% \begin{macrocode} |
| 250 |
\IfPDFManagementActiveF {\RequirePackageWithOptions{pdflscape-nometadata}} |
| 251 |
\IfPDFManagementActiveF {\endinput} |
| 252 |
% \end{macrocode} |
| 253 |
% Load lscape, but don't pass the \texttt{pdftex} option |
| 254 |
% as it would use \cs{pdfpageattr} which is incompatible with the pdf management. |
| 255 |
% \begin{macrocode} |
| 256 |
\DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}} |
| 257 |
\ProcessOptions |
| 258 |
\RequirePackage{lscape} |
| 259 |
% \end{macrocode} |
| 260 |
% this always turns in the same direction as the original code |
| 261 |
% of pdflscape does. left and right would need |
| 262 |
% \verb+\pdfmanagement_add:nnn{ThisPage}{Rotate}{..}+ |
| 263 |
% on every page (e.g. in a shipout hook) and some option to control the wanted |
| 264 |
% orientation. |
| 265 |
|
| 266 |
% \begin{macrocode} |
| 267 |
\tl_new:N\g__pdflscape_saverotate_tl |
| 268 |
\hook_gput_code:nnn {env/landscape/begin}{pdflscape} |
| 269 |
{ |
| 270 |
\pdfmanagement_get:nnN {Page}{Rotate}\l_tmpa_tl |
| 271 |
\tl_gset_eq:NN\g__pdflscape_saverotate_tl\l_tmpa_tl |
| 272 |
\clearpage |
| 273 |
\pdfmanagement_add:nnn{Page}{Rotate}{90} |
| 274 |
} |
| 275 |
\hook_gput_code:nnn {env/landscape/after}{pdflscape} |
| 276 |
{ |
| 277 |
\quark_if_no_value:NTF\g__pdflscape_saverotate_tl |
| 278 |
{\pdfmanagement_remove:nn{Page}{Rotate}} |
| 279 |
{\pdfmanagement_add:nnx{Page}{Rotate}{\g__pdflscape_saverotate_tl}} |
| 280 |
} |
| 281 |
%</package-new> |
| 282 |
% \end{macrocode} |
| 283 |
% |
| 284 |
% \subsection{Old version without the PDF management} |
| 285 |
% |
| 286 |
% \begin{macrocode} |
| 287 |
%<*package> |
| 288 |
% \end{macrocode} |
| 289 |
% Package identification. |
| 290 |
% \begin{macrocode} |
| 291 |
\NeedsTeXFormat{LaTeX2e} |
| 292 |
\ProvidesPackage{pdflscape-nometadata}% |
| 293 |
[2025-06-23 v0.14 Display of landscape pages in PDF (HO)] |
| 294 |
% \end{macrocode} |
| 295 |
% |
| 296 |
% \subsection{Driver options} |
| 297 |
% |
| 298 |
% \begin{macrocode} |
| 299 |
\let\PLS@option\@empty |
| 300 |
\let\PLS@driver\@empty |
| 301 |
\def\PLS@temp#1#2{% |
| 302 |
\DeclareOption{#1}{% |
| 303 |
\let\PLS@option\CurrentOption |
| 304 |
\def\PLS@driver{#2}% |
| 305 |
}% |
| 306 |
} |
| 307 |
\PLS@temp{pdftex}{pdftex} |
| 308 |
\PLS@temp{luatex}{pdftex} |
| 309 |
\PLS@temp{dvips}{dvips} |
| 310 |
\PLS@temp{dvipsone}{dvips} |
| 311 |
\PLS@temp{pctexps}{dvips} |
| 312 |
\PLS@temp{dvipdfm}{dvipdfm} |
| 313 |
\PLS@temp{dvipdfmx}{dvipdfm} |
| 314 |
\PLS@temp{xetex}{dvipdfm} |
| 315 |
\let\PLS@temp\@empty |
| 316 |
\DeclareOption*{% |
| 317 |
\ifx\PLS@temp\@empty |
| 318 |
\let\PLS@temp\CurrentOption |
| 319 |
\else |
| 320 |
\edef\PLS@temp{\PLS@temp,\CurrentOption}% |
| 321 |
\fi |
| 322 |
} |
| 323 |
\ProcessOptions* |
| 324 |
\ifx\PLS@option\@empty |
| 325 |
\else |
| 326 |
\expandafter\PassOptionsToPackage\expandafter{\PLS@option}{lscape}% |
| 327 |
\fi |
| 328 |
\ifx\PLS@temp\@empty |
| 329 |
\else |
| 330 |
\expandafter\PassOptionsToPackage\expandafter{\PLS@temp}{lscape}% |
| 331 |
\fi |
| 332 |
\RequirePackage{iftex}[2019/11/07]% |
| 333 |
\RequirePackage{lscape} |
| 334 |
% \end{macrocode} |
| 335 |
% |
| 336 |
% \subsection{Autodetection of driver} |
| 337 |
% |
| 338 |
% \subsubsection{Driver \xoption{pdftex}} |
| 339 |
% |
| 340 |
% \begin{macrocode} |
| 341 |
\def\PLS@temp{pdftex} |
| 342 |
\ifpdf |
| 343 |
\ifx\PLS@driver\@empty |
| 344 |
\let\PLS@driver\PLS@temp |
| 345 |
\PackageInfo{pdflscape}{Auto-detected driver: \PLS@temp}% |
| 346 |
\fi |
| 347 |
\ifx\PLS@driver\PLS@temp |
| 348 |
\else |
| 349 |
\PackageError{pdflscape}{% |
| 350 |
The driver option `\PLS@option' is not compatible\MessageBreak |
| 351 |
with pdfTeX in PDF mode, using driver `pdftex' instead% |
| 352 |
}\@ehc |
| 353 |
\let\PLS@driver\PLS@temp |
| 354 |
\fi |
| 355 |
\fi |
| 356 |
% \end{macrocode} |
| 357 |
% |
| 358 |
% \subsubsection{Driver \xoption{xetex}} |
| 359 |
% |
| 360 |
% \begin{macrocode} |
| 361 |
\def\PLS@temp{dvipdfm} |
| 362 |
\ifxetex |
| 363 |
\ifx\PLS@driver\@empty |
| 364 |
\let\PLS@driver\PLS@temp |
| 365 |
\PackageInfo{pdflscape}{% |
| 366 |
Auto-detected driver: \PLS@temp\space(xetex)% |
| 367 |
}% |
| 368 |
\fi |
| 369 |
\ifx\PLS@driver\PLS@temp |
| 370 |
\else |
| 371 |
\PackageError{pdflscape}{% |
| 372 |
The driver option `\PLS@option' is not compatible\MessageBreak |
| 373 |
with XeTeX, using driver for XeTeX (dvipdfm) instead% |
| 374 |
}\@ehc |
| 375 |
\let\PLS@driver\PLS@temp |
| 376 |
\fi |
| 377 |
\fi |
| 378 |
% \end{macrocode} |
| 379 |
% |
| 380 |
% \subsubsection{Detect driver based on \cs{Gin@driver}} |
| 381 |
% |
| 382 |
% \begin{macrocode} |
| 383 |
\def\PLS@temp#1#2{% |
| 384 |
\ifx\PLS@driver\@empty |
| 385 |
\begingroup |
| 386 |
\def\PLS@temp{#1.def}% |
| 387 |
\expandafter\endgroup |
| 388 |
\ifx\PLS@temp\Gin@driver |
| 389 |
\def\PLS@driver{#2}% |
| 390 |
\PackageInfo{pdflscape}{% |
| 391 |
Auto-detected driver: \PLS@driver\space(#1)% |
| 392 |
}% |
| 393 |
\fi |
| 394 |
\fi |
| 395 |
} |
| 396 |
\PLS@temp{dvipdfm}{dvipdfm} |
| 397 |
\PLS@temp{dvipdfmx}{dvipdfm} |
| 398 |
\PLS@temp{dvips}{dvips} |
| 399 |
\PLS@temp{dvipsone}{dvips} |
| 400 |
\PLS@temp{pctexps}{dvips} |
| 401 |
% \end{macrocode} |
| 402 |
% |
| 403 |
% \subsubsection{Driver \xoption{dvips}} |
| 404 |
% |
| 405 |
% \begin{macrocode} |
| 406 |
\ifx\PLS@driver\@empty |
| 407 |
\def\PLS@temp{dvips}% |
| 408 |
\ifnum 1=0\ifx\Gin@PS@raw\@undefined |
| 409 |
\else |
| 410 |
\ifx\Gin@PS@raw\relax |
| 411 |
\else |
| 412 |
\ifx\Gin@PS@raw\@empty |
| 413 |
\else |
| 414 |
1% |
| 415 |
\fi |
| 416 |
\fi |
| 417 |
\fi |
| 418 |
\space |
| 419 |
\let\PLS@driver\PLS@temp |
| 420 |
\PackageInfo{pdflscape}{% |
| 421 |
Auto-detected driver: \PLS@temp\space(PostScript)% |
| 422 |
}% |
| 423 |
\fi |
| 424 |
\fi |
| 425 |
% \end{macrocode} |
| 426 |
% |
| 427 |
% \begin{macrocode} |
| 428 |
\ifx\PLS@driver\@empty |
| 429 |
\PackageError{pdflscape}{% |
| 430 |
Neither pdfTeX, PostScript, nor dvipdfm driver found% |
| 431 |
}\@ehc |
| 432 |
\fi |
| 433 |
% \end{macrocode} |
| 434 |
% |
| 435 |
% \subsection{Driver implementation} |
| 436 |
% |
| 437 |
% \begin{itemize} |
| 438 |
% \item |\PLS@AddRotate #1|\\ |
| 439 |
% it expects the correct rotation number in |#1| |
| 440 |
% and implements the adding of the /Rotation entry |
| 441 |
% in the |/Page| object of the current page. |
| 442 |
% \item |\PLS@RemoveRotate|\\ |
| 443 |
% it removes a previous |/Rotate| entry, if necessary. |
| 444 |
% \end{itemize} |
| 445 |
% |
| 446 |
% \subsubsection{\pdfTeX} |
| 447 |
% |
| 448 |
% Not too nice is the global setting of \cs{pdfpageattr}. |
| 449 |
% Perhaps this can be changed in future versions. |
| 450 |
% |
| 451 |
% luatex compat. |
| 452 |
% \begin{macrocode} |
| 453 |
\ifx\pdfpageattr\@undefined |
| 454 |
\ifx\pdfvariable\@undefined\else |
| 455 |
\protected\edef\pdfpageattr{\pdfvariable pageattr} |
| 456 |
\fi |
| 457 |
\fi |
| 458 |
% \end{macrocode} |
| 459 |
% \begin{macrocode} |
| 460 |
\def\PLS@temp{pdftex} |
| 461 |
\ifx\PLS@temp\PLS@driver |
| 462 |
\def\PLS@AddRotate#1{% |
| 463 |
\ifnum#1=0 % |
| 464 |
% \end{macrocode} |
| 465 |
% Already the default. |
| 466 |
% \begin{macrocode} |
| 467 |
\else |
| 468 |
\global\pdfpageattr\expandafter{% |
| 469 |
\the\pdfpageattr |
| 470 |
/Rotate #1% |
| 471 |
}% |
| 472 |
\fi |
| 473 |
}% |
| 474 |
% \end{macrocode} |
| 475 |
% Removes a |/Rotate| entry. |
| 476 |
% \begin{macrocode} |
| 477 |
\def\PLS@RemoveRotate{% |
| 478 |
\begingroup |
| 479 |
\global\pdfpageattr\expandafter{\expandafter}% |
| 480 |
\expandafter\PLS@@RemoveRotate |
| 481 |
\the\pdfpageattr /Rotate\@nil |
| 482 |
\endgroup |
| 483 |
}% |
| 484 |
\def\PLS@@RemoveRotate#1/Rotate#2\@nil{% |
| 485 |
% \end{macrocode} |
| 486 |
% Append |/Rotate| free stuff to \cs{pdfpageattr}. |
| 487 |
% \begin{macrocode} |
| 488 |
\global\pdfpageattr\expandafter{\the\pdfpageattr#1}% |
| 489 |
\ifx\\#2\\% |
| 490 |
% \end{macrocode} |
| 491 |
% Ready, because the detected |/Rotate| is part of |
| 492 |
% the end marker: |/Rotate\@nil| |
| 493 |
% \begin{macrocode} |
| 494 |
\else |
| 495 |
% \end{macrocode} |
| 496 |
% First read in the argument of |/Rotate|, |
| 497 |
% then continue parsing. |
| 498 |
% \begin{macrocode} |
| 499 |
\afterassignment\PLS@@RemoveRotate |
| 500 |
\count0=#2\@nil |
| 501 |
\fi |
| 502 |
}% |
| 503 |
\fi |
| 504 |
% \end{macrocode} |
| 505 |
% |
| 506 |
% \subsubsection{PostScript driver} |
| 507 |
% |
| 508 |
% \begin{macrocode} |
| 509 |
\def\PLS@temp{dvips} |
| 510 |
\ifx\PLS@temp\PLS@driver |
| 511 |
\AddToHook{shipout/before}{\PLS@AtBeginShipout}% |
| 512 |
\let\PLS@AtBeginShipout\@empty |
| 513 |
\def\PLS@AddRotate#1{% |
| 514 |
\ifnum#1=0 % |
| 515 |
\else |
| 516 |
\def\PLS@AtBeginShipout{% |
| 517 |
\global\setbox\ShipoutBox\vbox{% |
| 518 |
\Gin@PS@raw{% |
| 519 |
[{ThisPage}\string<\string</Rotate #1\string>\string>% |
| 520 |
/PUT pdfmark% |
| 521 |
}% |
| 522 |
\box\ShipoutBox |
| 523 |
}% |
| 524 |
}% |
| 525 |
\fi |
| 526 |
}% |
| 527 |
\def\PLS@RemoveRotate{\let\PLS@AtBeginShipout\@empty}% |
| 528 |
\fi |
| 529 |
% \end{macrocode} |
| 530 |
% |
| 531 |
% \subsubsection{Driver dvipdfm} |
| 532 |
% |
| 533 |
% \begin{macrocode} |
| 534 |
\def\PLS@temp{dvipdfm} |
| 535 |
\ifx\PLS@temp\PLS@driver |
| 536 |
\AddToHook{shipout/before}{\PLS@AtBeginShipout}% |
| 537 |
\let\PLS@AtBeginShipout\@empty |
| 538 |
\def\PLS@AddRotate#1{% |
| 539 |
\ifnum#1=0 % |
| 540 |
\else |
| 541 |
\def\PLS@AtBeginShipout{% |
| 542 |
\global\setbox\ShipoutBox\vbox{% |
| 543 |
\special{pdf: put @thispage <</Rotate #1>>}% |
| 544 |
\box\ShipoutBox |
| 545 |
}% |
| 546 |
}% |
| 547 |
\fi |
| 548 |
}% |
| 549 |
\def\PLS@RemoveRotate{\let\PLS@AtBeginShipout\@empty}% |
| 550 |
\fi |
| 551 |
% \end{macrocode} |
| 552 |
% |
| 553 |
% \subsection{Driver independent stuff} |
| 554 |
% |
| 555 |
% The landscape environment is extended by |
| 556 |
% adding the correct |/Rotate| entries. |
| 557 |
% \begin{macrocode} |
| 558 |
\g@addto@macro{\landscape}{\PLS@Rotate{90}} |
| 559 |
\g@addto@macro{\endlandscape}{\PLS@Rotate{0}} |
| 560 |
% \end{macrocode} |
| 561 |
% |
| 562 |
% \begin{macro}{\PLS@Rotate} |
| 563 |
% Main macro, that sets the |/Rotate| entry.\\ |
| 564 |
% Argument: any TeX number or nothing, that means zero.\\ |
| 565 |
% Driver independent. |
| 566 |
% \begin{macrocode} |
| 567 |
\def\PLS@Rotate#1{% |
| 568 |
\begingroup |
| 569 |
% \end{macrocode} |
| 570 |
% 1. Check and validate the argument. |
| 571 |
% \begin{macrocode} |
| 572 |
\PLS@CheckAngle{#1}% |
| 573 |
\expandafter\endgroup |
| 574 |
% \end{macrocode} |
| 575 |
% 2. Remove previous |\Rotate| entry. |
| 576 |
% \begin{macrocode} |
| 577 |
\expandafter\PLS@RemoveRotate |
| 578 |
% \end{macrocode} |
| 579 |
% 3. Add |/Rotate| entry. |
| 580 |
% \begin{macrocode} |
| 581 |
\expandafter\PLS@AddRotate\expandafter{\the\count@}% |
| 582 |
} |
| 583 |
% \end{macrocode} |
| 584 |
% \end{macro} |
| 585 |
% |
| 586 |
% \begin{macro}{\PLS@CheckAngle} |
| 587 |
% Validates the rotation angle.\\ |
| 588 |
% The result is stored in the count register |\count@|.\\ |
| 589 |
% Driver independent. |
| 590 |
% \begin{macrocode} |
| 591 |
\def\PLS@CheckAngle#1{% |
| 592 |
% \end{macrocode} |
| 593 |
% Nothing means zero: |
| 594 |
% \begin{macrocode} |
| 595 |
\ifx\\#1\\% |
| 596 |
\count@=0 % |
| 597 |
\else |
| 598 |
\count@=#1\relax |
| 599 |
\fi |
| 600 |
% \end{macrocode} |
| 601 |
% Normalize to interval -360 $<$ |\count@| $<$ 360. |
| 602 |
% \begin{macrocode} |
| 603 |
\@whilenum\count@>359\do{\advance\count@ -360 }% |
| 604 |
\@whilenum\count@<-359\do{\advance\count@ 360 }% |
| 605 |
% \end{macrocode} |
| 606 |
% Check values: 0, +/-90, +/-180, +/-270 |
| 607 |
% \begin{macrocode} |
| 608 |
\ifnum 1=0\ifnum\count@=0 \else |
| 609 |
\ifnum\count@=90 \else |
| 610 |
\ifnum\count@=-90 \else |
| 611 |
\ifnum\count@=180 \else |
| 612 |
\ifnum\count@=-180 \else |
| 613 |
\ifnum\count@=270 \else |
| 614 |
\ifnum\count@=-270 \else |
| 615 |
1\fi\fi\fi\fi\fi\fi\fi\relax |
| 616 |
\PackageError{pdflscape}{% |
| 617 |
Invalid value \the\count@\space for /Rotate% |
| 618 |
}\@ehc |
| 619 |
\count@=0 % |
| 620 |
\fi |
| 621 |
} |
| 622 |
% \end{macrocode} |
| 623 |
% \end{macro} |
| 624 |
% |
| 625 |
% \begin{macrocode} |
| 626 |
%</package> |
| 627 |
% \end{macrocode} |
| 628 |
% |
| 629 |
% \section{Installation} |
| 630 |
% |
| 631 |
% \subsection{Download} |
| 632 |
% |
| 633 |
% \paragraph{Package.} This package is available on |
| 634 |
% CTAN\footnote{\CTANpkg{pdflscape}}: |
| 635 |
% \begin{description} |
| 636 |
% \item[\CTAN{macros/latex/contrib/pdflscape/pdflscape.dtx}] The source file. |
| 637 |
% \item[\CTAN{macros/latex/contrib/pdflscape/pdflscape.pdf}] Documentation. |
| 638 |
% \end{description} |
| 639 |
% |
| 640 |
% |
| 641 |
% \subsection{Package installation} |
| 642 |
% |
| 643 |
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting |
| 644 |
% \docstrip\ archive. The files are extracted by running the |
| 645 |
% \xfile{.dtx} through \plainTeX: |
| 646 |
% \begin{quote} |
| 647 |
% \verb|tex pdflscape.dtx| |
| 648 |
% \end{quote} |
| 649 |
% |
| 650 |
% \paragraph{TDS.} Now the different files must be moved into |
| 651 |
% the different directories in your installation TDS tree |
| 652 |
% (also known as \xfile{texmf} tree): |
| 653 |
% \begin{quote} |
| 654 |
% \def\t{^^A |
| 655 |
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} |
| 656 |
% pdflscape.sty & tex/latex/pdflscape/pdflscape.sty\\ |
| 657 |
% pdflscape-nometadata.sty & tex/latex/pdflscape/pdflscape-nometadata.sty\\ |
| 658 |
% pdflscape.pdf & doc/latex/pdflscape/pdflscape.pdf\\ |
| 659 |
% pdflscape.dtx & source/latex/pdflscape/pdflscape.dtx\\ |
| 660 |
% \end{tabular}^^A |
| 661 |
% }^^A |
| 662 |
% \sbox0{\t}^^A |
| 663 |
% \ifdim\wd0>\linewidth |
| 664 |
% \begingroup |
| 665 |
% \advance\linewidth by\leftmargin |
| 666 |
% \advance\linewidth by\rightmargin |
| 667 |
% \edef\x{\endgroup |
| 668 |
% \def\noexpand\lw{\the\linewidth}^^A |
| 669 |
% }\x |
| 670 |
% \def\lwbox{^^A |
| 671 |
% \leavevmode |
| 672 |
% \hbox to \linewidth{^^A |
| 673 |
% \kern-\leftmargin\relax |
| 674 |
% \hss |
| 675 |
% \usebox0 |
| 676 |
% \hss |
| 677 |
% \kern-\rightmargin\relax |
| 678 |
% }^^A |
| 679 |
% }^^A |
| 680 |
% \ifdim\wd0>\lw |
| 681 |
% \sbox0{\small\t}^^A |
| 682 |
% \ifdim\wd0>\linewidth |
| 683 |
% \ifdim\wd0>\lw |
| 684 |
% \sbox0{\footnotesize\t}^^A |
| 685 |
% \ifdim\wd0>\linewidth |
| 686 |
% \ifdim\wd0>\lw |
| 687 |
% \sbox0{\scriptsize\t}^^A |
| 688 |
% \ifdim\wd0>\linewidth |
| 689 |
% \ifdim\wd0>\lw |
| 690 |
% \sbox0{\tiny\t}^^A |
| 691 |
% \ifdim\wd0>\linewidth |
| 692 |
% \lwbox |
| 693 |
% \else |
| 694 |
% \usebox0 |
| 695 |
% \fi |
| 696 |
% \else |
| 697 |
% \lwbox |
| 698 |
% \fi |
| 699 |
% \else |
| 700 |
% \usebox0 |
| 701 |
% \fi |
| 702 |
% \else |
| 703 |
% \lwbox |
| 704 |
% \fi |
| 705 |
% \else |
| 706 |
% \usebox0 |
| 707 |
% \fi |
| 708 |
% \else |
| 709 |
% \lwbox |
| 710 |
% \fi |
| 711 |
% \else |
| 712 |
% \usebox0 |
| 713 |
% \fi |
| 714 |
% \else |
| 715 |
% \lwbox |
| 716 |
% \fi |
| 717 |
% \else |
| 718 |
% \usebox0 |
| 719 |
% \fi |
| 720 |
% \end{quote} |
| 721 |
% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's |
| 722 |
% TDS installing feature, then some files can already be in the right |
| 723 |
% place, see the documentation of \docstrip. |
| 724 |
% |
| 725 |
% \subsection{Refresh file name databases} |
| 726 |
% |
| 727 |
% If your \TeX~distribution |
| 728 |
% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh |
| 729 |
% these. For example, \TeX\,Live\ users run \verb|texhash| or |
| 730 |
% \verb|mktexlsr|. |
| 731 |
% |
| 732 |
% \subsection{Some details for the interested} |
| 733 |
% |
| 734 |
% \paragraph{Unpacking with \LaTeX.} |
| 735 |
% The \xfile{.dtx} chooses its action depending on the format: |
| 736 |
% \begin{description} |
| 737 |
% \item[\plainTeX:] Run \docstrip\ and extract the files. |
| 738 |
% \item[\LaTeX:] Generate the documentation. |
| 739 |
% \end{description} |
| 740 |
% If you insist on using \LaTeX\ for \docstrip\ (really, |
| 741 |
% \docstrip\ does not need \LaTeX), then inform the autodetect routine |
| 742 |
% about your intention: |
| 743 |
% \begin{quote} |
| 744 |
% \verb|latex \let\install=y\input{pdflscape.dtx}| |
| 745 |
% \end{quote} |
| 746 |
% Do not forget to quote the argument according to the demands |
| 747 |
% of your shell. |
| 748 |
% |
| 749 |
% \paragraph{Generating the documentation.} |
| 750 |
% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate |
| 751 |
% the documentation. The process can be configured by the |
| 752 |
% configuration file \xfile{ltxdoc.cfg}. For instance, put this |
| 753 |
% line into this file, if you want to have A4 as paper format: |
| 754 |
% \begin{quote} |
| 755 |
% \verb|\PassOptionsToClass{a4paper}{article}| |
| 756 |
% \end{quote} |
| 757 |
% An example follows how to generate the |
| 758 |
% documentation with pdf\LaTeX: |
| 759 |
% \begin{quote} |
| 760 |
%\begin{verbatim} |
| 761 |
%pdflatex pdflscape.dtx |
| 762 |
%makeindex -s gind.ist pdflscape.idx |
| 763 |
%pdflatex pdflscape.dtx |
| 764 |
%makeindex -s gind.ist pdflscape.idx |
| 765 |
%pdflatex pdflscape.dtx |
| 766 |
%\end{verbatim} |
| 767 |
% \end{quote} |
| 768 |
% |
| 769 |
% \begin{History} |
| 770 |
% \begin{Version}{2001/01/15 v0.1} |
| 771 |
% \item |
| 772 |
% First public version, |
| 773 |
% published in \xnewsgroup{de.comp.text.tex}:\\ |
| 774 |
% \URL{``\link{Re: Querformat, pdfLaTex und thumbpdf}''}^^A |
| 775 |
% {https://groups.google.com/group/de.comp.text.tex/msg/e054c5795e52d2b8} |
| 776 |
% \end{Version} |
| 777 |
% \begin{Version}{2001/02/04 v0.2} |
| 778 |
% \item |
| 779 |
% Minor documentation update. |
| 780 |
% \item |
| 781 |
% CTAN. |
| 782 |
% \end{Version} |
| 783 |
% \begin{Version}{2004/05/11 v0.3} |
| 784 |
% \item |
| 785 |
% Support for dvipdfm added. |
| 786 |
% \end{Version} |
| 787 |
% \begin{Version}{2004/05/12 v0.4} |
| 788 |
% \item |
| 789 |
% Bug fix: support for multipage landscape environment |
| 790 |
% for all drivers except for \xoption{pdftex}. |
| 791 |
% \end{Version} |
| 792 |
% \begin{Version}{2006/02/20 v0.5} |
| 793 |
% \item |
| 794 |
% DTX framework. |
| 795 |
% \item |
| 796 |
% LPPL 1.3 |
| 797 |
% \item |
| 798 |
% Code is not changed. |
| 799 |
% \end{Version} |
| 800 |
% \begin{Version}{2006/04/24 v0.6} |
| 801 |
% \item |
| 802 |
% Bug fix: \cs{PLS@RemoveRotate} reinserted for \cs{PLS@Rotate}. |
| 803 |
% \item |
| 804 |
% Fix for \cs{PLS@RemoveRotate} (dvips/dvipdfm): \cs{PLS@EverhShi} |
| 805 |
% hook is cleared. |
| 806 |
% \end{Version} |
| 807 |
% \begin{Version}{2007/04/11 v0.7} |
| 808 |
% \item |
| 809 |
% Line ends sanitized. |
| 810 |
% \end{Version} |
| 811 |
% \begin{Version}{2007/04/17 v0.8} |
| 812 |
% \item |
| 813 |
% Package \xpackage{atbegshi} replaces \xpackage{everyshi}. |
| 814 |
% \end{Version} |
| 815 |
% \begin{Version}{2007/10/21 v0.9} |
| 816 |
% \item |
| 817 |
% Driver detection for \XeTeX\ added. |
| 818 |
% \item |
| 819 |
% Fix for rotation angles $\le$~-360 or $\ge$~360. |
| 820 |
% \end{Version} |
| 821 |
% \begin{Version}{2008/08/11 v0.10} |
| 822 |
% \item |
| 823 |
% Code is not changed. |
| 824 |
% \item |
| 825 |
% URLs updated. |
| 826 |
% \end{Version} |
| 827 |
% \begin{Version}{2016/05/14 v0.11} |
| 828 |
% \item |
| 829 |
% LuaTeX Compatibility |
| 830 |
% \end{Version} |
| 831 |
% \begin{Version}{2019/12/05 v0.12} |
| 832 |
% \item |
| 833 |
% Documentation updates. |
| 834 |
% \item \xpackage{iftex} package. |
| 835 |
% \end{Version} |
| 836 |
% \begin{Version}{2022-10-28 v0.13} |
| 837 |
% \item Made the package compatible with the PDF management. |
| 838 |
% \item Removed the dependency to atbegshi. |
| 839 |
% \end{Version} |
| 840 |
% \begin{Version}{2025-06-23 v0.14} |
| 841 |
% \item Updated test for PDF management. |
| 842 |
% \end{Version} |
| 843 |
% \end{History} |
| 844 |
% |
| 845 |
% \PrintIndex |
| 846 |
% |
| 847 |
% \Finale |
| 848 |
\endinput |