File: sphinx-build-pdf-wrapper

package info (click to toggle)
dynare 7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 79,248 kB
  • sloc: cpp: 82,011; ansic: 28,583; objc: 12,573; yacc: 5,105; pascal: 2,374; lex: 1,502; python: 1,118; sh: 1,116; makefile: 605; lisp: 162; xml: 18
file content (27 lines) | stat: -rwxr-xr-x 674 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

set -e

if (($# < 4 )); then
    echo "Usage: $0 sphinx_build_exe source_dir pdf_output private_dir [extra_sphinx_options]" 2>&1
    exit 1
fi

sphinx_build_exe=$1
source_dir=$2
pdf_output=$3
private_dir=$4
shift 4

# NB: Ideally we would have called “sphinx-build -M latexpdf” (to combine the
# LaTeX creation and the PDF creation into a single step) but this breaks when
# -D options are passed, presumably due to a bug in sphinx-build.
# See: https://bugs.debian.org/933347

"$sphinx_build_exe" -n -b latex "$@" "$source_dir" "$private_dir"

make -C "$private_dir" all-pdf

pdf_basename=${pdf_output##*/}

mv "$private_dir"/"$pdf_basename" "$pdf_output"