Debian Codegraph @

texmf-dist/tex/latex/latex-make/pdfswitch.sty

raw
1 %%
2 %% This is file `pdfswitch.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% pdfswitch.dtx (with options: `package')
8 %%
9 %% IMPORTANT NOTICE:
10 %%
11 %% For the copyright see the source file.
12 %%
13 %% Any modified versions of this file must be renamed
14 %% with new filenames distinct from pdfswitch.sty.
15 %%
16 %% For distribution of the original source see the terms
17 %% for copying and modification in the file pdfswitch.dtx.
18 %%
19 %% This generated file may be distributed as long as the
20 %% original source files, as listed above, are part of the
21 %% same distribution. (The sources need not necessarily be
22 %% in the same archive or directory.)
23 %%
24 %% File: pdfswitch.dtx Copyright (C) 2002--2016 V. Danjean, A. Legrand
25 %% [email protected]
26 %% [email protected]
27 %%
28 %% This program is free software; you can redistribute it and/or
29 %% modify it under the terms of the GNU General Public License
30 %% as published by the Free Software Foundation; either version 2
31 %% of the License, or (at your option) any later version.
32 %%
33 %% This program is distributed in the hope that it will be useful,
34 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
35 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 %% GNU General Public License for more details.
37 %%
38 %% You should have received a copy of the GNU General Public License
39 %% along with this program; if not, write to the Free Software
40 %% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41 %%
42 \NeedsTeXFormat{LaTeX2e}%
43 \ProvidesPackage{pdfswitch}%
44 [2021/10/26 v2.4.3 No changes in pdfswitch.dtx]
45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 %%%
48 \RequirePackage{ae,aeguill}
49 \RequirePackage{ifthen}
50 \RequirePackage{ifpdf}
51 \RequirePackage{etoolbox}
52
53 \newboolean{nocolor@pdfswitch}
54 \setboolean{nocolor@pdfswitch}{false}
55 \DeclareOption{nocolor}{\setboolean{nocolor@pdfswitch}{true}}
56 \newboolean{backref@pdfswitch}
57 \setboolean{backref@pdfswitch}{false}
58 \DeclareOption{backref}{\setboolean{backref@pdfswitch}{true}}
59 \newboolean{pagebackref@pdfswitch}
60 \setboolean{pagebackref@pdfswitch}{false}
61 \DeclareOption{pagebackref}{\setboolean{pagebackref@pdfswitch}{true}}
62 \newboolean{noborder@pdfswitch}
63 \setboolean{noborder@pdfswitch}{false}
64 \DeclareOption{noborder}{\setboolean{noborder@pdfswitch}{true}}
65 \newboolean{plainpages@pdfswitch}
66 \setboolean{plainpages@pdfswitch}{false}
67 \DeclareOption{plainpages}{\setboolean{plainpages@pdfswitch}{true}}
68
69 \ProcessOptions
70
71 %%%%%%%%%%%%%%%%%%%%%%%%% graphicx and thumbpdf %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72 \AtEndPreamble{%
73 \RequirePackage{hyperref}%
74 \@ifundefined{colorbox}{%
75 \IfFileExists{xcolor.sty}{\RequirePackage{xcolor}}%
76 {\RequirePackage{color}}%
77 }{}%
78 \definecolor{pdfurlcolor}{rgb}{0,0,0.6}%
79 \definecolor{pdfcitecolor}{rgb}{0,0.6,0}%
80 \definecolor{pdflinkcolor}{rgb}{0.6,0,0}%
81 %
82 \RequirePackage{graphicx}%
83 }%
84 \ifpdf
85 \PassOptionsToPackage{pdftex}{graphicx} %%% graphics for pdfLaTeX
86 \PassOptionsToPackage{pdftex}{color}
87 \PassOptionsToPackage{pdftex}{thumbpdf} %%% thumbnails for pdflatex
88 \AtEndPreamble{%
89 \DeclareGraphicsExtensions{.pdf} %%% standard extension for included graphics
90 \RequirePackage{thumbpdf}%
91 }%
92 \else
93 \PassOptionsToPackage{dvips}{graphicx} %%% graphics for dvips
94 \AtEndPreamble{%
95 \DeclareGraphicsExtensions{.eps} %%% standard extension for included graphics
96 }%
97 \fi
98
99 %%%%%%%%%%%%%%%%%%%%%%%%% Basic options for hyperref %%%%%%%%%%%%%%%%%%%%%%%%%
100 \ifpdf
101 \edef\keys@pdfswitch{%
102 pdftex, %%% hyper-references for pdflatex
103 bookmarks=true,% %%% generate bookmarks ...
104 bookmarksnumbered=true,% %%% ... with numbers
105 hypertexnames=false,% %%% needed for correct links to figures !!!
106 breaklinks=true% %%% break links if exceeding a single line
107 }
108 \else
109 \edef\keys@pdfswitch{%
110 ps2pdf, %%% hyper-references for ps2pdf
111 bookmarks=true,% %%% generate bookmarks ...
112 bookmarksnumbered=true,% %%% ... with numbers
113 hypertexnames=false,% %%% needed for correct links to figures !!!
114 breaklinks=true,% %%% breaks lines, but links are very small
115 pdfborder={0 0 11.0} %%% border-width of frames will
116 %%% be multiplied with 0.009 by ps2pdf
117 }
118 \fi
119
120 \ifthenelse{\boolean{nocolor@pdfswitch}}{%
121 \edef\keys@pdfswitch{\keys@pdfswitch,colorlinks=false}%
122 }{
123 \edef\keys@pdfswitch{\keys@pdfswitch,colorlinks=true,%
124 citecolor=pdfcitecolor,
125 urlcolor=pdfurlcolor,
126 linkcolor=pdflinkcolor,
127 linkbordercolor={1 1 1}}%
128 }
129
130 \ifthenelse{\boolean{plainpages@pdfswitch}}{%
131 }{
132 \edef\keys@pdfswitch{\keys@pdfswitch,plainpages=false}%
133 }
134
135 \ifthenelse{\boolean{noborder@pdfswitch}}{%
136 \edef\keys@pdfswitch{\keys@pdfswitch,pdfborder={0 0 0}}%
137 }{}
138
139 \ifthenelse{\boolean{backref@pdfswitch}}{%
140 \edef\keys@pdfswitch{\keys@pdfswitch,backref}%
141 }{}
142
143 \ifthenelse{\boolean{pagebackref@pdfswitch}}{%
144 \edef\keys@pdfswitch{\keys@pdfswitch,pagebackref}%
145 }{}
146
147 \PassOptionsToPackage{\keys@pdfswitch}{hyperref}%
148
149 %%%%%%%%%%%%%%%%%%%%%%%%% HyperSetup %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
150 \AtBeginDocument{
151 \ifpdf
152 \hypersetup{
153 pdfauthor = {\@author},
154 pdftitle = {\@title},
155 pdfsubject = {\@ifundefined{@subject}{}{\@subject}},
156 pdfkeywords = {\@ifundefined{@keywords}{}{\@keywords}},
157 }
158 %%% pdfcreator, pdfproducer, and Creation Date are automatically set by pdflatex !!!
159 \pdfadjustspacing=1 %%% force LaTeX-like character spacing
160 \else%
161 \fi%
162 }
163 \endinput
164 %%
165 %% End of file `pdfswitch.sty'.