[prev in list] [next in list] [prev in thread] [next in thread]
List: lilypond-user
Subject: Re: Lilypond and digital readers
From: Laurie Savage <savage.laurie () gmail ! com>
Date: 2024-02-29 22:05:39
Message-ID: CAEZ3P8JwP9CAhuu09c1KjzGqGU_1OVqeQfO0=5+9h4cuNwfgew () mail ! gmail ! com
[Download RAW message or body]
Likewise, my setup includes \paper{} and \layout{} for printing and screen
display.
Laurie Savage
https://www.queensofthewest.com/
On Fri, 1 Mar 2024 at 00:18, Kevin Cole <dc.loco@gmail.com> wrote:
> This is similar to something I learned to do from this list. Thank you,
> list wizards.
>
> I generate scores for both printing (paginated PDFs) and displaying on a
> website generated by the Sphinx documentation system (unpaginated SVGs).
> Sometimes, I want to regenerate ALL the scores. So I have a Bash script to
> do the work and a command-line argument that determines which type (PDF or
> SVG) will be generated. I have two include scripts: svg.ily and pdf.ily
> (which I keep in ~/.local/lib/lilypond/). In all of my Frescobaldi
> templates, I have the lines:
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> % Use environment variable to decide if discrete pagination (PDF) or
> % continuous pagination (SVG). Default to SVG if not defined.
> %
> pageBreaking = #(string-append (getenv "HOME") "/.local/lib/lilypond/" (if
> (getenv "PAGE_BREAKING") (getenv "PAGE_BREAKING") "svg") ".ily")
> \include \pageBreaking
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> Then, in my Bash scripts, I can have code like:
>
> #######################################################
> for source in $(find . -name "*.ly")
> do
> PAGE_BREAKING=svg lilypond --svg $source
> # ... generate MP3 from MIDI, reduce SVG size, etc.
> done
> #######################################################
>
> The two include files:
>
> pdf.ily:
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> % PDF
> % 8.5" x 11" (Letter) page size
> %
>
> \paper {
> #(include-special-characters)
> #(set-paper-size "letter")
> print-page-number = ##f
> ragged-last-bottom = ##t
> }
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> svg.ily:
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> % Web SVG (Sphinx Cloud theme):
> % One long continuous page
> %
>
> #(ly:set-option 'backend 'cairo)
> \paper {
> #(include-special-characters)
> oddHeaderMarkup = \markup \null
> evenHeaderMarkup = \markup \null
> page-breaking = #ly:one-page-breaking
>
> #(define fonts
> (set-global-fonts
> #:roman "Open Sans"
> #:sans "Open Sans"
> #:typewriter "DejaVu Sans Mono"
> ; unnecessary if the staff size is default
> #:factor (/ staff-height pt 20)
> ))
> }
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
>
[Attachment #3 (text/html)]
<div dir="ltr"><div>Likewise, my setup includes \paper{} and \layout{} for printing \
and screen display.</div><div><br></div><div><div><div dir="ltr" \
class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Laurie \
Savage<div><a href="https://www.queensofthewest.com/" \
target="_blank">https://www.queensofthewest.com/</a></div></div></div></div></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 1 Mar 2024 at 00:18, \
Kevin Cole <<a href="mailto:dc.loco@gmail.com">dc.loco@gmail.com</a>> \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div \
dir="ltr"><div class="gmail_default" \
style="font-family:monospace;font-size:large">This is similar to something I learned \
to do from this list. Thank you, list wizards.</div><div class="gmail_default" \
style="font-family:monospace;font-size:large"><br></div><div class="gmail_default" \
style="font-family:monospace;font-size:large">I generate scores for both printing \
(paginated PDFs) and displaying on a website generated by the Sphinx documentation \
system (unpaginated SVGs). Sometimes, I want to regenerate ALL the scores. So I \
have a Bash script to do the work and a command-line argument that determines which \
type (PDF or SVG) will be generated. I have two include scripts: svg.ily and \
pdf.ily (which I keep in ~/.local/lib/lilypond/). In all of my Frescobaldi templates, \
I have the lines:</div><div class="gmail_default" \
style="font-family:monospace;font-size:large"><br></div><div class="gmail_default" \
style="font-family:monospace;font-size:large">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</div><div \
class="gmail_default" style="font-family:monospace;font-size:large">% Use environment \
variable to decide if discrete pagination (PDF) or<br>% continuous pagination (SVG). \
Default to SVG if not defined.<br>%<br>pageBreaking = #(string-append (getenv \
"HOME") "/.local/lib/lilypond/" (if (getenv \
"PAGE_BREAKING") (getenv "PAGE_BREAKING") "svg") \
".ily")<br>\include \pageBreaking<br><div \
class="gmail_default">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</div><div \
class="gmail_default" style="font-family:monospace;font-size:large"><br></div>Then, \
in my Bash scripts, I can have code like:</div><div class="gmail_default" \
style="font-family:monospace;font-size:large"><br></div><div class="gmail_default" \
style="font-family:monospace;font-size:large">#######################################################</div><div \
class="gmail_default" style="font-family:monospace;font-size:large">for source in \
$(find . -name "*.ly")</div><div class="gmail_default" \
style="font-family:monospace;font-size:large">do</div><div class="gmail_default" \
style="font-family:monospace;font-size:large"> PAGE_BREAKING=svg lilypond --svg \
$source</div><div class="gmail_default" \
style="font-family:monospace;font-size:large"> # ... generate MP3 from MIDI, reduce \
SVG size, etc.<br>done</div><div class="gmail_default" \
style="font-family:monospace;font-size:large"><div \
class="gmail_default">#######################################################</div><div \
class="gmail_default"><br></div>The two include files:</div><div \
class="gmail_default" \
style="font-family:monospace;font-size:large"><br>pdf.ily:<br><div \
class="gmail_default">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</div>% PDF<br>% 8.5" x \
11" (Letter) page size<br>%<br><br>\paper {<br> \
#(include-special-characters)<br> #(set-paper-size "letter")<br> \
print-page-number = ##f<br> ragged-last-bottom = \
##t<br>}<br>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</div><div class="gmail_default" \
style="font-family:monospace;font-size:large"><br></div><div class="gmail_default" \
style="font-family:monospace;font-size:large">svg.ily:</div><div \
class="gmail_default" \
style="font-family:monospace;font-size:large">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br></div><div \
class="gmail_default" style="font-family:monospace;font-size:large">% Web SVG (Sphinx \
Cloud theme):<br>% One long continuous page<br>%<br><br>#(ly:set-option 'backend \
'cairo)<br>\paper {<br> #(include-special-characters)<br> oddHeaderMarkup = \
\markup \null<br> evenHeaderMarkup = \markup \null<br> page-breaking = \
#ly:one-page-breaking<br><br> #(define fonts<br> (set-global-fonts<br> \
#:roman "Open Sans"<br> #:sans "Open Sans"<br> \
#:typewriter "DejaVu Sans Mono"<br> ; unnecessary if the staff size \
is default<br> #:factor (/ staff-height pt 20)<br> \
))<br>}<br>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br><br></div></div><div \
dir="ltr" class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><div dir="ltr"></div></div></div></div></div></div></div> \
</blockquote></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic