13 |
|
|
14 |
import os |
import os |
15 |
Import('*') |
Import('*') |
16 |
local_env = env.Clone() |
local_env = env.Clone(tools=['pdflatex']) |
17 |
|
|
18 |
latexmode='-interaction=nonstopmode' |
tex_src = Glob('*.tex')+Glob('*.bib')+Glob('*.sty')+Glob('*.cfg')+Glob('*.cls') |
19 |
|
fig_src = Glob('figures/*.eps') |
20 |
|
|
21 |
tex_dir = local_env.Dir('.').srcnode().abspath |
# Convert eps figures to pdf |
22 |
dir_cmd = "cd "+tex_dir+" && " |
figures=local_env.EpsToPDF(source=fig_src) |
23 |
|
|
24 |
tex = [ env.File(x) for x in os.listdir(tex_dir) if not x.startswith('.') and not os.path.isdir(tex_dir+os.path.sep+x) and os.path.splitext(x)[1] in ['.tex', '.bib', '.sty', '.cfg', '.cls'] ] + \ |
if local_env['verbose']: |
25 |
[ env.File('figures'+os.path.sep+x) for x in os.listdir(tex_dir+os.path.sep+'figures') if not x.startswith('.') ] |
interaction='-interaction=nonstopmode' |
26 |
|
else: |
27 |
# We would like any figures in .eps to be converted into .pdf |
interaction='-interaction=batchmode' |
28 |
#epsfigs=[ env.File('figures'+os.path.sep+x) for x in os.listdir(tex_dir+os.path.sep+'figures') if not x.startswith('.') and x.endswith('.eps') ] |
|
29 |
|
# Define command to include SVN revision |
30 |
epsfigs=[ os.path.join(tex_dir,'figures',x) for x in os.listdir(tex_dir+os.path.sep+'figures') if not x.startswith('.') and x.endswith('.eps') ] |
local_env.Append(PDFLATEXFLAGS=[interaction,'\\\\newcommand{\\\\RepVersion}{%s\\\\xspace}\\\\input{guide.tex}'%(local_env['svn_revision'])]) |
31 |
|
pdf=local_env.PDF(target='guide.pdf', source='guide.tex') |
32 |
#figs=[ os.path.join('figures',os.path.splitext(x)[0]+'.pdf') for x in os.listdir(tex_dir+os.path.sep+'figures') if not x.startswith('.') and os.path.splitext(x)[1] in ['.eps']] |
Depends(pdf, figures+tex_src) |
33 |
|
|
34 |
figtarget=local_env.EpsToPDF(source=epsfigs,chdir=tex_dir) |
pdf_inst=local_env.InstallAs(target=env['prefix']+'/release/doc/user/guide.pdf', source=pdf) |
35 |
|
|
36 |
latexcmd=dir_cmd+"pdflatex %s \\\\newcommand{\\\\RepVersion}{`svnversion`\\\\xspace}\\\\input{guide.tex}"%latexmode |
env.Alias('guide_pdf', pdf_inst) |
37 |
|
|
38 |
local_env.Command(env['prefix']+'/doc/user/guide.pdf',[tex, figtarget], \ |
html_dir=os.path.join(env['prefix'],'release','doc','user','html') |
39 |
[ latexcmd, \ |
|
40 |
dir_cmd+"bibtex guide", \ |
html=local_env.Command(Dir(html_dir), tex_src+figures, |
41 |
dir_cmd+"makeindex guide", \ |
["cd %s && latex2html -top_navigation \ |
42 |
latexcmd, \ |
-bottom_navigation \ |
43 |
latexcmd] \ |
-index_in_navigation \ |
44 |
) |
-contents_in_navigation \ |
45 |
|
-next_page_in_navigation \ |
46 |
tmp=local_env.InstallAs(target=env['prefix']+'/release/doc/user/guide.pdf', source=env['prefix']+'/doc/user/guide.pdf') |
-previous_page_in_navigation \ |
47 |
|
-title \"esys users guide\" \ |
48 |
env.Alias('guide_pdf', tmp) |
-noshow_section_numbers \ |
49 |
|
-dir %s -mkdir \ |
50 |
#env.Alias('guide_pdf', env['prefix']+'/release/doc/user/guide.pdf') |
-address \"esys@esscc.uq.edu.au\" \ |
51 |
#env.Alias('guide_pdf', tmp) |
-antialias_text -antialias -transparent \ |
52 |
|
-noshort_extn \ |
53 |
#env.Command(env['prefix']+'/release/doc/user/guide.pdf',tex, |
-up_url \"https://launchpad.net/escript-finley\" \ |
54 |
#[ mytest(), "latex %s guide.tex"%latexmode, \ |
-up_title \"escript\" guide.tex"%(Dir('.').abspath, html_dir)]) |
55 |
#"bibtex guide", \ |
|
56 |
#"makeindex guide", \ |
env.Alias('guide_html', html) |
|
#"latex %s guide"%latexmode, \ |
|
|
#"latex %s guide"%latexmode, \ |
|
|
#"dvipdf guide.dvi %s"%env['prefix']+'/release/doc/user/guide.pdf' ], |
|
|
#chdir=tex_dir) |
|
|
#env.Alias('guide_pdf', env['prefix']+'/release/doc/user/guide.pdf') |
|
|
|
|
|
local_env.Command(env['prefix']+'/release/doc/user/html/index.htm', tex, \ |
|
|
[dir_cmd+"latex2html -top_navigation \ |
|
|
-bottom_navigation \ |
|
|
-index_in_navigation \ |
|
|
-contents_in_navigation \ |
|
|
-next_page_in_navigation \ |
|
|
-previous_page_in_navigation \ |
|
|
-title \"esys users guide\" \ |
|
|
-noshow_section_numbers \ |
|
|
-dir \"../../release/doc/user/html\" -mkdir \ |
|
|
-address \"esys@esscc.uq.edu.au\" \ |
|
|
-antialias_text -antialias -transparent \ |
|
|
-noshort_extn \ |
|
|
-up_url \"https://launchpad.net/escript-finley\", \ |
|
|
-up_title \"escript\" guide.tex"]) |
|
|
env.Alias('guide_html', env['prefix']+'/release/doc/user/html/index.htm') |
|
57 |
|
|