source:
NEMO/trunk/doc/PDF_creation.sh
@
10865
Last change on this file since 10865 was 10790, checked in by nicolasmartin, 5 years ago | |
---|---|
|
|
File size: 1.1 KB |
Rev | Line | |
---|---|---|
[9407] | 1 | #!/bin/sh |
2 | ||
[10790] | 3 | export opts='-shell-escape -pdf -quiet' |
[10146] | 4 | model='NEMO' |
[9407] | 5 | |
[10474] | 6 | check_python_module() { |
7 | python -c " | |
8 | import sys | |
9 | try: | |
10 | import $1 | |
11 | print('\nModule $1 is installed') | |
12 | except ImportError: | |
13 | print('\nModule $1 is NOT installed') | |
14 | print('') | |
15 | sys.exit(42)" | |
16 | } | |
17 | ||
[10146] | 18 | clean() { |
19 | ## Delete latex build files | |
[10405] | 20 | find latex -regextype posix-extended \ |
21 | -regex ".*\.(aux|bbl|blg|dvi|fdb|fls|idx|ilg|ind|log|maf|mtc|out|pdf|toc).*" \ | |
22 | -exec rm {} \; | |
[10146] | 23 | |
24 | ## Remove 'minted' directories | |
25 | find latex -type d -name '_minted*' -exec rm -r {} \; | |
26 | ||
27 | ## HTML exports | |
28 | find latex -type d -name 'html*' -exec rm -r {} \; | |
29 | } | |
30 | ||
31 | build() { | |
32 | cd latex/$1/main | |
[10405] | 33 | latexmk $opts $1'_manual' > /dev/null |
34 | mv $1'_manual'.pdf ../../.. | |
[10146] | 35 | cd - |
36 | } | |
37 | ||
[10474] | 38 | check_python_module pygments |
39 | if [ $? -ne 0 ]; then echo 'Required python module pygments to correctly build the documentation is missing; exit 42'; echo ''; exit 42; fi | |
40 | ||
[10146] | 41 | clean |
[10474] | 42 | |
[10610] | 43 | [ ! -d figures ] && svn co http://forge.ipsl.jussieu.fr/nemo/svn/utils/figures |
44 | ||
[10405] | 45 | build $model |
[10146] | 46 | |
[9407] | 47 | exit 0 |
Note: See TracBrowser
for help on using the repository browser.