move vars generation to its script

This commit is contained in:
Motiejus Jakštys 2021-05-19 22:57:47 +03:00 committed by Motiejus Jakštys
parent 7e9090c29d
commit d4e69fdcbe
2 changed files with 6 additions and 7 deletions

View File

@ -141,7 +141,7 @@ version.inc.tex: Makefile $(shell git rev-parse --git-dir 2>/dev/null)
TZ=UTC date '+\gdef\VCDescribe{%F ($(REF))}%' > $@
vars.inc.tex: vars.awk wm.sql Makefile
./$< wm.sql > $@
awk -f $< wm.sql
slides-2021-03-29.pdf: slides-2021-03-29.txt
pandoc -t beamer -i $< -o $@

11
vars.awk Executable file → Normal file
View File

@ -1,20 +1,19 @@
#!/usr/bin/awk -f
BEGIN {
FS="[() ]"
}
BEGIN { FS="[() ]" }
/small_angle constant real default radians/ {
if(d) {
exit 1
} else {
printf ("\\newcommand{\\smallAngle}{\\frac{\\pi}{%d}}\n",180/$8);
d=1
d = sprintf("\\newcommand{\\smallAngle}{\\frac{\\pi}{%d}}\n",180/$8);
}
}
END{
if(!d){
if(d) {
print d > "vars.inc.tex"
} else {
exit 1
}
}