Debian Codegraph @

texmf-dist/tex/latex/gincltex/gincltex.sty

raw
1 %%
2 %% This is file `gincltex.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% gincltex.dtx (with options: `package')
8 %%
9 %% Copyright (C) 2011 by Martin Scharrer <[email protected]>
10 %%
11 %% This work may be distributed and/or modified under the
12 %% conditions of the LaTeX Project Public License, either version 1.3c
13 %% of this license or (at your option) any later version.
14 %% The latest version of this license is in
15 %%
16 %% http://www.latex-project.org/lppl.txt
17 %%
18 %% and version 1.3c or later is part of all distributions of LaTeX
19 %% version 2008/05/04 or later.
20 %%
21 %% This work has the LPPL maintenance status `maintained'.
22 %%
23 %% The Current Maintainer of this work is Martin Scharrer.
24 %%
25 %% This work consists of the files gincltex.dtx, gincltex.ins
26 %% and the derived file gincltex.sty.
27 %%
28 \RequirePackage{svn-prov}
29 \ProvidesPackage{gincltex}
30 [2011/09/04 v0.3 Include external LaTeX files like graphics]
31 \newif\if@gincltex@bbfile
32 \DeclareOption{bb=file}{\@gincltex@bbfiletrue}
33 \DeclareOption{bb=aux}{\@gincltex@bbfilefalse}
34 \DeclareOption{draft}{\PassOptionsToPackage{draft}{graphicx}}
35 \DeclareOption{draft=true}{\PassOptionsToPackage{draft}{graphix}}
36 \DeclareOption{draft=false}{\PassOptionsToPackage{final}{graphicx}}
37 \DeclareOption{final}{\PassOptionsToPackage{final}{graphicx}}
38 \DeclareOption{final=true}{\PassOptionsToPackage{final}{graphicx}}
39 \DeclareOption{final=false}{\PassOptionsToPackage{draft}{graphicx}}
40 \DeclareOption*{\PassOptionsToPackage\CurrentOption{adjustbox}}
41 \ProcessOptions*\relax
42 \RequirePackage{adjustbox}
43 \DeclareGraphicsRule{.tex}{tex}{.tex}{}
44 \newsavebox\gincltex@box
45 \def\gincltex@boxfile#1{%
46 \sbox\gincltex@box{{%
47 \hbox{\vbox{%
48 \hbox{%
49 \edef\@tempa{{#1}}%
50 \let\Gin@ext\relax
51 \expandafter\input\@tempa
52 }%
53 \vskip\z@
54 }}%
55 }}%
56 }
57 \def\Ginclude@tex#1{%
58 \begingroup
59 \ifvoid\gincltex@box
60 \gincltex@boxfile{#1}%
61 \fi
62 \resizebox*{\Gin@req@width}{\Gin@req@height}{%
63 \ifGin@clip\expandafter\clipbox\else\expandafter\clipbox\fi*{{\Gin@llx} {\Gin@lly} {\Gin@urx} {\Gin@ury}}{\usebox\gincltex@box}%
64 }%
65 \endgroup
66 }
67 \if@gincltex@bbfile
68 \@ifundefined{gincltex@bbout}{\newwrite\gincltex@bbout}{}
69 \def\gincltex@bb#1#2#3#4#5{}
70 \AtBeginDocument{\let\gincltex@bb\gincltex@@bb}
71 \def\gincltex@@bb#1#2#3#4#5{%
72 \begingroup
73 \immediate\openout\gincltex@bbout=#1.bb\relax
74 \immediate\write\gincltex@bbout{\@percentchar
75 \@percentchar HiResBoundingBox: #2 #3 #4 #5}%
76 \immediate\closeout\gincltex@bbout
77 \endgroup
78 }
79 \else
80 \def\Gread@tex@setbb#1#2#3#4{%
81 \def\Gin@llx{#1}%
82 \def\Gin@lly{#2}%
83 \def\Gin@urx{#3}%
84 \def\Gin@ury{#4}%
85 }
86 \def\Gread@tex#1{%
87 \ifcase0\ifGin@draft\@ifundefined{gincltex@bb@#1}{0}{1}\fi\relax
88 \gincltex@boxfile{#1}%
89 \def\Gin@llx{0}%
90 \let\Gin@llx\Gin@lly
91 \Gin@defaultbp\Gin@urx{\wd\gincltex@box}%
92 \Gin@defaultbp\Gin@ury{\ht\gincltex@box}%
93 \expandafter\xdef\csname gincltex@bb@#1\endcsname
94 {{\Gin@llx}{\Gin@lly}{\Gin@urx}{\Gin@ury}}%
95 \else
96 \expandafter\expandafter\expandafter\Gread@tex@setbb
97 \csname gincltex@bb@#1\endcsname
98 \setbox\gincltex@box=\box\voidb@x
99 \fi
100 \if@filesw
101 \immediate\write\@auxout{\string\gincltex@bb{#1}%
102 \csname gincltex@bb@#1\endcsname}%
103 \fi
104 }
105 \def\gincltex@bb#1#2#3#4#5{%
106 \global\@namedef{gincltex@bb@#1}{{#2}{#3}{#4}{#5}}%
107 }
108 \fi
109 \endinput
110 %%
111 %% End of file `gincltex.sty'.