Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
LilyPond wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Adding links to objects
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
To add a link to a grob stencil you can use <code>add-link</code> as defined here. It works both with <code>\override</code> and <code>\tweak</code>. Drawback: <code>point-and-click</code> is disturbed for the linked grobs. Limitation: Works for PDF only. The linked objects are colored with a separate command. Note that the links are not displayed and are not clickable from inside the LSR. <lilypond version="2.24.0"> #(define (add-link url-strg) (lambda (grob) (let* ((stil (ly:grob-property grob 'stencil))) (if (ly:stencil? stil) (let* ((x-ext (ly:stencil-extent stil X)) (y-ext (ly:stencil-extent stil Y)) (url-expr `(url-link ,url-strg ,x-ext ,y-ext)) (new-stil (ly:stencil-add (ly:make-stencil url-expr x-ext y-ext) stil))) (ly:grob-set-property! grob 'stencil new-stil)))))) %%%% test %% For easier maintenance of this snippet the URL is formatted to use the %% actually used LilyPond version. %% Of course a literal URL would work as well. #(define major.minor-version (string-join (take (string-split (lilypond-version) #\.) 2) ".")) urlI = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/writing-pitches" major.minor-version) urlII = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/rhythms" major.minor-version) urlIII = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/note-heads" major.minor-version) urlIV = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/beams" major.minor-version) urlV = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/note-head-styles" major.minor-version) urlVI = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/writing-pitches" major.minor-version) \relative c' { \key cis \minor \once \override Staff.Clef.color = #green \once \override Staff.Clef.after-line-breaking = #(add-link urlI) \once \override Staff.TimeSignature.color = #green \once \override Staff.TimeSignature.after-line-breaking = #(add-link urlII) \once \override NoteHead.color = #green \once \override NoteHead.after-line-breaking = #(add-link urlIII) cis'1 \once \override Beam.color = #green \once \override Beam.after-line-breaking = #(add-link urlIV) cis8 dis e fis gis2 <gis, \tweak Accidental.color #green \tweak Accidental.after-line-breaking #(add-link urlVI) \tweak color #green \tweak after-line-breaking #(add-link urlV) \tweak style #'harmonic bis dis fis >1 <cis, cis' e> } </lilypond> [[Category:Editorial annotations]] [[Category:Tweaks and overrides]] [[Category:Scheme]] [[Category:Included in the official documentation]]
Summary:
Please note that all contributions to LilyPond wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Meta:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Adding links to objects
Add topic