10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Copyright (c) P.J.Gawthrop, 1996.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.15 2000/04/06 10:57:12 peterg
## Removed debug line
##
## Revision 1.14 2000/04/06 10:51:14 peterg
## replaces $PWD by `pwd` for sh compatibility
##
## Revision 1.13 1999/10/19 23:47:27 peterg
|
>
>
>
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# Copyright (c) P.J.Gawthrop, 1996.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1 2000/12/27 15:57:31 peterg
## Initial revision
##
## Revision 1.15 2000/04/06 10:57:12 peterg
## Removed debug line
##
## Revision 1.14 2000/04/06 10:51:14 peterg
## replaces $PWD by `pwd` for sh compatibility
##
## Revision 1.13 1999/10/19 23:47:27 peterg
|
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
documenttype=$2;
if [ "$documenttype" = "book" ]; then # do book version
# Inform user
echo "Creating $1_rep.tex (directory version)"
strip_comments < $1_rep.txt|\
awk '
BEGIN{
oldpart = ""
}
{
# Find directory name.
for (i=1;i<NF;i++){
if ($i=="-d")
|
|
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
documenttype=$2;
if [ "$documenttype" = "book" ]; then # do book version
# Inform user
echo "Creating $1_rep.tex (directory version)"
strip_comments < $1_rep.txt|\
gawk '
BEGIN{
oldpart = ""
}
{
# Find directory name.
for (i=1;i<NF;i++){
if ($i=="-d")
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
fi
# Inform user
echo "Creating $1_rep.tex"
# Create the LaTeX file
strip_comments <$1_rep.txt |\
awk '
{
## Count the switches (noting that -i has an argument)
Switches=0;
for (i=2;i<=NF;i++) {
if (match($i,"-")==1) Switches++;
if (match($i,"-i")==1) Switches++;
}
|
|
|
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
fi
# Inform user
echo "Creating $1_rep.tex"
# Create the LaTeX file
strip_comments <$1_rep.txt |\
gawk '
{
## Count the switches (noting that -i has an argument)
Switches=0;
for (i=2;i<=NF;i++) {
if (match($i,"-")==1) Switches++;
if (match($i,"-i")==1) Switches++;
}
|