File: sphinx-build-pdf-wrapper

package info (click to toggle)
dynare 6.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 67,796 kB
  • sloc: cpp: 79,110; ansic: 28,917; objc: 12,445; yacc: 4,537; pascal: 1,993; lex: 1,441; sh: 1,132; python: 634; makefile: 628; lisp: 163; xml: 18
file content (27 lines) | stat: -rwxr-xr-x 674 bytes parent folder | download
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"