2015-03-08 10:21:05 -04:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
## Purpose of this script
|
|
|
|
|
|
|
|
|
|
## Select all files in the folder /content/fr
|
|
|
|
|
## Save them to the folder /temp/
|
|
|
|
|
|
|
|
|
|
## 1: We declare some variables
|
|
|
|
|
|
2015-03-27 18:48:45 -04:00
|
|
|
|
INPUT="../content/meta.txt ../content/manifestos/*.*" ## ../content/intro.txt
|
2015-03-08 10:21:05 -04:00
|
|
|
|
TEMP="../temp/newfile.txt"
|
|
|
|
|
TEMP2="../temp/newfile2.txt"
|
2015-05-15 19:01:23 -04:00
|
|
|
|
|
|
|
|
|
TIMESTAMP=$(date +"%s")
|
|
|
|
|
OUTPUT="../output/output-"$TIMESTAMP".pdf"
|
|
|
|
|
|
2015-03-08 10:21:05 -04:00
|
|
|
|
|
|
|
|
|
## 2: AWK Method
|
|
|
|
|
|
|
|
|
|
## FNR = the current record number in the current file.
|
|
|
|
|
## NR = "Number of Lines seen so far in the current file"
|
|
|
|
|
|
|
|
|
|
## \\vfill \\columnbreak \\newpage
|
|
|
|
|
|
|
|
|
|
awk '
|
|
|
|
|
BEGIN {
|
|
|
|
|
start = ""; ## \\begin{multicols}{2}
|
|
|
|
|
end = "\\newpage"; ## \\end{multicols}\n
|
|
|
|
|
print start
|
|
|
|
|
}
|
|
|
|
|
FNR == 1 && FNR != NR {
|
|
|
|
|
print end;
|
|
|
|
|
print start
|
|
|
|
|
}
|
|
|
|
|
{print} ## {print $0," "} ## Adds two spaces after each end-of-line, to keep line returns in Markdown.
|
|
|
|
|
END {
|
|
|
|
|
print end
|
|
|
|
|
}
|
|
|
|
|
' $INPUT > $TEMP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## awk '{print $0," x"}' $TEMP > $TEMP2
|
|
|
|
|
## mv $TEMP2 $TEMP
|
|
|
|
|
|
|
|
|
|
## PANDOC processing
|
|
|
|
|
|
|
|
|
|
## Consolata
|
|
|
|
|
## Inconsesi
|
2015-03-27 18:48:45 -04:00
|
|
|
|
## "Breite Grotesk"
|
|
|
|
|
## "Work Sans"
|
2015-05-15 19:01:23 -04:00
|
|
|
|
## "Archivo Narrow"
|
|
|
|
|
## "Sophia Nubian"
|
2015-05-18 05:35:50 -04:00
|
|
|
|
## "Limousine"
|
2016-02-11 18:10:41 -05:00
|
|
|
|
## Monoid
|
2015-03-08 10:21:05 -04:00
|
|
|
|
|
2016-02-11 16:55:32 -05:00
|
|
|
|
pandoc -f markdown -o $OUTPUT --template=../templates/customV2 $TEMP --latex-engine=xelatex \
|
2016-02-11 18:10:41 -05:00
|
|
|
|
--variable mainfont="Monoid" \
|
2016-02-11 16:55:32 -05:00
|
|
|
|
--variable sansfont=Futura \
|
|
|
|
|
--variable monofont=Inconsesi \
|
|
|
|
|
--variable fontsize=9pt \
|
|
|
|
|
--variable urlcolor=black \
|
|
|
|
|
--variable linkcolor=black \
|
|
|
|
|
--variable documentclass=book \
|
|
|
|
|
--toc --toc-depth=1 \
|
|
|
|
|
--include-before-body=../content/intro.txt
|
2015-03-08 10:21:05 -04:00
|
|
|
|
|
|
|
|
|
## End of file
|