<commit_before>#!/bin/bash
#
# compile.sh
#
# purpose:  Make slides, homework, and handout.
# author:   <NAME>
# e-mail:   <EMAIL>
# web:      http://ocefpaf.github.io/
# created:  09-Aug-2013
# modified: Thu 15 Aug 2013 08:13:32 PM BRT
#
# obs:
#

LATEXMK=/usr/bin/latexmk
PANDOC=/home/filipe/bin/pandoc

DIR=$1
slides=$(mktemp --dry-run)  # Slides.
handouts=$(mktemp --dry-run)  # Handouts.

datestring=$(date +"%d_%b_%Y")

cat common/slides.tex common/header.tex ${DIR}/lecture.tex > $slides
cat common/handouts.tex common/header.tex ${DIR}/lecture.tex > $handouts

OPTION="--mathjax --smart --normalize --standalone \
        --highlight-style=pygments --webtex"
FROM="--from markdown homework.md"
DOCX="--to html --output ${datestring}_OcFis_homework.html"
HTML="--to docx --output ${datestring}_OcFis_homework.docx"
LATEX="--to latex --output ${datestring}_OcFis_homework.pdf"

pushd ${DIR}
    OPTS="-pdf -latexoption=-interaction=batchmode"
    # Slides.
    $LATEXMK $OPTS --jobname=${datestring}_OcFis_slides $slides

    # Handouts.
    $LATEXMK $OPTS --jobname=${datestring}_OcFis_handouts $handouts

    # Homework.
    $PANDOC $OPTION $FROM $LATEX

    # Clean-up.
    rm *.snm *.nav *.fdb_latexmk *.fls *.log *.out *.toc *.aux
popd<commit_msg>Tide-up script.<commit_after>#!/bin/bash
#
# compile.sh
#
# purpose:  Make slides, homework, and handout.
# author:   <NAME>. Fernandes
# e-mail:   <EMAIL>
# web:      http://ocefpaf.github.io/
# created:  09-Aug-2013
# modified: Fri 16 Aug 2013 07:27:06 AM BRT
#
# obs: the only argument is the directory with a lecture.tex file
# (without header and document class) and a homework.md file.
#


DIR=$1  # Lecture directory.
fname=$(date +"%Y_%m_%d")_OC # Output file names.

# Temp latex files.
slides=$(mktemp --dry-run)
handouts=$(mktemp --dry-run)

# Options.
LATEXMK=/usr/bin/latexmk
OPTS="-pdf -latexoption=-interaction=batchmode"

PANDOC=/home/filipe/bin/pandoc
OPTION="--mathjax --smart --normalize --standalone --highlight-style=pygments"
FROM="--from markdown homework.md"
LATEX="--to latex --output ${fname}_Lista.pdf"

cat common/slides.tex common/header.tex ${DIR}/lecture.tex > $slides
cat common/handouts.tex common/header.tex ${DIR}/lecture.tex > $handouts

pushd ${DIR}
    $LATEXMK $OPTS --jobname=${fname}_Slides $slides  # Slides.
    $LATEXMK $OPTS --jobname=${fname}_Notas $handouts  # Handouts.
    $PANDOC $OPTION $FROM $LATEX  # Homework.
    rm *.snm *.nav *.fdb_latexmk *.fls *.log *.out *.toc *.aux  # Clean-up.
popd
{'fraction_non_alphanumeric': 0.1718625099920064, 'fraction_numerical': 0.015187849720223821, 'mean_word_length': 3.6524163568773234, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3766369', 'n_tokens_mistral': 1055, 'n_tokens_neox': 974, 'n_words': 212}