lilypond-user
[Top][All Lists]
Advanced

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

Re: Markup in left and right margins


From: Aaron Hill
Subject: Re: Markup in left and right margins
Date: Thu, 15 Oct 2020 18:46:53 -0700
User-agent: Roundcube Webmail/1.4.9

On 2020-10-15 6:03 pm, Matthew Fong wrote:
Many thanks for the solution of translation. I'm toying around with it
right now, and had a question:
I am possible misunderstanding the solution, and using the abs-override
incorrectly. I cannot seem to place a comment string next to the stave.

The code I showed was purely to demonstrate that you *could* move things outside the margins. But it was not prescriptive. In practice, take a simpler route:

%%%%
\version "2.20.0"

\paper {
  #(set-paper-size "a6landscape")
  top-margin = 1.5\cm bottom-margin = 3\cm
  left-margin = 2\cm right-margin = 2.5\cm
  indent = 0 ragged-right = ##f
}

loremIpsum =
\markup
  \override #'(baseline-skip . 2.5)
  \smaller \left-column {
    \line { Lorem ipsum dolor sit amet, }
    \line { consectetur adipscing elit. }
  }

\markup
  % Collapse dimensions so the \markup takes no space.
  \with-dimensions-from \null

  % Move the \markup further into the left margin.
  \translate #'(-1 . 0)

  % Adjust alignment of \markup to top-right corner.
  \general-align #X #RIGHT
  \general-align #Y #UP

  % The \markup itself.
  \rotate #90 \with-color #red \loremIpsum

% NOTE:
% The \fill-line { \null ... } pattern is useful for
% aligning content to the right margin automatically.

\markup \fill-line { \null
  % Collapse dimensions so the \markup takes no space.
  \with-dimensions-from \null

  % Move the \markup further into the right margin.
  \translate #'(1 . 0)

  % Adjust alignment of \markup to top-left corner.
  \general-align #X #LEFT
  \general-align #Y #UP

  % The \markup itself.
  \rotate #-90 \with-color #blue \loremIpsum
}

\new Staff \fixed c'' {
  c1^\markup \with-color #green \loremIpsum
}
%%%%

Given the above approach, there is no need to mess about with "absolute" measurements. Staff space units are generally pretty nice to work with anyway.


-- Aaron Hill

Attachment: margin-markup.png
Description: PNG image


reply via email to

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