Skip to content

Commit 2881a62

Browse files
committed
Disable tikzpicture
Use sed to change each instance of tikzpicture environment into a comment environment. Increases number of parseable papers and shortens conversion time.
1 parent c2eac8a commit 2881a62

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

latex2html.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/usr/bin/env bash
22
OUTNAME="$1"
33
echo $OUTNAME
4-
SOURCE_DIR="/files/ro-source"
4+
RO_SOURCE_DIR="/files/ro-source"
5+
SOURCE_DIR="/files/source"
56
OUTPUT_DIR="/files/htmls"
67

7-
cd "$SOURCE_DIR"
8+
cp -r "$RO_SOURCE_DIR" "$SOURCE_DIR"
9+
find "$SOURCE_DIR" -iname '*.tex' -print0 | xargs -0 sed -i \
10+
-e 's/\\begin{document}/\\usepackage{verbatim}\0/g' \
11+
-e 's/\\begin\(\[[^]]*\]\)\?{tikzpicture}/\\begin{comment}/g' \
12+
-e 's/\\end{tikzpicture}/\\end{comment}/g'
813

914
if [ -f "$SOURCE_DIR/ms.tex" ]
1015
then
@@ -16,7 +21,7 @@ elif [ -f "$SOURCE_DIR/00_main.tex" ]
1621
then
1722
MAINTEX="$SOURCE_DIR/00_main.tex"
1823
else
19-
MAINTEX=$(find $SOURCE_DIR -maxdepth 1 -type f -iname "*.tex" -print0 | xargs -0 grep -l documentclass | head -1)
24+
MAINTEX=$(find "$SOURCE_DIR" -maxdepth 1 -type f -iname "*.tex" -print0 | xargs -0 grep -l documentclass | head -1)
2025
fi
2126
timeout -s KILL 300 engrafo "$MAINTEX" /files/output
2227

0 commit comments

Comments
 (0)