Skip to content

Commit

Permalink
Export basic LaTeX file, too
Browse files Browse the repository at this point in the history
According to manubot/rootstock#384

For kicks, we *also* set BUILD_DOCX, so we should also get a Word
file...
  • Loading branch information
habi committed Nov 5, 2020
1 parent 2699f3b commit 6066544
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ set -o errexit \
export TZ=Etc/UTC
# Default Python to read/write text files using UTF-8 encoding
export LC_ALL=en_US.UTF-8
# Build both .tex and .doc file, too
export BUILD_LATEX=true
export BUILD_DOCX=true

# Generate reference information
echo >&2 "Retrieving and processing reference metadata"
Expand Down Expand Up @@ -85,6 +88,15 @@ if [ "${BUILD_DOCX:-}" = "true" ]; then
--defaults=docx.yaml
fi

# Create LaTeX output (if BUILD_LATEX environment variable equals "true")
if [ "${BUILD_LATEX:-}" = "true" ]; then
echo >&2 "Exporting LaTeX manuscript"
pandoc \
--data-dir="$PANDOC_DATA_DIR" \
--defaults=common.yaml \
--defaults=latex.yaml
fi

# Spellcheck
if [ "${SPELLCHECK:-}" = "true" ]; then
export ASPELL_CONF="add-extra-dicts $(pwd)/build/assets/custom-dictionary.txt; ignore-case true"
Expand Down
4 changes: 4 additions & 0 deletions build/pandoc/defaults/latex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Pandoc --defaults for LaTeX output.
# Load on top of common defaults.
to: latex
output-file: output/manuscript.tex

0 comments on commit 6066544

Please sign in to comment.