lilypond-1.3.130
[lilypond.git] / bin / ly2dvi.sh
blobf5711b24c95dbd376c3af418ed290201795719ab
1 #!/bin/sh
3 # Script to make a LaTeX file for Lilypond
5 # Written by Jan Arne Fagertun <Jan.A.Fagertun@energy.sintef.no>
6 # Sat Nov 22 22:26:43 CET 1997
8 # $Id: ly2dvi.sh,v 1.14 1998/05/12 10:27:51 fred Exp $
10 # Original LaTeX file made by Mats Bengtsson, 17/8 1997
13 VERSION="0.11.hwn1"
14 NAME=ly2dvi.sh
15 IDENTIFICATION="$NAME $VERSION"
16 NOW=`date`
17 echo "$IDENTIFICATION" 1>&2
19 # TODO:
20 # prevent orphaned "Lily is here" strings
22 # NEWS
24 #0.11.hwn1
25 # - height vs heigth
26 # - robustification: give \nonstopmode as LaTeX arg; no hanging if no TeX file.
27 # - robustification: notice failed cp.
29 #0.11
30 # - more papersizes (thanks Han-Wen) - don't expect LaTeX to accept all...
31 # - -W,--Width= : set paper width (points)
32 # - -H,--Height= : set paper height (points)
33 # - -H and -W is used only when an unknown papersize is to be specified,
34 # and has to be combined with a papersize option known to LaTeX
35 #NB! - -F,--headers= : name of additional LaTeX headers input file.
36 #NB! Changed from -H to -F
37 # - -d,--dependencies : passed to lilypond
40 #0.10.jcn1
41 # - HEIGHT -> HEIGHT
42 # - vertical margins (for a4), same on both sides
43 # - textheight from lilypond output file (mudelapapertextheight)
44 # - piece titling
45 # - mudelapiece, mudelaopus
47 #0.10
48 # - -K,--keeplilypond : Keep lilypond output files (default delete)
49 # - -k,--keeply2dvi : Keep ly2dvi output files (default delete)
50 # - -L,--landscape : Set landscape orientation
51 # - -N,--nonumber : Turn off page numbering (\pagestyle{empty})
52 # - Could not reinsert "\usepackage[T1]{fontenc}" because
53 # "los-toros" won't work with it
54 # - Ekstra LaTeX headers from input file
55 #0.9.hwn1
56 # - option to remove output of lily
57 # 0.9
58 # - Trap Lilypond abort
59 # - Replaced "\usepackage[T1]{fontenc}" with
60 # \usepackage[latin1]{inputenc} (takk, Mats)
61 # - Removed "()" around "\LilyIdString" (Janne didn't want it)
62 # 0.8 - Trap Lilypond segmentation fault
63 # - Function for cleanup
64 # - Trap line
65 # - More human-readable variables
66 # - Some logics concerning rc-files
67 # 0.7
68 # - Improved Lilypond error checking
69 # - Output orientation (landscape...). Overrides mudela file
70 # variable orientation="landscape";
71 # - Paper width and height put into variables (only A4!)
72 # - Adjusted top margin to default.....
74 #TODO
75 # - Include more papersizes.
76 # - Manual page.......
77 # 0.6.jaf2
78 # - LILYINCLUDE update
80 # 0.6.hwn1
81 # - handle LILYINCLUDE
82 # - --output
84 # 0.6
85 # - Source rc-files, if present. Files are:
86 # /usr/local/share/lilyrc /etc/lilyrc $HOME/.lilyrc ./.lilyrc
87 # - tee output from Lilypond
88 # - Handles margins for A4 paper (equal on both sides)
89 # - new option -s (--separate) for one LaTeX run per file,
90 # else all files are run together
92 # 0.5
93 # - More useful ("two-level") debug.
94 # - The Q&D hack to find file names and not handling \include
95 # is replaced by grabbing output file names from Lilypond.
96 # = Detects multiple output files - adds them when running
97 # LaTeX.
98 # - Works with multiple input files - no matter if they are
99 # (a mix of) input to or output from Lilypond.
101 #TODO
102 # - Still no margins handling.
103 # - We have to discuss how to handle multiple output files
104 # from Lilypond - 'ly2dvi standchen' gives a rather odd
105 # result....
107 # 0.4.1
108 # - Always exit after printing help info
109 # 0.4
110 # - Changes to ensure for more strict grep'ing of parameters
111 # Thanks to from G.B.Stott@bolton.ac.uk
112 # - More efficient use of sed -e 's///' -e 's///'
113 # Thanks to Johan Vromans <jvromans@squirrel.nl> and GBS
114 # - Ask tex for location of titledefs.tex (Thanks to JV)
115 # - Accept only exact match of "\def\mudelacomposer{"
116 # (or whatever mudela* defined in titledefs.tex)
117 # - Even more efficient use of sed (Thanks to JV)
118 # - Default file name for single output file implemented.
119 # - Moved help into function - finally included from 0.1.jcn1
121 #TODO
122 # - Still doesn't handle \include
123 # - The Q&D for finding output file name from the sequence of
124 # \paper \output \midi \output really needs to be looked at.
125 # I have improved it a lot, but it's only capable of finding
126 # one (the last) file name.
127 # Well, I have to rewrite this entirely to handle \include,
128 # then I can fix it.
129 # - Still no margins handling.
131 #WARNING
132 # - Some lines of output from lilypond do NOT start
133 # at first character position, therefore I have removed "^"
134 # in sed'ing and grep'ing.
136 # 0.3.hwn1
137 # - add "Creator: " line to output
139 # 0.3
140 # - multiple input files to make score from several files
141 # (extra files assumed to be Lilypond output)
142 # - cp dvi-file instead of mv, to allow for xdvi reload
143 # - check for illegal long options
144 # - put in pt in text width, if not given
145 # - put in \nonstopmode in LaTeX file
146 # - restored LaTeX exit value check
148 # 0.2.1
149 # - temporarily omit LaTeX exit value check
150 # - remove ALL temporary files
152 # 0.2
153 # - fix for solaris - included from 0.1.jcn1
154 # - long option hack - included from 0.1.jcn1 - modified
155 # - moved help into function - NOT included from 0.1.jcn1 yet
156 # - various improvements - included from 0.1.jcn1
157 # - find mudela definitions from titledefs.tex
158 # - find papersize from lilypond output file (mudelapapersize),
159 # overridden by option '-p size' or '--papersize=size'
160 # - option -l lang or --language=lang overrides
161 # lilypond output file definition (mudelalanguage)
162 # - textwidth from lilypond output file (mudelapaperlinewidth)
164 # 0.1.jcn1
165 # - fix for solaris
166 # - long option hack
167 # - moved help into function
170 # Clean up
172 cleanup() {
173 if [ "$KEEP_LY2DVI_OUTPUT" != "Y" ]
174 then
175 [ -n "$LatF" -a -f "$LatF" ] && rm -f $LatF
176 [ -n "$LOGFILE" -a -f "$LOGFILE" ] && rm -f $LOGFILE
177 [ -n "$FN" ] && rm -f $FN.*
178 for F in *$$* $TMP/*$$*
180 rm -f $F
181 done
183 if [ "$KEEP_LILY_OUTPUT" != "Y" ]
184 then
185 for F in $LILY_OUTPUT_FILES
187 [ -f $F ] && rm -f $F
188 done
192 # print usage
194 help() {
195 cat << EOF
196 Generate dvi file from mudela or lilypond output
197 Usage: $0 [options] file[s]
199 Options:
200 -D,--debug set debug mode
201 -F,--headers= name of additional LaTeX headers file
202 -H,--Height= set paper height (points) (see manual page)
203 -K,--keeplilypond keep lilypond output files
204 -L,--landscape set landscape orientation
205 -N,--nonumber switch off page numbering
206 -O,--orientation= set orientation (obsolete - use -L instead)
207 -W,--Width= set paper width (points) (see manual page)
208 -d,--dependencies tell lilypond make a dependencies file
209 -h,--help this help text
210 -k,--keeply2dvi keep ly2dvi output files
211 -l,--language= give LaTeX language (babel)
212 -o,--output= set output directory
213 -p,--papersize= give LaTeX papersize (eg. a4)
214 -s,--separate run all files separately through LaTeX
216 files may be (a mix of) input to or output from lilypond(1)
220 # Trap function (cleanup)
222 trap cleanup 0 9 15
224 # Various defaults
226 [ -z "$TMP" ] && TMP=/tmp
227 if [ ! -d $TMP ]
228 then
229 $debug_echo $IDENTIFICATION": temporary directory "$TMP" not found, set to /tmp"
230 TMP=/tmp
232 LOGFILE=$TMP/lilylog.$$ # Logfile for lilypond
233 PAPERSIZE=a4 # Default papersize name
234 PWIDTH=597 # Default paperwidth
235 PHEIGHT=845 # Default paperheight
236 PNUM="%" # Page numbering on
237 LILYOPTS="" # Options to lilypond
239 setPaperZize() {
240 case "$PAPERSIZE" in
241 a0*)
242 PWIDTH=2389
243 PHEIGHT=3381
244 PAPERSIZE=a0paper
246 a1|a1p*)
247 PWIDTH=1690
248 PHEIGHT=2389
249 PAPERSIZE=a1paper
251 a2*)
252 PWIDTH=1194
253 PHEIGHT=1690
254 PAPERSIZE=a2paper
256 a3*)
257 PWIDTH=845
258 PHEIGHT=1194
259 PAPERSIZE=a3paper
261 a4*)
262 PWIDTH=597
263 PHEIGHT=845
264 PAPERSIZE=a4paper
266 a5*)
267 PWIDTH=423
268 PHEIGHT=597
269 PAPERSIZE=a5paper
271 a6*)
272 PWIDTH=298
273 PHEIGHT=423
274 PAPERSIZE=a6paper
276 a7*)
277 PWIDTH=211
278 PHEIGHT=298
279 PAPERSIZE=a7paper
281 a8*)
282 PWIDTH=305
283 PHEIGHT=211
284 PAPERSIZE=a8paper
286 a9*)
287 PWIDTH=105
288 PHEIGHT=305
289 PAPERSIZE=a9paper
291 a10*)
292 PWIDTH=74
293 PHEIGHT=105
294 PAPERSIZE=a10paper
296 b0*)
297 PWIDTH=2847
298 PHEIGHT=4023
299 PAPERSIZE=b0paper
301 b1*)
302 PWIDTH=2012
303 PHEIGHT=2847
304 PAPERSIZE=b1paper
306 b2*)
307 PWIDTH=1423
308 PHEIGHT=2012
309 PAPERSIZE=b2paper
311 b3*)
312 PWIDTH=1006
313 PHEIGHT=1423
314 PAPERSIZE=b3paper
316 b4*)
317 PWIDTH=712
318 PHEIGHT=1006
319 PAPERSIZE=b4paper
321 b5*)
322 PWIDTH=503
323 PHEIGHT=712
324 PAPERSIZE=b5paper
326 archA)
327 PWIDTH=650
328 PHEIGHT=867
330 archB)
331 PWIDTH=867
332 PHEIGHT=1301
334 archC)
335 PWIDTH=1301
336 PHEIGHT=1734
338 archD)
339 PWIDTH=1734
340 PHEIGHT=2602
342 archE)
343 PWIDTH=2602
344 PHEIGHT=3469
346 flsa|flse)
347 PWIDTH=614
348 PHEIGHT=940
350 halfletter)
351 PWIDTH=397
352 PHEIGHT=614
354 ledger)
355 PWIDTH=1229
356 PHEIGHT=795
358 legal)
359 PWIDTH=614
360 PHEIGHT=1012
362 letter)
363 PWIDTH=614
364 PHEIGHT=795
366 note)
367 PWIDTH=542
368 PHEIGHT=723
371 echo ""
372 echo $0": unknown papersize -- "$PAPERSIZE
373 echo ""
375 esac
378 # RC-files ?
380 for D in /usr/local/share/ /etc/ $HOME/. ./.
382 RCfile=$D"lilyrc"
383 [ -f $RCfile ] && . $RCfile
384 done
385 fORI=$ORIENTATION
386 fLNG=$LANGUAGE
387 fPSZ=$PAPERSIZE
388 fLHF=$LATEXHF
389 unset ORIENTATION LANGUAGE PAPERSIZE LATEXHF
391 # Keywords defined in titledefs.tex
393 TF=`kpsewhich -n tex tex titledefs.tex`
394 if [ -n $TF ]
395 then
396 TF=/usr/lib/texmf/tex/lilypond/titledefs.tex
398 MU_DEF=""
399 if [ -f $TF ]
400 then
401 MU_DEF=`egrep "^.newcommand...mudela" $TF | \\
402 sed -e 's/^.newcommand...//' -e 's/\\}.*$//'`
405 if [ -z "$MU_DEF" ]
406 then
407 MU_DEF="mudelatitle mudelasubtitle mudelacomposer \
408 mudelaopus mudelaarranger mudelapiece mudelainstrument"
412 # debugging
414 debug_echo=true
416 # All files in one LaTeX run
418 SEPFILE=N
420 # Find command line options and switches
422 # "x:" x takes argument
424 switches="DF:H:KLNO:W:dhkl:o:p:s\?"
425 options=""
427 # ugh, "\-" is a hack to support long options
428 # while getopts \-:$options$switches O
429 # must be in double quotes for bash-2.0
430 while getopts "\-:$options$switches" O
432 $debug_echo "O: \`$O'"
433 $debug_echo "arg: \`$OPTARG'"
434 case $O in
436 [ $debug_echo = echo ] && set -x
437 debug_echo=echo
440 LATEXHF=$OPTARG
443 PHEIGHT=$OPTARG
446 KEEP_LILY_OUTPUT=Y
449 ORIENTATION=landscape
452 ORIENTATION=$OPTARG
455 PNUM="\pagestyle{empty}"
458 PWIDTH=$OPTARG
461 LILYOPTS=$LILYOPTS" -d"
464 help;
465 exit 0
468 KEEP_LY2DVI_OUTPUT=Y
471 LANGUAGE=$OPTARG
474 OUTPUTDIR=$OPTARG
477 PAPERSIZE=$OPTARG
480 SEPFILE=Y
482 \? )
483 help;
484 exit -1
486 # a long option!
488 $debug_echo "long option: \`$OPTARG'"
489 case "$OPTARG" in
490 He*|-He*)
491 PHEIGHT=`echo $OPTARG | sed -e s/"^.*="//`
493 W*|-W*)
494 PWIDTH=`echo $OPTARG | sed -e s/"^.*="//`
496 dep*|-dep*)
497 LILYOPTS=$LILYOPTS" -d"
499 d*|-d*)
500 [ $debug_echo = echo ] && set -x
501 debug_echo=echo
503 hea*|-hea*)
504 LATEXHF=`echo $OPTARG | sed -e s/"^.*="//`
506 h*|-h*)
507 help;
508 exit 0
510 keepli*|-keepli*)
511 KEEP_LILY_OUTPUT=Y
513 k*|-k*)
514 KEEP_LY2DVI_OUTPUT=Y
516 land*|-land*)
517 ORIENTATION=landscape
519 lang*|-lang*)
520 LANGUAGE=`echo $OPTARG | sed -e s/"^.*="//`
522 n*|-n*)
523 PNUM="\pagestyle{empty}"
525 or*|-or*)
526 ORIENTATION=`echo $OPTARG | sed -e s/"^.*="//`
528 ou*|-ou*)
529 OUTPUTDIR=`echo $OPTARG | sed -e s/"^.*="//`
531 p*|-p*)
532 PAPERSIZE=`echo $OPTARG | sed -e s/"^.*="//`
534 s*|-s*)
535 SEPFILE=Y
537 *|-*)
538 echo $0": illegal option -- "$OPTARG;
539 help;
540 exit -1
542 esac
543 esac
544 done
545 shift `expr $OPTIND - 1`
547 # Input file name
549 if [ "$1" = "" ]
550 then
551 help
552 $debug_echo $IDENTIFICATION": No input file name given"
553 exit 1
557 mudelaDefs(){
558 # Include \def\mudela-definitions
560 for L in $MU_DEF
562 SS=$1
563 # LL=`egrep '^\\\\def.'$L'{' $OF`
564 LL=`egrep '^\\\\def.'$L'{' $File`
565 if [ "$LL" = "" ]
566 then
567 LL=`egrep '^\\\\def.'$L'{' $OF`
569 if [ "$LL" != "" ]
570 then
572 LLL=`echo $LL | sed -e 's/}.*$//' -e 's/.*{//'`
573 ##}{
574 if [ "$LLL" != "" ]
575 then
576 echo "$SS\\"$L'{'$LLL'}%' >> $LatF
579 done
581 startFile(){
583 # LaTeX file name
585 BN=`basename $File .tex`
586 FN=$BN.$$
587 if [ "$KEEP_LY2DVI_OUTPUT" != "Y" ]
588 then
589 LatF=$TMP/$FN.tex
590 else
591 LatF=$FN.tex
594 # Find:
595 # paper size (PAPERSIZE, overridden by command line option -p)
596 # paper orientation (ORIENTATION, overridden by option -o)
597 # language (LANGUAGE, overridden by option -l)
598 # textwidth
600 eval `sed -n \\
601 -e 's/\\\\def\\\\mudelalanguage{\([^}]*\).*$/fLNG=\1;/p' \\
602 -e 's/\\\\def\\\\mudelalatexheaders{\([^}]*\).*$/fLHF=\1;/p' \\
603 -e 's/\\\\def\\\\mudelaorientation{\([^}]*\).*$/fORI=\1;/p' \\
604 -e 's/\\\\def\\\\mudelapaperlinewidth{\([^}]*\).*$/TWN=\1;/p' \\
605 -e 's/\\\\def\\\\mudelapapertextheight{\([^}]*\).*$/THN=\1;/p' \\
606 -e 's/\\\\def\\\\mudelapapersize{\([^}]*\).*$/fPSZ=\1;/p' \\
607 $File`
609 if [ -z "$LATEXHF" ]
610 then
611 LATEXHF=$fLHF
613 LLHF="%"
614 if [ -n "$LATEXHF" ]
615 then
616 [ -f $LATEXHF ] && LLHF="\input{$LATEXHF}"
619 if [ -z "$PAPERSIZE" ]
620 then
621 PAPERSIZE=$fPSZ
623 if [ -n "$PAPERSIZE" ]
624 then
625 setPaperZize
626 PAPEROPT=$PAPERSIZE
629 if [ -z "$ORIENTATION" ]
630 then
631 ORIENTATION=$fORI
633 if [ -n "$ORIENTATION" ]
634 then
635 if [ -z "$PAPEROPT" ]
636 then
637 PAPEROPT=$ORIENTATION
638 else
639 PAPEROPT=$PAPEROPT,$ORIENTATION
643 if [ -n "$PAPEROPT" ]
644 then
645 PAPER="["$PAPEROPT"]"
648 if [ -z "$LANGUAGE" ]
649 then
650 LANGUAGE=$fLNG
652 if [ -n "$LANGUAGE" ]
653 then
654 LLNG="\usepackage["$LANGUAGE"]{babel}"
655 else
656 LLNG="%"
660 # Find textwidth
662 if [ -n "$TWN" ]
663 then
664 TW=$TWN
665 case $TW in
666 *mm)
668 *cm)
670 *pt)
673 TW=$TW"pt"
675 esac
676 $debug_echo "Text width = "$TW
678 TWp=`echo $TW | sed -e 's/\..*$//'`
679 PWp=$PWIDTH
681 # Find textheight
683 if [ -n "$THN" ]
684 then
685 TH=$THN
686 case $TH in
687 *mm)
689 *cm)
691 *pt)
694 TH=$TH"pt"
696 esac
697 $debug_echo "Text height = "$TH
699 THp=`echo $TH | sed -e 's/\..*$//'`
700 PHp=$PHEIGHT
701 if [ "$ORIENTATION" = "landscape" ]
702 then
703 PWp=$PHEIGHT
704 PHp=$PWIDTH
706 HMARG=`expr $PWp - $TWp`
707 HMARG=`expr $HMARG / 2`"pt"
708 $debug_echo "Text left = "$HMARG
709 VMARG=`expr $PHp - $THp`
710 VMARG=`expr $VMARG / 2`"pt"
711 $debug_echo "Text top = "$VMARG
713 # Geometry: /var/lib/texmf/latex/geometry/geometry.dvi
716 # Write LaTeX file
718 cat << EOF > $LatF
719 % Creator: $IDENTIFICATION
720 % Automatically generated from $IF, $NOW
722 \documentclass$PAPER{article}
724 $LLNG
725 \usepackage{geometry}
726 \usepackage[latin1]{inputenc}
727 %\usepackage[T1]{fontenc}
728 $PNUM
729 %\addtolength{\oddsidemargin}{-1cm}
730 %\addtolength{\topmargin}{-1cm}
731 %\setlength{\textwidth}{$TW}
732 %\setlength{\textheight}{$TH}
733 %\geometry{width=$TW, left=$HMARG, top=1cm}
734 %\geometry{width=$TW, left=$HMARG}
735 %\geometry{height=$TH, top=$VMARG}
736 % \geometry{body={$PWp pt, $PHp pt}, width=$TW, top=$HMARG, height=$TH, top=$VMARG}
737 \geometry{width=$TW, top=$HMARG, height=$TH, top=$VMARG}
738 \input lilyponddefs
739 \input titledefs
740 $LLHF
741 \begin{document}
743 mudelaDefs
744 cat << EOF >> $LatF
745 \cmrtwenty% ugh
746 \makelilytitle
749 nextFile(){
750 cat << EOF >> $LatF
751 \def\theopus{}%
752 \def\thepiece{}%
754 mudelaDefs "\\def"
755 cat << EOF >> $LatF
756 \def\theopus{\mudelaopus}% ugh
757 \def\thepiece{\mudelapiece}%
758 \makelilypiecetitle
762 # Conclusion
764 endFile(){
765 cat << EOF >> $LatF
766 \vfill\hfill{\LilyIdString}
767 \end{document}
770 # Run LaTeX
772 latex '\nonstopmode \input '$LatF || exit 5
774 # Rename dvi file
776 if [ -f $FN.dvi ]
777 then
778 RESULT=$BN.dvi
779 [ -n "$OUTPUTDIR" ] && RESULT="$OUTPUTDIR/$RESULT"
781 cp $FN.dvi $RESULT || exit 5
785 # Output some info
787 cat << EOF
789 $IDENTIFICATION: dvi file name is $RESULT
794 # ugh. GF is side-effect.
795 findInput() {
796 # should check for LILYINCLUDE
797 for lypath in "." `echo $LILYINCLUDE| sed 's/:/ /g'`
799 if [ -f "$lypath/$1" ]
800 then
801 GF="$lypath/$1"
802 return
805 if [ -f "$lypath/$1.ly" ]
806 then
807 GF="$lypath/$1.ly"
808 return
810 done
811 $debug_echo $IDENTIFICATION": Input file "$GF" not found"
812 echo $NAME": Input file "$GF" not found" 1>&2
813 exit 2
816 # Loop through all files
819 LILY_OUTPUT_FILES=
821 for GF in $*
823 findInput $GF
826 # Check whether the file is input to or output from lilypond
828 L1=`head -1 $GF`
829 OP=`echo $L1 | grep "^% Creator: GNU LilyPond"`
830 if [ -n "$OP" ]
831 then
833 # OK - it's the output from lilypond.
835 # Get lilypond source file name
837 OF=$GF
838 IFL=`grep mudelafilename $OF`
839 if [ "$IFL" != "" ]
840 then
841 IF=`echo $IFL | sed -e 's/.*{//' -e 's/}*.$//'`
843 # Check if source file exists
845 if [ ! -f $IF ]
846 then
847 $debug_echo $IDENTIFICATION": Mudela file not found."
848 TW=15.5cm
849 TH=25cm
851 else
852 $debug_echo $IDENTIFICATION": Mudela file name not found."
853 TW=15.5cm
854 TH=25cm
856 else
858 # I have to assume this is the lilypond input file
859 # Find output file name, if defined
861 IF=$GF
863 # Run lilypond
864 # Grab output file names
866 $debug_echo "lilypond "$LILYOPTS $IF
868 lilypond $LILYOPTS $IF 2>&1 | tee $LOGFILE
869 OF=`egrep '^TeX output to ' $LOGFILE | \\
870 sed -e 's/TeX output to//' -e 's/\.\.\.//'`
871 $debug_echo "==> "$OF
872 STATUS=`egrep -i "error|segmentation|abort" $LOGFILE`
873 echo $STATUS
874 if [ ! -z "$STATUS" ]
875 then
876 exit 10
880 # "Spin through" all the files
882 for File in $OF
884 $debug_echo "--- "$File
886 # Check if output file is generated
888 if [ ! -f $File ]
889 then
890 $debug_echo $IDENTIFICATION": hmm, I could not find the output file "$File
891 exit 4
894 # Is this the first file?
896 if [ -z "$FFile" ]
897 then
898 FFile=$File
899 startFile
900 else
901 nextFile
903 cat << EOF >> $LatF
904 \input{$File}
906 if [ $SEPFILE = Y ]
907 then
908 FFile=""
909 endFile
911 LILY_OUTPUT_FILES="$LILY_OUTPUT_FILES $OF"
912 done
913 done
914 if [ $SEPFILE = N ]
915 then
916 endFile
919 # OK - finished