hid/common: Clip no-holes polygon pieces before calling fill_contour
[geda-pcb/gde.git] / doc / ascii2texi.awk
blobfd0e41519ff35d44ab83c507b4e14be3f393b4b2
1 #!/usr/bin/awk -f
3 # $Id$
6 BEGIN {
7 first = 1;
8 col = 1;
11 /^[ \t]*#/ {
12 # skip comment lines
13 next;
16 /^[ \t]*$/ {
17 # skip blank
18 next;
21 # we do this 'first' song and dance because variables set
22 # on the command line are not available in the BEGIN section
23 first == 1 {
24 first = 0;
25 printf("@c Generated file. Do not edit directly\n");
26 printf("@c $" "Id" "$\n");
27 printf("@multitable @columnfractions ");
28 for(i = 1 ; i <= 2*ncol ; i = i + 1) {
29 printf("%.3g ", 0.5 / ncol);
31 printf("\n");
33 printf("@item ");
34 for(i = 1 ; i <= ncol ; i = i + 1) {
35 if( i > 1 ) { printf("@tab "); }
36 printf("Drill @tab Diameter ");
38 printf("\n");
40 printf("@item ");
41 for(i = 1 ; i <= ncol ; i = i + 1) {
42 if( i > 1 ) { printf("@tab "); }
43 printf("Size @tab (inches) ");
45 printf("\n");
47 printf("\n");
51 if( col == 1 ) {
52 printf("@item ");
53 } else {
54 printf("@tab ");
56 drl = $1;
57 dia = $2;
58 gsub(/_/, " ", drl);
59 printf("%s @tab %s ", drl, dia);
60 col = col + 1;
61 if( col > ncol ) {
62 col = 1;
63 printf("\n");
67 END {
68 while( (col > 1) && (col <= ncol ) ) {
69 printf("@tab @tab ");
70 col = col + 1;
73 printf("@end multitable\n\n");