-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.sh
More file actions
executable file
·79 lines (53 loc) · 2.26 KB
/
Copy pathmain.sh
File metadata and controls
executable file
·79 lines (53 loc) · 2.26 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# Find directory where this script resides;
# assumed to contain the python scripts we'll run below
SCRIPT_DIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
# Pass the files to process to AI-generated python code to apply corrections...
module load scitools
echo "Restoring aligned equation labels."
python $SCRIPT_DIR/restore_eqnarray_labels.py $1
echo "Fixing aligned equation regions."
python $SCRIPT_DIR/split_aligned_equations.py $1
echo "Fixing tables"
python $SCRIPT_DIR/convert_tables.py $1
echo "Fixing figures"
python $SCRIPT_DIR/fix_figures_from_latex.py $1
echo "Fixing bibliography"
python $SCRIPT_DIR/fix_bibliography.py $1 refs.bib
echo "Fixing equation cross-referencing."
python $SCRIPT_DIR/fix_eq_refs.py $1
echo "Fixing figure cross-referencing."
python $SCRIPT_DIR/fix_figure_refs.py $1
echo "Fixing table cross-referencing."
python $SCRIPT_DIR/fix_table_refs.py $1
echo "Fixing section cross-referencing."
python $SCRIPT_DIR/fix_section_refs.py $1
echo "Fixing UMDP cross-reference placeholders."
python $SCRIPT_DIR/fix_umdp_refs.py $1
echo "Fixing spurious double-spaces after bullet points"
python $SCRIPT_DIR/fix_dashes.py $1
echo "Fixing latex directives not supported in mathjax"
python $SCRIPT_DIR/fix_mathjax_compat.py $1
echo "Fixing spurious nested math blocks"
python $SCRIPT_DIR/fix_subequations_blocks.py $1
echo "Fixing spurious indents in multiline inline math."
python $SCRIPT_DIR/fix_multiline_inline_math.py $1
echo "Fixing inline math inside bold or italic regions."
python $SCRIPT_DIR/fix_math_in_emphasis.py $1
echo "Fixing footnotes."
python $SCRIPT_DIR/fix_pandoc_footnotes.py $1
echo "Fixing author affiliations notes."
python $SCRIPT_DIR/reinstate_author_affiliations.py $1
echo "Converting non-ASCII characters."
# sed -i 's/\xC2\xA0/ /g' $1
iconv -f UTF-8 -t ASCII//TRANSLIT $1 > tmp.rst
mv tmp.rst $1
echo "Removing trailing whitespace"
python $SCRIPT_DIR/remove_trailing_whitespace.py $1
echo "Adding LFRic copyright notice."
python $SCRIPT_DIR/add_copyright.py $1
echo "Correcting subsubsection header format as-per the style guide."
python $SCRIPT_DIR/fix_subsubsection_underlines.py $1
echo "Wrapping source to max 80 column width as per the style guide."
python $SCRIPT_DIR/split_long_rst_lines.py $1
echo "Finished!"