Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

paperdraft image: allow to keep intermediary tex file #102

Merged
merged 1 commit into from
Jun 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion resources/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
#!/bin/sh
# Get options
keep_tex="0"
while getopts "k" "opt"; do
case "$opt" in
k)
keep_tex=1
;;
esac
done
shift "$(expr $OPTIND - 1)"

# The first argument must always be the path to the main paper
# file. The working directory is switched to the folder that the
# paper file is in.
input=$1
input="$1"
shift

input_file="$(basename $input)"
cd "$(dirname $input)"

## Create LaTeX file.
if [ "$keep_tex" -ge 1 ]; then
/usr/local/bin/pandoc \
--defaults="$OPENJOURNALS_PATH"/docker-defaults.yaml \
--defaults="$OPENJOURNALS_PATH"/"$JOURNAL"/defaults.yaml \
--output=paper.tex \
"$input_file" \
"$@"
fi

## Create full PDF
/usr/local/bin/pandoc \
--defaults="$OPENJOURNALS_PATH"/docker-defaults.yaml \
--defaults="$OPENJOURNALS_PATH"/"$JOURNAL"/defaults.yaml \
Expand Down