summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/confproc/example/buildpapers
blob: 9c38da808b5dc4d3fb0692c3be3fc1c8141d9ecd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh

# Compile all papers with 'pdflatex' of 'latex'
#   (depending if they are in 'sources_pdftex' or 'sources_tex')
# and copy resulting pdf files in the 'papers' folder.
# Expected tree structure:
#     proceedings/papers/sources_pdftex/
#     proceedings/papers/sources_tex/
# with this script in 'proceedings/'

#--- choose if you compile from scratch or only once
#BUILD_TYPE=final      #recompile and re-do biblio
BUILD_TYPE=renumber   #recompile only once for re-numbering

#--- set system dependent variables
#LATEXPATH="/usr/local/teTeX/bin/i386-apple-darwin-current/" # teTeX
LATEXPATH="/usr/texbin/" # TexLive 2007

#--- paths
LATEX=$LATEXPATH"latex"
DVIPDF=/usr/local/bin/dvipdf
PDFLATEX=$LATEXPATH"pdflatex"
BIBTEX=$LATEXPATH"bibtex"
MAKEINDEX=$LATEXPATH"makeindex"
PROCSTY='dafx_06.sty'

#--- Compiling .tex files with pdfLaTeX
cd papers/sources_pdftex
for i in *; do
  echo; echo; echo '=====> Compiling' $i '.tex  with pdfLaTeX <====='
  cd $i
  # copy the paper style (in case you changed it)
  cp ../../$PROCSTY .
  echo; echo '   ---> 1st compilation of ' $i '.tex'
  $PDFLATEX $i
  if [ $BUILD_TYPE = final ]; then
    echo; echo '   ---> Compiling the bibliography ' $i '.tex'
    $BIBTEX $i
    echo; echo '   --- 2nd compilation of ' $i '.tex'
    $PDFLATEX $i
    echo; echo '   ---> 3rd compilation of ' $i '.tex'
    $PDFLATEX $i
  fi
  #--- copy the pdf where the proceedings will be assembled
  cp $i.pdf ../..
  cd ..
done
#--- Compiling .tex files with LaTeX (problems related with hyperref)
cd ../sources_tex
for i in *; do
  echo; echo; echo '=====> Compiling' $i '.tex  with LaTeX <====='
  cd $i
  #--- copy the paper proceedings style (if you changed the tree)
  cp ../../$PROCSTY .
  echo; echo '   ---> 1st compilation of ' $i '.tex '
  $LATEX $i.tex
  if [ $BUILD_TYPE = final ]; then
    echo; echo '   ---> Compiling the bibliography ' $i '.tex '
    $BIBTEX $i
    echo; echo '   ---> 2nd compilation of ' $i '.tex '
    $LATEX $i
    echo; echo '   ---> 3rd compilation of ' $i '.tex '
    $LATEX $i
  fi
  #--- produce the pdf from dvi
  $DVIPDF $i.dvi $i.pdf
  #--- copy the pdf where the proceedings will be assembled
  cp $i.pdf ../..
  cd ..
done