lilypond-1.1.7
[lilypond.git] / tex / lily-ps-defs.tex
blob93bf012315193ee3f29a11aac74d930c979dbdf9
2 % WARNING: don't leave blank lines in the PS-code; they are
3 % transformed into \par
7 % header info (macros/defs, etc) should go into a \special{! ... },
8 % note the ! sign. See dvips.info for details.
11 % Use of
12 % /foo { operatorname } bind def
14 % ``compiles'' operatorname binding in the body of foo, making
15 % the code faster, and more reliable (less flexible)
17 % transplant a TeX dimension into the PS output.
18 \def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\the\csname #1\endcsname) deftexdimen}}
20 \def\par{ }% %Ugh. Don't try this at home, kids!
21 % neat file-include trick by Piet van Oostrum <piet@cs.uu.nl>
22 \newread\defin
23 \newtoks\toksfiledefi\newtoks\toksfiledefii
24 \def\ifnot#1{#1\else\expandafter\expandafter\fi\iffalse\iftrue\fi}
25 \def\filedef#1#2{%#1=command name, #2=file name
26 \openin\defin=#2\relax\def#1{}
27 \ifeof\defin
28 \message{***************** CAN NOT OPEN #2 ********************}
29 \end
30 \fi
31 \loop\ifnot{\ifeof\defin}\read\defin to\tempfiledef
32 \toksfiledefi=\expandafter{#1}%
33 \toksfiledefii=\expandafter{\tempfiledef}%
34 % \expandafter\special\expandafter{!\the\toksfiledefi\the\toksfiledefii}\repeat%
35 \global\edef#1{\the\toksfiledefi\the\toksfiledefii}\repeat%
38 % This seems a little backwards, but we don't want to include the PS
39 % stuff too early
41 \filedef\includelilyps{lily.ps}%
42 \expandafter\special{! \includelilyps}
46 \special{!
47 % PS helper: convert (0.2pt) to the token 0.2
48 /settexdimen
50 /thestring exch def
51 thestring 0 thestring length 2 sub
52 getinterval
53 token
54 pop exch pop
55 } def
57 /deftexdimen
59 settexdimen
60 def
61 } def
64 \def\turnOnPostScript{%
65 \PSsetTeXdimen{stafflinethickness}
66 \PSsetTeXdimen{staffheight}
68 % This sets CTM so that you get to the currentpoint
69 % by executing a 0 0 moveto
70 \def\embeddedps##1{%
71 \special{ps: @beginspecial @setspecial ##1 @endspecial}
75 \special{!
76 /interline \mudelapaperinterline0 def % ugh. Only works x.yyyy floats
77 interline 3 div /bracket_b exch def
78 interline 2 mul /bracket_w exch def
79 stafflinethickness 2 mul /bracket_t exch def
80 interline 1.5 mul /bracket_v exch def
81 bracket_v /bracket_u exch def
82 50 /bracket_alpha exch def
83 staffheight 4 div /interline exch def
84 stafflinethickness 1.2 mul /tuplet_t exch def
85 1 setlinecap}
88 \def\turnOnExperimentalFeatures{}