lilypond-user
[Top][All Lists]
Advanced

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

Re: \include & Headers


From: Michael Gerdau
Subject: Re: \include & Headers
Date: Thu, 12 Sep 2024 07:45:47 +0200
User-agent: Mozilla Thunderbird

Dear Dimitri,

please ALWAYS include the list when answering to a post!

I've looked at the code you provided. There are several things that do not make it minimal. I've attached a heavily edited version that still is not minimal but much smaller and thus easier to understand.

0.) Apparently you use Version 2.24.4 but in your initial post you link to the documentaion of 2.22. Why not use the documentation for 2.24?

1.) When you look at the examples in the docuemntation you may realize that there are headers outside and inside of \score blocks. That's for a reason. Your original code basically overwrites the global header block with each included file. Same for \paper and \layout. The section headers should go inside the corresponding score blocks. Same with section layouts (if you have them)

2.) Your \score blocks are inside of \markup. Move them out and things work.

3.) Reread the paragraph about titles and headers as there are a few things you do not yet seem to understand. There's also a template that should cover most of the stuff you want to achieve. Start from there and add fancy formatting once the overall structure works. Also read up on file structure in chapter "4.1 Page layout" ff. in the manual. That should add to your understanding of the various levels of hierarchy for the various blocks. You may want to consider to put each chapter into a separate \bookpart.

The above probably doesn't solve all your problems but it should get you started.

Kind regards,
Michael



Am 11.09.24 um 23:40 schrieb Dimitri Sykias:
MAIN FILE
—————————
\version "2.24.4"
\paper {
   #(define fonts
      (set-global-fonts
       #:music "emmentaler"
       #:brace "emmentaler"
       #:roman "Minion Pro"
       #:sans "Minion Pro"
       #:typewriter "Minion Pro"
       #:factor (/ staff-height pt 20)
       ))
   #(define-markup-list-command (paragraph layout props args) (markup-list?)
      (interpret-markup-list layout props
                             (make-justified-lines-markup-list (cons 
(make-hspace-markup 2) args))))
   top-margin = 1.6 \cm
   bottom-margin = 1 \cm
   left-margin = 1.8 \cm
   right-margin =1.8 \cm
   ragged-bottom = ##t
   ragged-last-bottom = ##t
   print-page-number = ##t
   first-page-number = 34
   oddHeaderMarkup = \markup \override #'(font-name . "TeX Gyre Pagella Bold")
   \fill-line {
     ""
     \unless \on-first-page-of-part \fromproperty #'header:instrument
     \if \should-print-page-number \fromproperty #'page:page-number-string
   }
   evenHeaderMarkup = \markup \override #'(font-name . "TeX Gyre Pagella Bold")
   \fill-line {
     \if \should-print-page-number \fromproperty #'page:page-number-string
     \unless \on-first-page-of-part \fromproperty #'header:instrument
     ""
   }
   score-markup-spacing.basic-distance = 8
}
\layout {
   indent = #8
   #(layout-set-staff-size 18)
   ragged-last = ##t
   \context {
     \Score
     \consists "Horizontal_bracket_engraver"
     \override HorizontalBracket.direction = #UP
     \override HorizontalBracket.thickness  = 2
   }
   \override LyricText.font-name = "Edwin"
}

\include "01. 2part-1.ly"
\include "02. 2part-2.ly"

FILE 01. 2part-1
———————————
\version "2.24.4"
\paper {
   #(define fonts
      (set-global-fonts
       #:music "emmentaler"
       #:brace "emmentaler"
       #:roman "Minion Pro"
       #:sans "Minion Pro"
       #:typewriter "Minion Pro"
       #:factor (/ staff-height pt 20)
       ))
   #(define-markup-list-command (paragraph layout props args) (markup-list?)
      (interpret-markup-list layout props
                             (make-justified-lines-markup-list (cons 
(make-hspace-markup 2) args))))
   top-margin = 1.6 \cm
   bottom-margin = 1 \cm
   left-margin = 1.8 \cm
   right-margin =1.8 \cm
   ragged-bottom = ##t
   ragged-last-bottom = ##t
   print-page-number = ##t
   first-page-number = 34
   oddHeaderMarkup = \markup \override #'(font-name . "TeX Gyre Pagella Bold")
   \fill-line {
     ""
     \unless \on-first-page-of-part \fromproperty #'header:instrument
     \if \should-print-page-number \fromproperty #'page:page-number-string
   }
   evenHeaderMarkup = \markup \override #'(font-name . "TeX Gyre Pagella Bold")
   \fill-line {
     \if \should-print-page-number \fromproperty #'page:page-number-string
     \unless \on-first-page-of-part \fromproperty #'header:instrument
     ""
   }
   score-markup-spacing.basic-distance = 8
}
\layout {
   indent = #8
   #(layout-set-staff-size 18)
   ragged-last = ##t
   \context {
     \Score
     \consists "Horizontal_bracket_engraver"
     \override HorizontalBracket.direction = #UP
     \override HorizontalBracket.thickness  = 2
   }
   \override LyricText.font-name = "Edwin"
}

