Lyx and Lilypond

Do you typeset your scores on Linux? Share your thoughts, tips, and tricks here.

Moderators: MattKingUSA, khz

Post Reply
Aleks
Established Member
Posts: 295
Joined: Wed Nov 09, 2011 5:36 pm
Been thanked: 1 time

Lyx and Lilypond

Post by Aleks »

I'm trying to write some excercises and lessons using Lyx and Lilypond, but the lilypond snippet takes up a whole page, only to be written on the bottom "music engraving by lilypond", like this:

Image

When I use the lilypond extension in LibreOffice, it doesn't happen, so maybe it's something with the Lyx settings?
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Lyx and Lilypond

Post by raboof »

Aleks wrote:When I use the lilypond extension in LibreOffice, it doesn't happen, so maybe it's something with the Lyx settings?
It's been ages since I last used lilypond, but isn't this a lilypond option? (that perhaps LibreOffice sets correctly by default?)

LyX is pretty cool btw. Used it a lot when i was still at uni.
Joermungand
Established Member
Posts: 276
Joined: Wed Oct 24, 2012 5:19 pm

Re: Lyx and Lilypond

Post by Joermungand »

Hi, I’m quite familiar with LyX, although not so much with Lilypond. Could you upload a sample LyX file I can look at? I’m positive it’s only a matter of options… I ran the LyX Lilipond example file and it typeset correctly.
Aleks
Established Member
Posts: 295
Joined: Wed Nov 09, 2011 5:36 pm
Been thanked: 1 time

Re: Lyx and Lilypond

Post by Aleks »

Yeah, ofcourse.

In the second I tried to crop the .ly file with various settings but either the LilyPond didn't show at all on the pdf preview, or it was taking up a whole page. I guess I don't know how to use the crop with all the 4 parameters. But the strangest thing to me is that with the extension in LibreOffice I don't have such problems at all.

The version of Lyx: 2.0.6-1
TeX, Version 3.1415926 (TeX Live 2009/Debian)
OS: Ubuntu 12.04
Attachments
LyxFiles.zip
(2.09 KiB) Downloaded 103 times
Joermungand
Established Member
Posts: 276
Joined: Wed Oct 24, 2012 5:19 pm

Re: Lyx and Lilypond

Post by Joermungand »

OK, I got to the bottom of this. The whole thing about cropping is that the coordinates should be given in bp (big point; 1 in = 72 bp; 1 cm = 72/2.54 bp). It turns out the LyX dialogue will not allow you to input units (e.g. 20 cm) hence you will have to convert all coordinate values to bp. All coordinates are measured from the lower left corner of the Lilypond page (which is the normal page size on your system (mine is A4)), so you need to input the x and y coordinates of the crop’s bottom left and top right corners respectively, with respect to the whole (Lilypond) page.

You can see the values in the LyX file I’ve attached and the resulting pdf.

Of course, fiddling with values is not exactly anyone’s idea of fun. I got much quicker results by using LyX’s ‘LilyPond Book’ module (Document > Settings > Modules). This provides you with a custom inset (available under Insert > Custom insets), which will allow you to paste the Lilypond code directly in the document and will result in an appropriately cropped picture.

Please let me know if it works any better.
Attachments
newfile2_cropped.zip
(52.08 KiB) Downloaded 95 times
Aleks
Established Member
Posts: 295
Joined: Wed Nov 09, 2011 5:36 pm
Been thanked: 1 time

Re: Lyx and Lilypond

Post by Aleks »

...Custom insets...
As you said, who would fiddle around with crop stettings, this is just what I needed. Thank you very much :)
Joermungand
Established Member
Posts: 276
Joined: Wed Oct 24, 2012 5:19 pm

Re: Lyx and Lilypond

Post by Joermungand »

You’re welcome. Please post back if you run into any other issue (there might be a few, apparently). There is also a dedicated manual for this (available under ‘Help > Specific Manuals’) you might want take a look at as well. It explains some of its idiosyncrasies.
Aleks
Established Member
Posts: 295
Joined: Wed Nov 09, 2011 5:36 pm
Been thanked: 1 time

Re: Lyx and Lilypond

Post by Aleks »

Well, I just ran into a problem, actually. Is there a way to make Lyx to export/print Cyrillic characters by using unicode? I tried this:


http://wiki.lyx.org/Tips/Cyrillic

But it's not working.

EDIT: Solved! I had to install Cyrillic support for texlive from the Software Center. I just lo-oove Linux :D
Post Reply