lilypond-user
[Top][All Lists]
Advanced

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

Re: "Hide" the tagline


From: Thomas Morley
Subject: Re: "Hide" the tagline
Date: Mon, 27 Feb 2017 18:19:39 +0100

2017-02-27 14:04 GMT+01:00 Urs Liska <address@hidden>:
>
>
> Am 27.02.2017 um 13:26 schrieb David Kastrup:
>> Urs Liska <address@hidden> writes:
>>
>>> Am 27.02.2017 um 13:08 schrieb Simon Albrecht:
>>>> Am 27.02.2017 um 12:42 schrieb Urs Liska:
>>>>> Hi all,
>>>>>
>>>>> I'm looking for a way to "externally" hide the tagline, i.e. by either
>>>>> making it transparent or colouring it white.
>>>>>
>>>>> The "problem" is that I don't want to do it in the tagline markup
>>>>> definition itself but by injecting some code when invoking LilyPond. The
>>>>> intention is to write a wrapper script that hides the tagline of an
>>>>> arbitrary given score without affecting the layout.
>>>> Maybe you can invoke something like
>>>> #(define hide-tagline #t)
>>>> through the -e command line option,
>>>> write a markup command transparent-cond which applies the \transparent
>>>> command to its argument depending on the value of ̀€hide-tagline'
>>>> and use that to wrap the tagline markup in bookTitleMarkup.
>>>>
>>> I think that's too intrusive and imposes too many assumptions about the
>>> input file. What I need is a solution to take an arbitrary input file
>>> and compile it without a tagline.
>>>
>>> It's ok to insert something in the input file but it should be, well,
>>> non-intrusive.
>> I see the option
>>
>>    -dinclude-settings=$LILYPOND_GIT/scripts/auxiliar/NoTagline.ly
>>
>> in scripts/auxiliar/make-regtest-pngs.sh
>>
>
> Unfortunately this doesn't help as it only adds a \header { tagline = ##f }
>
> This would at least require me ti ensure that I place the command
> *after* any header blocks in the input file. Additionally it's
> equivalent to \omit and not to \hide (so it may change the layout if
> someone creates a tagline with some vertical extent.
>
> Urs


Hi Urs,

I stored the code below in atest-50.ly

\version "2.19.52"

%% needed, see -e option in Usage-doc
%% a warning will be printed:
%% imported module (guile-user) overrides core binding
`%module-public-interface'
#(use-modules (guile-user))

#(let* ((paper-tagline
          (if (module? (ly:output-def-scope $defaultpaper))
              (module-ref (ly:output-def-scope $defaultpaper) 'tagline #f)
              #f))
        (header-tagline
          (if (module? $defaultheader)
              (module-ref $defaultheader 'tagline #f)
              #f)))

      (if (and header-tagline (defined? 'transparent?) (->bool transparent?))
          (module-define! $defaultheader 'tagline
            (markup #:with-color red header-tagline)))

      (if (and paper-tagline (defined? 'transparent?) (->bool transparent?))
          (ly:output-def-set-variable! $defaultpaper 'tagline
            (markup #:with-color red paper-tagline))))

The file to be compiled with hidden tagline is atest-49.ly

With the following commandline I've succeeded:
lilypond -e '(define transparent? #t)' -dinclude-settings=atest-49.ly
-o atest-49 atest-50.ly

For now the tagline is set red, replace it with tranparent.
Ofcourse you would need to set pathes correctly.


HTH,
  Harm



reply via email to

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