lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Using Scheme inside header markup


From: Sven Axelsson
Subject: RE: Using Scheme inside header markup
Date: Tue, 12 Jul 2005 19:32:47 +0200

> From: Nicolas Sceaux [mailto:address@hidden 
> Subject: Re: Using Scheme inside header markup
> 
> "Sven Axelsson" <address@hidden> writes:
> 
> > Great. Now it works that far. What I acually want to do here is to
> > detect if Lilypond has been called with the --preview flag and then
> > turn off my comment field in the header. 
> >
> > I asked that question some days ago and got this answer 
> from Han-Wen:
> >
> >> You could use -dno-verbose-header and then read the 
> >> result with ly:get-option.
> >
> > So I thought I just could do
> > #(ly:export (if (ly:get-option 'preview) (markup ...)))
> >
> > but that doesn't work. I get an error "Unknown global option".
> 
> Do you really get an error, or rather a warning?
> 
> > Obviously only a few options are transfered from main.cc
> > and preview is not one of them. Han-Wen, how should I do this?
> 
> When invoking lilypond with --preview, add eg. a 
> -dshort-header option on
> the command line. Then, test with ly:get-option whether the 
> short-header
> option is selected or not:
> 
>       #(ly:export (if (not (ly:get-option 'short-header))
>                       (markup #:fromproperty 'header:comment)
>                       (markup)))
> 
> Thus:
>   $ lilypond --preview -dshort-header myfile.ly
> will produce the preview image with short headers, and:
>   $ lilypond myfile.ly
> will produce the score with full headers.

Aha! I didn't quite understand how that was supposed to work.
Now I'm calling lily from a batch file that looks like this

"%ProgramFiles%\lilypond\usr\bin\lilypond.exe" --preview -dresolution=72
-dno-comment %~n1.ly
"%ProgramFiles%\lilypond\usr\bin\lilypond.exe" --pdf %~n1.ly

And I have this in my header markup:

#(ly:export (if (not (ly:get-option 'no-comment)) 
             (markup #:frompropery 'header:comment) 
             (markup)))

But I still get the header with the comment field in both cases.

Also, I tried --preview --no-pages as suggested in the manual, but
then lily fails immediately, producing no output, not even a log file.

-- 
Sven Axelsson





reply via email to

[Prev in Thread] Current Thread [Next in Thread]