Re: "Hide" the tagline

2017-02-27 Thread Klaus Blum
Hi Simon, 


Simon Albrecht-2 wrote
> You could just as well have written
> make-tagline-color-markup = #make-transparent-markup
> or maybe even (I’m not sure if that does work for markup commands yet)
> tagline-color = \markup\transparent \etc

I'm not that familiar with scheme, so I'm alway glad if there is a way to do
it in LilyPond syntax. I also tried the \etc method, but without any
success. Is there any documentation of that new feature?


Simon Albrecht-2 wrote
> And, as Urs already said, he was looking for a way that does _not_ 
> require changing the input file at all.

IIUC he doesn't mind having some kind of preparation in the input file:


Urs Liska wrote
> It's ok to insert something in the input file but it should be, well,
> non-intrusive.

Once the input file is finished, it can be left "as is". Compilation results
afterwards only depend on the contents of the include file. That should be
suitable even for automated batch processing. 

Cheers, 
Klaus





--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Hide-the-tagline-tp200532p200555.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "Hide" the tagline

2017-02-27 Thread Simon Albrecht

Am 27.02.2017 um 18:55 schrieb Klaus Blum:

Urs Liska wrote

I'm looking for a way to "externally" hide the tagline, i.e. by either
making it transparent or colouring it white.

Coloring white leaves invisible but useless stuff at the bottom.
So maybe better:

% -- color.ily 
#(define-markup-command (tagline-color layout props text)
(markup?)
(interpret-markup layout props
  #{
\markup{ \transparent $text }
  #}))
% -


You could just as well have written
make-tagline-color-markup = #make-transparent-markup
or maybe even (I’m not sure if that does work for markup commands yet)
tagline-color = \markup\transparent \etc
The ‘conditional’ part is missing.




% == main document 
\paper {ragged-last-bottom = ##f}
\header {
   tagline = \markup \tagline-color { use \rotate #90 so
much space }
}
{
   \repeat unfold 10 {c'1 \break}
}
% =


And, as Urs already said, he was looking for a way that does _not_ 
require changing the input file at all.


Best, Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "Hide" the tagline

2017-02-27 Thread Klaus Blum
Urs Liska wrote
> I'm looking for a way to "externally" hide the tagline, i.e. by either
> making it transparent or colouring it white.

Coloring white leaves invisible but useless stuff at the bottom. 
So maybe better:

% -- color.ily 
#(define-markup-command (tagline-color layout props text)
   (markup?)
   (interpret-markup layout props
 #{
   \markup{ \transparent $text }
 #}))
% -

% == main document 
\paper {ragged-last-bottom = ##f}
\header {
  tagline = \markup \tagline-color { use \rotate #90 so
much space }
}
{
  \repeat unfold 10 {c'1 \break}
}
% =



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Hide-the-tagline-tp200532p200550.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "Hide" the tagline

2017-02-27 Thread Klaus Blum
Hi Urs, 


Urs Liska wrote
> 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.

I once read that you are used to work with include files. 
How about that: Put only the color definition into a separate include file:

% -- color.ily 
tagline-color = #blue  % or whatever color
% -

% == main document 
\include "color.ily"
\header {
  tagline = \markup \with-color \tagline-color "Here is the tagline -
visible or not"
}
{c'}
% =

Does that work?

Cheers, 
Klaus




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Hide-the-tagline-tp200532p200549.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "Hide" the tagline

2017-02-27 Thread Thomas Morley
2017-02-27 14:04 GMT+01:00 Urs Liska <u...@openlilylib.org>:
>
>
> Am 27.02.2017 um 13:26 schrieb David Kastrup:
>> Urs Liska <u...@openlilylib.org> 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

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "Hide" the tagline

2017-02-27 Thread Urs Liska


Am 27.02.2017 um 13:26 schrieb David Kastrup:
> Urs Liska <u...@openlilylib.org> 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

-- 
u...@openlilylib.org
https://openlilylib.org
http://lilypondblog.org


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "Hide" the tagline

2017-02-27 Thread David Kastrup
Urs Liska <u...@openlilylib.org> 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

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "Hide" the tagline

2017-02-27 Thread Simon Albrecht

Am 27.02.2017 um 13:13 schrieb Urs Liska:

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 get your point, but it doesn’t seem very realistic. I may be mistaken, 
but short of patching LilyPond and adding a proper command-line option 
to do this I can’t imagine anything else…


Best, Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "Hide" the tagline

2017-02-27 Thread Urs Liska


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.

Urs


> HTH, Simon

-- 
u...@openlilylib.org
https://openlilylib.org
http://lilypondblog.org


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: "Hide" the tagline

2017-02-27 Thread 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.

HTH, Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


"Hide" the tagline

2017-02-27 Thread 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.

TIA
Urs


-- 
u...@openlilylib.org
https://openlilylib.org
http://lilypondblog.org


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user