[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: updated margins-a4-letter.ly
From: |
Reinhold Kainhofer |
Subject: |
Re: updated margins-a4-letter.ly |
Date: |
Sun, 5 Oct 2008 20:21:07 +0200 |
User-agent: |
KMail/1.9.10 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am Sonntag, 5. Oktober 2008 schrieb Graham Percival:
> On Sun, 5 Oct 2008 16:57:52 +0100
>
> "Neil Puttock" <address@hidden> wrote:
> > 2008/10/5 Graham Percival <address@hidden>:
> > > Two more updates to margins-a4-letter.ly:
> > > - if you specify #(set-default-paper-size "letter"), it doesn't
> > > work. You need to do it with #(ly:set-option...)
> > > instructions are in the file.
> >
> > This is easily fixed,
>
> How? The problem is here:
> #(define is-letter? (string=? (ly:get-option 'paper-size) "letter"))
> but I couldn't figure out how to rewrite is-letter? to avoid using
> ly:get-option.
>
> In other words, does
> #(set-default-paper-size ...)
> set any variables other than paper-width and paper-height? ie is
> there a paper-size variable? I couldn't see any in the definition
> of set-default-paper-size in scm/paper.scm. I'd love to fix this, but
> I can't see how.
Yes, it does. internal-set-paper-size sets the symbol 'papersizename in the
default paper module to the name. You can easily extract it in scheme:
#(let* ((paper (ly:output-def-scope (eval '$defaultpaper (current-module))))
(size (eval 'papersizename paper)))
(ly:message "The current default paper size is: ~a" size))
To extract the paper name if set using #(set-paper-size name) inside a \book,
you just have to check if the current module is a paper in in that case use
the current-module instead of the defaultpaper...
I've attached a sample file illustrating this.
Cheers,
Reinhold
- --
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
* K Desktop Environment, http://www.kde.org, KOrganizer maintainer
* Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFI6QWYTqjEwhXvPN0RArefAKCqyrvDXkZyVc/XzzosHAzGw/QjdACgg9NG
HL1oJyWj7Re/GJ/PIG3CINM=
=pbsp
-----END PGP SIGNATURE-----
papersize.ly
Description: Text Data
- updated margins-a4-letter.ly, Graham Percival, 2008/10/04
- Re: updated margins-a4-letter.ly, Patrick Horgan, 2008/10/04
- Re: updated margins-a4-letter.ly, Graham Percival, 2008/10/05
- Re: updated margins-a4-letter.ly, Neil Puttock, 2008/10/05
- Re: updated margins-a4-letter.ly, Patrick McCarty, 2008/10/05
- Re: updated margins-a4-letter.ly, Graham Percival, 2008/10/05
- Re: updated margins-a4-letter.ly, Patrick McCarty, 2008/10/05
- Re: updated margins-a4-letter.ly, Graham Percival, 2008/10/05
- Re: updated margins-a4-letter.ly,
Reinhold Kainhofer <=
- Re: updated margins-a4-letter.ly, David Séverin, 2008/10/05
- Re: updated margins-a4-letter.ly, Reinhold Kainhofer, 2008/10/05
- Re: updated margins-a4-letter.ly, Neil Puttock, 2008/10/05