summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/m-tx/mtx060/mtxlatex.sty
blob: 6061de4b40b390b6c263bd0c15296e790e7f2772 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
% mtxlatex.sty: Macro package to make music scores using Latex
%   or produce LaTeX documents containing music examples
%   Dirk Laurie  dlaurie@na-net.ornl.gov  2001-12-27
%   Update: see \mtxdate below
% Some comments on usage appear at the bottom

\ifx\mtxlatex\undefined\else\endinput\fi

\def\MTx{\mbox{\textbf{\textsl{M-Tx}}}}
\def\PMX{\textbf{PMX}}
\def\musixlyr{\texttt{\textbf{musixlyr}}}

\input musixtex
\input musixltx

%  Preamble TeX commands for documents that contain .ex files
%   generated by M-Tx/PMX

\def\mtxlatex{
\input musixmad
\def\mtxversion{mtxLaTeX}
\def\mtxdate{<16 March 2005>}
\input mtx
\renewcommand{\BIGfont}{\Huge\bfseries}
\renewcommand{\Bigfont}{\Large\bfseries} 
% Kill the PMX definition of \parskip.
\parskip=0pt plus 1pt
}
% Extra vertical space evenly spread between systems
\renewcommand\alaligne{\stoppiece\vfill\contpiece}
\def\scoreheight{\textheight 260mm}
\def\scorewidth{\textwidth 193mm}

\newcommand{\startscore}{\let\SmuF\startmuflex\let\EmuF\endmuflex
\scorewidth\scoreheight
\oddsidemargin -15mm\evensidemargin -15mm\topmargin -20mm
\ifx\mysizes\undefined\else\mysizes\fi
\let\startmuflex\relax\let\endmuflex\relax\let\bye\relax%
\let\nopagenumbers\relax\musicparskip}
\newcommand\headingandcontents[1]{\markboth{#1}{#1}\addcontentsline{toc}
  {section}{\protect\numberline{}{#1}}}

% The environment 'Score' is suitable for scores submitted to the
% Werner Icking music archive
\newenvironment{Score}[2]{\headingandcontents{#1}
\startscore\input #2
}{\markboth{}{}}

% The environment 'score' requires you to do your own input
\newenvironment{score}{\startscore}{}

\newenvironment{excerpts}{
\newlength\keepOSM\setlength\keepOSM\oddsidemargin
\newlength\keepTM\setlength\keepTM\topmargin
\global\setlength\oddsidemargin{-13mm} \global\setlength\topmargin{-20mm}
\let\startmuflex\relax\let\endmuflex\relax
\let\nopagenumbers\relax \let\bye\relax \let\vfill\relax \let\eject\relax
\musicparskip
\renewcommand{\BIGfont}{\Large\bfseries}
\renewcommand{\Bigfont}{\large\bfseries}
}{\global\setlength\oddsidemargin\keepOSM\global\setlength\topmargin\keepTM}

\newenvironment{mus}%
{\begin{minipage}{260mm}\startscore\musicparskip}%
{\assignlyrics1{}\assignlyrics2{}%
\gdef\mtxTitle{}\end{minipage}}

\def\example#1#2#3#4#5#6#7#8{
\noindent\begin{minipage}[t]{#3}
\begin{mus} \vskip #6
\input{#1.tex}
\end{mus}
\end{minipage}\hskip #4
\begin{minipage}[#7]{#5} \vskip #8
\verbatiminput{#1.#2}
\end{minipage}}

\endinput

============================================================================

\example{basename}{ext}
        {musicwidth}{separation}{codewidth}
        {musicvskip}{alignment}{codevskip}

Set music example together with M-Tx (or other) code.

basename   - musicfile is basename.tex
ext        - codefile is basename.ext
separation - distance between music and code minipages
alignment  - c, t or b (for code minipage)