Debian Codegraph @

texmf-dist/doc/latex/confproc/buildpapers.sh

raw
1 #!/bin/sh
2
3 # Compile all papers with 'pdflatex' of 'latex'
4 # (depending if they are in 'sources_pdftex' or 'sources_tex')
5 # and copy resulting pdf files in the 'papers' folder.
6 # Expected tree structure:
7 # proceedings/papers/sources_pdftex/
8 # proceedings/papers/sources_tex/
9 # with this script in 'proceedings/'
10
11 #--- choose if you compile from scratch or only once
12 #BUILD_TYPE=final #recompile and re-do biblio
13 BUILD_TYPE=renumber #recompile only once for re-numbering
14
15 #--- set system dependent variables
16 LATEXPATH="/usr/texbin/" # TeXLive
17
18 #--- paths
19 LATEX=$LATEXPATH"latex"
20 DVIPDF=/usr/local/bin/dvipdf
21 PDFLATEX=$LATEXPATH"pdflatex"
22 BIBTEX=$LATEXPATH"bibtex"
23 MAKEINDEX=$LATEXPATH"makeindex"
24 PROCSTY='dafx_06.sty'
25
26 #--- Compiling .tex files with pdfLaTeX
27 cd papers/sources_pdftex
28 for i in *; do
29 echo; echo; echo '=====> Compiling' $i '.tex with pdfLaTeX <====='
30 cd $i
31 # copy the paper style (in case you changed it)
32 cp ../../$PROCSTY .
33 echo; echo ' ---> 1st compilation of ' $i '.tex'
34 $PDFLATEX $i
35 if [ $BUILD_TYPE = final ]; then
36 echo; echo ' ---> Compiling the bibliography ' $i '.tex'
37 $BIBTEX $i
38 echo; echo ' --- 2nd compilation of ' $i '.tex'
39 $PDFLATEX $i
40 echo; echo ' ---> 3rd compilation of ' $i '.tex'
41 $PDFLATEX $i
42 fi
43 #--- copy the pdf where the proceedings will be assembled
44 cp $i.pdf ../..
45 cd ..
46 done
47 #--- Compiling .tex files with LaTeX (problems related with hyperref)
48 cd ../sources_tex
49 for i in *; do
50 echo; echo; echo '=====> Compiling' $i '.tex with LaTeX <====='
51 cd $i
52 #--- copy the paper proceedings style (if you changed the tree)
53 cp ../../$PROCSTY .
54 echo; echo ' ---> 1st compilation of ' $i '.tex '
55 $LATEX $i.tex
56 if [ $BUILD_TYPE = final ]; then
57 echo; echo ' ---> Compiling the bibliography ' $i '.tex '
58 $BIBTEX $i
59 echo; echo ' ---> 2nd compilation of ' $i '.tex '
60 $LATEX $i
61 echo; echo ' ---> 3rd compilation of ' $i '.tex '
62 $LATEX $i
63 fi
64 #--- produce the pdf from dvi
65 $DVIPDF $i.dvi $i.pdf
66 #--- copy the pdf where the proceedings will be assembled
67 cp $i.pdf ../..
68 cd ..
69 done