stud/IV/vars.awk

23 lines
418 B
Awk
Raw Normal View History

2021-04-13 04:26:19 +03:00
#!/usr/bin/awk -f
2021-04-14 20:03:34 +03:00
BEGIN { FS="[(); ]" }
2021-04-13 04:26:19 +03:00
/small_angle constant real default radians/ {
2021-04-14 20:03:34 +03:00
x1 += 1;
d1 = sprintf("\\newcommand{\\smallAngle}{\\frac{\\pi}{%d}}",180/$8);
}
/isolation_threshold constant real default / {
x2 += 1;
d2 = sprintf("\\newcommand{\\isolationThreshold}{%.2f}",$7);
2021-04-13 04:26:19 +03:00
}
END{
2021-04-14 20:03:34 +03:00
if(x1 == 1 && x2 == 1) {
print d1 > "vars.inc.tex"
print d2 >> "vars.inc.tex"
2021-04-13 04:31:29 +03:00
} else {
2021-04-13 04:26:19 +03:00
exit 1
}
}