5 # Copyright The SCons Foundation
7 # Permission is hereby granted, free of charge, to any person obtaining
8 # a copy of this software and associated documentation files (the
9 # "Software"), to deal in the Software without restriction, including
10 # without limitation the rights to use, copy, modify, merge, publish,
11 # distribute, sublicense, and/or sell copies of the Software, and to
12 # permit persons to whom the Software is furnished to do so, subject to
13 # the following conditions:
15 # The above copyright notice and this permission notice shall be included
16 # in all copies or substantial portions of the Software.
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 Test creation of a fully-featured TeX document (with bibliography
28 and index) in a variant_dir.
30 Test courtesy Rob Managan.
35 test
= TestSCons
.TestSCons()
37 latex
= test
.where_is('latex')
39 test
.skip_test("Could not find 'latex'; skipping test.\n")
41 epstopdf
= test
.where_is('epstopdf')
43 test
.skip_test("Could not find 'epstopdf'; skipping test.\n")
45 makeindex
= test
.where_is('makeindex')
47 test
.skip_test("Could not find 'makeindex'; skipping test.\n")
52 test
.write(['SConstruct'], """\
58 test = env.PDF(source='test.tex')
62 test
.write(['Fig1.ps'], """\
63 %!PS-Adobe-2.0 EPSF-2.0
65 %%Creator: fig2dev Version 3.2 Patchlevel 4
66 %%CreationDate: Tue Apr 25 09:56:11 2006
67 %%For: managan@mangrove.llnl.gov (Rob Managan)
68 %%BoundingBox: 0 0 98 98
69 %%Magnification: 1.0000
71 /$F2psDict 200 dict def
73 $F2psDict /mtrx matrix put
74 /col-1 {0 setgray} bind def
75 /col0 {0.000 0.000 0.000 srgb} bind def
79 newpath 0 98 moveto 0 0 lineto 98 0 lineto 98 98 lineto closepath clip newpath
83 /cp {closepath} bind def
85 /gr {grestore} bind def
87 /rs {restore} bind def
90 /rm {rmoveto} bind def
93 /slc {setlinecap} bind def
94 /slj {setlinejoin} bind def
95 /slw {setlinewidth} bind def
96 /srgb {setrgbcolor} bind def
98 /sf {setfont} bind def
99 /scf {scalefont} bind def
100 /tr {translate} bind def
108 /savematrix mtrx currentmatrix def
109 x y tr xrad yrad sc 0 0 1 startangle endangle arc
114 /$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
115 /$F2psEnd {$F2psEnteredState restore end} def
125 n 1170 945 766 766 0 360 DrawEllipse gs col0 s gr
132 test
.write(['Fig1.tex'],
133 r
"""\begin{picture}(0,0)%
134 \includegraphics{Fig1}%
136 \setlength{\unitlength}{4144sp}%
138 \begingroup\makeatletter\ifx\SetFigFont\undefined%
139 \gdef\SetFigFont#1#2#3#4#5{%
140 \reset@font\fontsize{#1}{#2pt}%
141 \fontfamily{#3}\fontseries{#4}\fontshape{#5}%
144 \begin{picture}(1548,1546)(397,-879)
145 \put(856,-196){\makebox(0,0)[lb]{\smash{\SetFigFont{12}{14.4}{\rmdefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}center $r_0$}%
151 test
.write(['test.tex'],
152 r
"""\documentclass{report}
154 \usepackage{graphicx}
155 \usepackage{epsfig,color} % for .tex version of figures if we go that way
164 \author{A. N. Author}
175 \chapter{Introduction}
177 The introduction is short.
179 \index{Acknowledgements}
181 \section{Acknowledgements}
183 The Acknowledgements are shown as well.
185 \index{Getting the Report}
192 test
.write(['getReport.tex'],
194 To get a hard copy of this report call me.
198 \input{Fig1.tex} % testing figure variant that uses TeX labeling
199 \caption{Zone and Node indexing}
206 %\bibliographystyle{unsrt}
213 # makeindex will write status messages to stderr (grrr...), so ignore it.
214 test
.run(arguments
= '.', stderr
=None)
217 # All (?) the files we expect will get created in the variant_dir
218 # (mybuild/docs) and not in the srcdir (docs).
232 test
.must_exist([ f
])
239 # indent-tabs-mode:nil
241 # vim: set expandtab tabstop=4 shiftwidth=4: