Lyx and Lilypond

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

Moderators: khz, MattKingUSA

Aleks
Established Member
Posts: 264
Joined: Wed Nov 09, 2011 5:36 pm

Lyx and Lilypond

Postby Aleks » Thu Aug 01, 2013 10:01 pm

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: 1624
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Contact:

Re: Lyx and Lilypond

Postby raboof » Fri Aug 02, 2013 6:47 am

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: 273
Joined: Wed Oct 24, 2012 5:19 pm

Re: Lyx and Lilypond

Postby Joermungand » Fri Aug 02, 2013 7:07 am

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: 264
Joined: Wed Nov 09, 2011 5:36 pm

Re: Lyx and Lilypond

Postby Aleks » Fri Aug 02, 2013 7:58 am

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
You do not have the required permissions to view the files attached to this post.

Joermungand
Established Member
Posts: 273
Joined: Wed Oct 24, 2012 5:19 pm

Re: Lyx and Lilypond

Postby Joermungand » Fri Aug 02, 2013 9:23 am

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.
You do not have the required permissions to view the files attached to this post.

Aleks
Established Member
Posts: 264
Joined: Wed Nov 09, 2011 5:36 pm

Re: Lyx and Lilypond

Postby Aleks » Fri Aug 02, 2013 12:51 pm

...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: 273
Joined: Wed Oct 24, 2012 5:19 pm

Re: Lyx and Lilypond

Postby Joermungand » Fri Aug 02, 2013 3:15 pm

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: 264
Joined: Wed Nov 09, 2011 5:36 pm

Re: Lyx and Lilypond

Postby Aleks » Fri Aug 02, 2013 9:31 pm

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


Return to “Notation Editors”

Who is online

Users browsing this forum: No registered users and 1 guest