Debian Codegraph @

texmf-dist/doc/latex/pdfreview/pdfreview.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 # this assumes ghostscript is installed as 'gs - change as needed
4 ghostscript="gs"
5
6 script_name=`basenamescip-shell system . . basename. "$0"`
7
8 if [scip-shell system . . `[`. -z "$1" ]; then
9 echoscip-shell system . . echo. "Usage: $script_name inputfile.pdf > outputfile.tex"
10 exit 1
11 fi
12
13 if [scip-shell system . . `[`. ! -f "$1" ]; then
14 echoscip-shell system . . echo. "File $1 not found"
15 exit 1
16 fi
17
18 source_doc="$1"
19
20 # doc_header will become the preamble of your generated wrapper document
21 # edit it according it your own preferences.
22
23 doc_header="\documentclass[letterpaper,10pt]{article}
24
25 \usepackage{mathptmx}
26
27 \usepackage[
28 sourcedoc={$source_doc},
29 inline=true,
30 grid=true,
31 gridcolor=black!30,
32 trim={2cm 1cm 2cm 1cm},
33 bodywidth=0.75,
34 pageoffset=0,
35 fontsize=footnotesize,
36 twocolumn=false,
37 notesbg=yellow,
38 notesframe=black,
39 insertpagemargin=2.5cm,
40 withnotesonly=false,
41 staggered=true
42 ]{pdfreview}
43
44 \begin{document}
45 "
46
47 echoscip-shell system . . echo. "$doc_header"
48
49 # use ghostscript to obtain the page count from the pdf file
50 page_count=$($ghostscript -q -dNODISPLAY -c "($source_doc) (r) file runpdfbegin pdfpagecount = quit")
51
52 # write page environment for each of the pages
53 for (( i=1; i<=$page_count; i++ ))
54 do
55 echo "\begin{page}{$i}"
56 echo "\end{page}"
57 echo ""
58 done
59
60 echoscip-shell system . . echo. "\end{document}"