]> git.donarmstrong.com Git - lilypond.git/blob - tex/lily-ps-defs.tex
release: 1.1.55
[lilypond.git] / tex / lily-ps-defs.tex
1 %
2 % WARNING: don't leave blank lines in the PS-code; they are
3 % transformed into \par 
4 %
5
6 %
7 % header info (macros/defs, etc) should go into a \special{! ... }, 
8 % note the ! sign.  See dvips.info for details.
9 %
10
11 % Use of 
12 % /foo { operatorname } bind def
13 %
14 % ``compiles'' operatorname binding in the body of foo, making
15 % the code faster, and more reliable (less flexible)
16
17 {%
18    \def\par{ }%         %Ugh.  Don't try this at home, kids!
19    % neat file-include trick by Piet van Oostrum <piet@cs.uu.nl>
20    \newread\defin 
21    \newtoks\toksfiledefi\newtoks\toksfiledefii 
22    \def\ifnot#1{#1\else\expandafter\expandafter\fi\iffalse\iftrue\fi} 
23    \def\filedef#1#2{%#1=command name, #2=file name 
24            \openin\defin=#2\relax\def#1{} 
25            \ifeof\defin
26                    \message{***************** CAN NOT OPEN #2 ********************}
27                    \end
28            \fi 
29            \loop\ifnot{\ifeof\defin}\read\defin to\tempfiledef
30            \toksfiledefi=\expandafter{#1}% 
31            \toksfiledefii=\expandafter{\tempfiledef}% 
32    %        \expandafter\special\expandafter{!\the\toksfiledefi\the\toksfiledefii}\repeat%
33           \global\edef#1{\the\toksfiledefi\the\toksfiledefii}\repeat%
34    }
35    %
36    % This seems a little backwards, but we don't want to include the PS
37    % stuff too early
38    %
39    \filedef\includelilyps{lily.ps}%
40    \expandafter\special{! \includelilyps }
41 }
42