]> git.donarmstrong.com Git - lilypond.git/blob - tex/lilyponddefs.tex
front port
[lilypond.git] / tex / lilyponddefs.tex
1 % lilyponddefs.tex
2 %
3 % Include file for LilyPond.
4 %
5 % This file defines various macros to accomodate lilypond output.
6 %
7 % Avoid \par while reading this file.
8 \edef\lilyponddefsELC{\the\endlinechar}%
9 \endlinechar -1\relax
10
11 % TeXbook ex 7.7
12 \def\ifundefined#1{
13   \expandafter\ifx\csname#1\endcsname\relax
14 }
15
16 % If we must make titles, do so, before we're skipped.
17
18 \ifx\mustmakelilypondtitle\undefined
19 \else
20   \makelilypondtitle
21 \fi
22
23 \ifx\mustmakelilypondpiecetitle\undefined
24 \else
25   \makelilypondpiecetitle
26 \fi
27
28 % skip if included already
29
30 \def\SkipLilydefs{
31   \endlinechar \lilyponddefsELC
32   \endinput}
33 \ifundefined{EndLilyPondOutput}
34   \def\EndLilyPondOutput{\csname bye\endcsname}
35   \def\SkipLilydefs{}
36 \fi
37 \SkipLilydefs
38
39 % need to do some stuff to turn page numbering off
40
41 \ifundefined{documentclass}
42   \input lilypond-plaintex
43 \else
44   \input lilypond-latex
45 \fi
46
47 % The feta characters
48 \input feta20
49
50 \font\fetasixteen = feta16
51 \def\fetafont{\fetasixteen}
52 \def\fetachar#1{\hbox{\fetasixteen#1}}
53
54 \def\botalign#1{
55   \vbox to 0pt{\vss #1}
56 }
57 \def\leftalign#1{
58   \hbox to 0pt{#1\hss}
59 }
60
61 % Attempt to keep lilypiecetitle together with the piece:
62
63 %
64 % TODO: figure this out.
65 %
66
67 \def\myfilbreak{}%\par\vfil\penalty200\vfilneg}
68
69
70 \ifundefined{lilypondpaperinterscorelinefill}
71   \def\lilypondpaperinterscorelinefill{0}
72 \else
73   \def\lilypondpaperinterscorelinefill{1}
74 \fi
75
76 \def\interscoreline{
77   \vskip \lilypondpaperinterscoreline \lilypondpaperunit
78     plus \lilypondpaperinterscorelinefill fill
79 }
80
81 \def\placebox#1#2#3{
82   \botalign{
83     \hbox{\raise #1\leftalign{\kern #2{}#3}}
84   }
85 }
86
87 % Are we using PDFTeX?  If so, use pdf definitions.
88 % MiKTeX checks \pdfoutput the wrong way; this makes our
89 % check more complicated.
90 \ifx\pdfoutput\undefined  
91   \input lily-ps-defs
92 \else
93   \ifx\pdfoutput\relax
94     \input lily-ps-defs
95   \else
96     \pdfoutput = 1
97     \input lily-pdf-defs
98   \fi
99 \fi
100
101 \def\EndLilyPondOutput{
102   \ifundefined{lilypondpaperlastpagefill}
103     \vskip 0pt plus \lilypondpaperinterscorelinefill00 fill
104   \fi
105   \csname bye\endcsname
106 }
107
108 % Need to do some stuff to turn page numbering off;
109 % they seriously mess up your fragments.
110
111 \ifx\csname nolilyfooter\endcsname\relax
112   \message{[footer defined]}
113   \csname lilyfooter\texsuffix\endcsname
114 \else
115   \message{[footer empty]}
116   \csname nolilyfooter\texsuffix\endcsname
117 \fi
118
119 % It is very bad that lilyponddefs.tex gets included in every lilypond
120 % output snippet.  This is necessary because these output snippets
121 % often get encapsulated, eg by texinfo. This should be fixed by
122 % putting the variable parts in this file into a macro so that loading
123 % the file multiple times can be avoided.
124 \ifx\outputscale\undefined
125   \csname global\endcsname\csname newdimen\endcsname\outputscale
126   \csname global\endcsname\csname newdimen\endcsname\scoreshift
127 \fi
128
129 % Restore newline functionality (disabled to avoid \par).
130 \endlinechar \lilyponddefsELC
131 \endinput