Debian Codegraph @

texmf-dist/doc/latex/confproc/example/countnbpages.sh

raw
1 #!/bin/sh
2
3 #-- set path to LaTeX binaries
4 LATEXPATH="/usr/texbin/" # TeXLive
5 #-- set names of LaTeX and related compilers
6 PDFLATEX=$LATEXPATH"pdflatex"
7
8 TEXFILE="simple_proceedings" #- set document's name
9 PDFSPATH="papers" #- set the papers' folder name
10
11 rm -f ${TEXFILE}.npt # count pages from terminal
12 cd ${PDFSPATH}
13 for file in *.pdf
14 do
15 pdfinfo -meta $file | grep "Pages:" > tmp0
16 echo "file $file has `sed 's/.*\([0-9]\).*/\1/' < tmp0` pages" >> ../${TEXFILE}.npt
17 done
18 rm -f tmp0
19 cd ..
20 more ${TEXFILE}.npt