Jean-Pierre Coulon wrote:
> I have made macros containing a spacing command and an accidental. I want
> to make *two* versions of my score. One with both commands active, the
> other with both inactive. Therefore I'va made macros with \ifx.
>
> But why are the beam starts displaced with my definitions using \ifx?
> Please try the simple and complicated definitions in the attached file.
You put the \off commands in a group - although they are not completely
identical, { and } behave like \begingroup and \endgroup and register values
are saved at the start of the group and restored at the end (MusixTeX correctly
does very little \global-ly). The effect of placing \off inside a group is that
the register values which are tracking spacing become "corrupt" and you see
that in the beam spacing errors.
\if does not require a \else and furthermore the block of an \if doesn't need
any macros - so both the \empty and the \else are not required (\iftrue\fi is
perfectly valid TeX - it just doesn't actually do anything).
In this case, there's a better way of writing what you're doing: \newif is your
friend.
\newif\ifurtext
% Uncomment for the Urtext version
%\urtexttrue
\ifurtext
\let\mysk=\relax
\def\mysksh#1{}
\let\myskna#1{}
\else
\def\mysk{\off{.8\elemskip}}
\def\mysksh#1{...}
...
\fi
Although I'd go one step further:
\newif\ifurtext
% Uncomment for the Urtext version
%\urtexttrue
\ifurtext
\def\udef#1#{\udefn{#1}}
\def\udefn#1#2{\def#1{}}
\else
\let\udef=\def
\fi
\udef\mysk{\off{.8\elemskip}}
\udef\mysksh#1{...}
\udef\myskna#1{...}
Personally, I've found that Knuth's TeXbook contains all you'll ever need to
know about TeX - it lives on my desk!
David
-------------------------------
[email protected] mailing list
If you want to unsubscribe or look at the archives, go to
http://tug.org/mailman/listinfo/tex-music