| 1 |
% mtxlatex.sty: Macro package to make music scores using Latex |
| 2 |
% or produce LaTeX documents containing music examples |
| 3 |
% Dirk Laurie [email protected] 2001-12-27 |
| 4 |
% Update: see \mtxdate below |
| 5 |
% Some comments on usage appear at the bottom |
| 6 |
|
| 7 |
\ifx\mtxlatex\undefined\else\endinput\fi |
| 8 |
|
| 9 |
\def\MTx{\mbox{\textbf{\textsl{M-Tx}}}} |
| 10 |
\def\PMX{\textbf{PMX}} |
| 11 |
\def\musixlyr{\texttt{\textbf{musixlyr}}} |
| 12 |
|
| 13 |
\input musixtex |
| 14 |
\input musixltx |
| 15 |
|
| 16 |
% Preamble TeX commands for documents that contain .ex files |
| 17 |
% generated by M-Tx/PMX |
| 18 |
|
| 19 |
\def\mtxlatex{ |
| 20 |
\input musixmad |
| 21 |
\def\mtxversion{mtxLaTeX} |
| 22 |
\def\mtxdate{<16 March 2005>} |
| 23 |
\input mtx |
| 24 |
\renewcommand{\BIGfont}{\Huge\bfseries} |
| 25 |
\renewcommand{\Bigfont}{\Large\bfseries} |
| 26 |
% Kill the PMX definition of \parskip. |
| 27 |
\parskip=0pt plus 1pt |
| 28 |
} |
| 29 |
% Extra vertical space evenly spread between systems |
| 30 |
\renewcommand\alaligne{\stoppiece\vfill\contpiece} |
| 31 |
\def\scoreheight{\textheight 260mm} |
| 32 |
\def\scorewidth{\textwidth 193mm} |
| 33 |
|
| 34 |
\newcommand{\startscore}{\let\SmuF\startmuflex\let\EmuF\endmuflex |
| 35 |
\scorewidth\scoreheight |
| 36 |
\oddsidemargin -15mm\evensidemargin -15mm\topmargin -20mm |
| 37 |
\ifx\mysizes\undefined\else\mysizes\fi |
| 38 |
\let\startmuflex\relax\let\endmuflex\relax\let\bye\relax% |
| 39 |
\let\nopagenumbers\relax\musicparskip} |
| 40 |
\newcommand\headingandcontents[1]{\markboth{#1}{#1}\addcontentsline{toc} |
| 41 |
{section}{\protect\numberline{}{#1}}} |
| 42 |
|
| 43 |
% The environment 'Score' is suitable for scores submitted to the |
| 44 |
% Werner Icking music archive |
| 45 |
\newenvironment{Score}[2]{\headingandcontents{#1} |
| 46 |
\startscore\input #2 |
| 47 |
}{\markboth{}{}} |
| 48 |
|
| 49 |
% The environment 'score' requires you to do your own input |
| 50 |
\newenvironment{score}{\startscore}{} |
| 51 |
|
| 52 |
\newenvironment{excerpts}{ |
| 53 |
\newlength\keepOSM\setlength\keepOSM\oddsidemargin |
| 54 |
\newlength\keepTM\setlength\keepTM\topmargin |
| 55 |
\global\setlength\oddsidemargin{-13mm} \global\setlength\topmargin{-20mm} |
| 56 |
\let\startmuflex\relax\let\endmuflex\relax |
| 57 |
\let\nopagenumbers\relax \let\bye\relax \let\vfill\relax \let\eject\relax |
| 58 |
\musicparskip |
| 59 |
\renewcommand{\BIGfont}{\Large\bfseries} |
| 60 |
\renewcommand{\Bigfont}{\large\bfseries} |
| 61 |
}{\global\setlength\oddsidemargin\keepOSM\global\setlength\topmargin\keepTM} |
| 62 |
|
| 63 |
\newenvironment{mus}% |
| 64 |
{\begin{minipage}{260mm}\startscore\musicparskip}% |
| 65 |
{\assignlyrics1{}\assignlyrics2{}% |
| 66 |
\gdef\mtxTitle{}\end{minipage}} |
| 67 |
|
| 68 |
\def\example#1#2#3#4#5#6#7#8{ |
| 69 |
\noindent\begin{minipage}[t]{#3} |
| 70 |
\begin{mus} \vskip #6 |
| 71 |
\input{#1.tex} |
| 72 |
\end{mus} |
| 73 |
\end{minipage}\hskip #4 |
| 74 |
\begin{minipage}[#7]{#5} \vskip #8 |
| 75 |
\verbatiminput{#1.#2} |
| 76 |
\end{minipage}} |
| 77 |
|
| 78 |
\endinput |
| 79 |
|
| 80 |
============================================================================ |
| 81 |
|
| 82 |
\example{basename}{ext} |
| 83 |
{musicwidth}{separation}{codewidth} |
| 84 |
{musicvskip}{alignment}{codevskip} |
| 85 |
|
| 86 |
Set music example together with M-Tx (or other) code. |
| 87 |
|
| 88 |
basename - musicfile is basename.tex |
| 89 |
ext - codefile is basename.ext |
| 90 |
separation - distance between music and code minipages |
| 91 |
alignment - c, t or b (for code minipage) |