wm/vars.awk

27 lines
564 B
Awk
Raw Normal View History

2021-05-19 22:57:47 +03:00
#!/usr/bin/awk -f
2021-05-19 22:57:47 +03:00
BEGIN { FS="[(); ]" }
2021-05-19 22:57:47 +03:00
/small_angle constant real default radians/ {
2021-05-19 22:57:47 +03:00
x1 += 1;
2021-05-19 22:57:51 +03:00
d1 = sprintf("\\newcommand{\\smallAngle}{$%d^\\circ$}",$8);
2021-05-19 22:57:47 +03:00
}
/isolation_threshold constant real default / {
x2 += 1;
2021-05-19 22:57:51 +03:00
d2 = sprintf("\\newcommand{\\isolationThreshold}{%.1f}",$7);
2021-05-19 22:57:50 +03:00
}
/scale constant float default / {
x3 += 1;
d3 = sprintf("\\newcommand{\\exaggerationEnthusiasm}{%.1f}",$7);
2021-05-19 22:57:47 +03:00
}
END{
2021-05-19 22:57:50 +03:00
if(x1 == 1 && x2 == 1 && x3 == 1) {
2021-05-19 22:57:47 +03:00
print d1 > "vars.inc.tex"
print d2 >> "vars.inc.tex"
2021-05-19 22:57:50 +03:00
print d3 >> "vars.inc.tex"
2021-05-19 22:57:47 +03:00
} else {
2021-05-19 22:57:47 +03:00
exit 1
}
}