/articles/toma

To get this branch, use:
bzr branch http://darksoft.org/webbzr/articles/toma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /usr/bin/gawk -f


BEGIN{
  FS="\\input{|}"
}{
  regex="(%*)(.*)\\input{(.*)}";
  if(match($0,regex,a)){
    file = a[3];
    if(a[1]==""){
      match(file,"\\.tex",b);
      if(RLENGTH<0){
          system("merge.awk "file".tex");
      }
      else{
          system("merge.awk "file);
      }
    }

  }
  else{
    print $0
  }
}