Initial version 0.1
[pytex.git] / pytex.ins
1 %%
2 %% Copyright (C) 2010 W. Trevor King
3 %%
4 %% This file may be distributed and/or modified under the conditions of
5 %% the LaTeX Project Public License, either version 1.3 of this license
6 %% or (at your option) any later version.  The latest version of this
7 %% license is in:
8 %% 
9 %%    http://www.latex-project.org/lppl.txt
10 %% 
11 %% and version 1.3 or later is part of all distributions of LaTeX version
12 %% 2003/12/01 or later.
13 %%
14 %% Based on Scott Pakin's dtxtut/cskeleton.ins
15 %%   http://www.ctan.org/tex-archive/info/dtxtut/
16 %%
17
18 \input docstrip.tex
19
20 \keepsilent
21 \askforoverwritefalse
22
23 \usedir{tex/latex/pytex}
24
25 \def\mypreamble{^^J%
26 \MetaPrefix\space This is a generated file.^^J%
27 \MetaPrefix ^^J%
28 \MetaPrefix\space Copyright (C) 2010 W. Trevor King^^J%
29 \MetaPrefix ^^J%
30 \MetaPrefix\space This file may be distributed and/or modified under the conditions of^^J%
31 \MetaPrefix\space the LaTeX Project Public License, either version 1.3 of this license^^J%
32 \MetaPrefix\space or (at your option) any later version.  The latest version of this^^J%
33 \MetaPrefix\space license is in:^^J%
34 \MetaPrefix ^^J%
35 \MetaPrefix\space\space\space\space\space http://www.latex-project.org/lppl.txt^^J%
36 \MetaPrefix ^^J%
37 \MetaPrefix\space and version 1.3 or later is part of all distributions of LaTeX version^^J%
38 \MetaPrefix\space 2003/06/01 or later.^^J%
39 \MetaPrefix ^^J%
40 }
41
42 %%%%%%%%%%%%%%%
43 % LaTeX files %
44 %%%%%%%%%%%%%%%
45
46 \preamble
47 \mypreamble
48 \endpreamble
49
50 \generate{\file{pytex.sty}{\from{pytex.dtx}{package}}
51           \file{example.tex}{\from{pytex.dtx}{example}}}
52
53 %%%%%%%%%%%%%%%%
54 % Python files %
55 %%%%%%%%%%%%%%%%
56
57 % Switch to using the # character for comments
58 \catcode`\#=11
59 \edef\MetaPrefix{#}
60 \catcode`\#=6
61
62 % Refresh the pre/post-ambles with the new \MetaPrefix.
63 \preamble
64 \mypreamble
65 \endpreamble
66 \postamble
67 \endpostamble
68 % From the docstrip manual:
69 %  You can change the prefix used for putting meta comments to output
70 %  files by redefining \MetaPrefix. Its default value
71 %  is \DoubleperCent. The preamble uses value of \MetaPrefix current
72 %  at time of \declarepreamble while meta comments in the source file
73 %  use value current at time of \generate. Note that this means that
74 %  you cannot produce concurrently two files using
75 %  different \MetaPrefixes.
76 % I don't know why docstrip.dtx/.tex uses \edef rather than \def
77 % for \org@preamble and \org@postamble, but it does.
78
79 \generate{\file{pytex.py}{\from{pytex.dtx}{module}}}
80
81 %%%%%%%%%%%%%%%
82 % Conclusions %
83 %%%%%%%%%%%%%%%
84
85 \obeyspaces
86 \Msg{*************************************************************}
87 \Msg{*                                                           *}
88 \Msg{* To finish the installation you have to move the following *}
89 \Msg{* file into a directory searched by TeX:                    *}
90 \Msg{*                                                           *}
91 \Msg{*     pytex.sty                                             *}
92 \Msg{*                                                           *}
93 \Msg{* To produce the documentation run the file pytex.dtx       *}
94 \Msg{* through LaTeX.                                            *}
95 \Msg{*                                                           *}
96 \Msg{* Happy TeXing!                                             *}
97 \Msg{*                                                           *}
98 \Msg{*************************************************************}
99
100 \endbatchfile