summaryrefslogtreecommitdiffstats
path: root/mkballots.sh
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-11-02 02:35:45 -0600
committerH. Peter Anvin <hpa@zytor.com>2016-11-02 02:35:45 -0600
commit36ceca1ae8156095ba1e41b4a5b571e8a069b94c (patch)
tree42bc2e1dac064a76cb96421f0d814c2c6a875dcc /mkballots.sh
parent23e7407d241e8e870dd6ddf67f90b04d00d43f3a (diff)
downloadballot-36ceca1ae8156095ba1e41b4a5b571e8a069b94c.tar.gz
ballot-36ceca1ae8156095ba1e41b4a5b571e8a069b94c.tar.xz
ballot-36ceca1ae8156095ba1e41b4a5b571e8a069b94c.zip
Automatically randomize the candidates, now in a separate file *.cand
Keep the candidates in a plain textfile called *.cand, which can be automatically randomized and merged into the *.tex file before giving it to sdaps. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'mkballots.sh')
-rwxr-xr-xmkballots.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/mkballots.sh b/mkballots.sh
index f15e7d1..fb4b999 100755
--- a/mkballots.sh
+++ b/mkballots.sh
@@ -14,7 +14,9 @@ if [ -z "$proj" ]; then
fi
sdaps="sdaps $proj"
rm -rf "$proj"
-$sdaps setup_tex "$proj".tex
+sed -e "s:%%CANDIDATES%%:shuf --random-source=/dev/urandom < '$proj'.cand:e" \
+ -e 'T' -e 's/^\(.*\)$/\\choiceline{\1}/mg' "$proj".tex > "$proj".pp.tex
+$sdaps setup_tex "$proj".pp.tex
scoresheet.pl "$proj" > "$proj"/scoresheet.tex
cd "$proj"
pdflatex scoresheet.tex ; pdflatex scoresheet.tex