% HEADER
\header {
   title = \markup { \magnify #1.4 \with-color #grey { Title 1 } }
   subtitle = \markup { \magnify #1.4 \with-color #darkblue { Subtitle 1 }}
   copyright = "3euk1L4 • 2024"
   tagline = ""
}

% ///// END OF PRELUDE /////

\markup \vspace #1
\markup { \justify { Lorem ipsum dolor sit amet, consectetur adipiscing elit, 
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad 
minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea 
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit 
esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat 
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. }}
\markup \vspace #0.3
\markup \fill-line {
   \override #'(baseline-skip . 10) \center-column {
     \line { \score {
       \relative c' {
         \time 4/4
         \override Staff.TimeSignature.stencil = ##f
         \override Slur.color = #darkgreen
         % m1
         g'4
         \override Voice.NoteHead.color = #darkgreen
         \override Voice.Stem.color = #darkgreen
         e
         (g)
         \override Voice.NoteHead.color = #black
         \override Voice.Stem.color = #black
         a \bar "||"
         % m2
         c b
         \override Voice.NoteHead.color = #darkgreen
         \override Voice.Stem.color = #darkgreen
         a
         (f) \bar "."
         % m3
         \override Slur.color = #red
         \override Voice.NoteHead.color = #black
         \override Voice.Stem.color = #black
         e
         \override Voice.NoteHead.color = #red
         \override Voice.Stem.color = #red
         f
         (a)
         \override Voice.NoteHead.color = #black
         \override Voice.Stem.color = #black
         g \bar "||"
         % m4
         \override Voice.NoteHead.color = #red
         \override Voice.Stem.color = #red
         c
         (a)
         \override Voice.NoteHead.color = #black
         \override Voice.Stem.color = #black
         g \override Staff.NoteHead.color = #black
         f \bar "."
}}}}}


FILE 02. 2part-1
———————————

\version "2.24.4"
\paper {
   #(define fonts
      (set-global-fonts
       #:music "emmentaler"
       #:brace "emmentaler"
       #:roman "Minion Pro"
       #:sans "Minion Pro"
       #:typewriter "Minion Pro"
       #:factor (/ staff-height pt 20)
       ))
   #(define-markup-list-command (paragraph layout props args) (markup-list?)
      (interpret-markup-list layout props
                             (make-justified-lines-markup-list (cons 
(make-hspace-markup 2) args))))
   top-margin = 1.6 \cm
   bottom-margin = 1 \cm
   left-margin = 1.8 \cm
   right-margin =1.8 \cm
   ragged-bottom = ##t
   ragged-last-bottom = ##t
   print-page-number = ##t
   first-page-number = 34
   oddHeaderMarkup = \markup \override #'(font-name . "TeX Gyre Pagella Bold")
   \fill-line {
     ""
     \unless \on-first-page-of-part \fromproperty #'header:instrument
     \if \should-print-page-number \fromproperty #'page:page-number-string
   }
   evenHeaderMarkup = \markup \override #'(font-name . "TeX Gyre Pagella Bold")
   \fill-line {
     \if \should-print-page-number \fromproperty #'page:page-number-string
     \unless \on-first-page-of-part \fromproperty #'header:instrument
     ""
   }
   score-markup-spacing.basic-distance = 8
}
\layout {
   indent = #8
   #(layout-set-staff-size 18)
   ragged-last = ##t
   \context {
     \Score
     \consists "Horizontal_bracket_engraver"
     \override HorizontalBracket.direction = #UP
     \override HorizontalBracket.thickness  = 2
   }
   \override LyricText.font-name = "Edwin"
}

% HEADER
\header {
   title = \markup { \magnify #1.4 \with-color #grey { Title 2 } }
   subtitle = \markup { \magnify #1.4 \with-color #darkblue { Subtitle 2 }}
   copyright = "3euk1L4 • 2024"
   tagline = ""
}
% END OF PRELUDE
\markup \vspace #1
\markup \vspace #1
\markup { \justify { Lorem ipsum dolor sit amet, consectetur adipiscing elit, 
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad 
minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea 
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit 
esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat 
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. }}

\markup \vspace #1
\markup \fill-line {
   \override #'(baseline-skip . 10) \center-column {
     \line { \score {
       \relative c'{
         \numericTimeSignature
         \time 2/2
         \clef percussion
         \override Staff.StaffSymbol.line-positions = #'(2 -2)
         <<
           {
             %$\override Script.color = #blue
             e2 e \bar "||"
             \time 4/2
             e2 e e e \bar "||"
           }
           \\
           \override NoteHead.color = #blue
           { a,1 a a }
         >>
}}}}}

--
 Michael Gerdau       email: mgd@qata.de
 GPG-keys available on request or at public keyserver

Attachment: headers_inside_score.ly
Description: Text Data


reply via email to

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