|
From: | Abbé Jacques Peron |
Subject: | Re: [OT] Linux Users |
Date: | Sun, 19 Nov 2017 20:54:47 +0100 |
Just tried that, and it doesn’t work :
address@hidden
address@hidden
address@hidden@currenv address@hidden
\else \expandafter \lily \fi}
I think it has something to do with \expandafter
, but I don’t know TeX enough to be sure…
Neither are called lilypond. It's not particularly great, but there are
examples for the sharing of command and environment. Basically you
check whether @currenvir is set to LilyPond. As long as you don't
_nest_ those constructs...
The environment is defined as `ly`, but there is a `lilypond` alias. So `\begin{lilypond}` just works.Basically:
\newenvironment{lilypond}
{...}
{...}
\newcommand{\lilypondcommand}{...}
address@hidden
\protected\def\lilypond{\def\raddress@hidden
address@hidden@currenv address@hidden
\else \expandafter \lilypondcommand \fi}
Ugly, sure. But I think LilyPond upstream would be sympathetic to
making command and environment named differently in the long run.
I'm going to try it just now.I don’t know enough about (La?)TeX internals to understand the code above but if you redefined the command \lilypond, would things like the following still be possible?
\newenvironment{dly}{
\center
\ly
\language "deutsch"
\paper {
##(define fonts
(set-global-fonts
##:music "cadence"
##:brace "cadence"
##:roman "Vollkorn"
##:factor (/ staff-height pt 20)))
}
\layout {
% some other general things
}
% some includes and function definitions
}{\endly\endcenter}As you are using `\ly`, as soon as I don't modify it, it'll work.
[Prev in Thread] | Current Thread | [Next in Thread] |