lilypond code in (pdf/lua/xe)latex documents

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

lilypond code in (pdf/lua/xe)latex documents

Knut Petersen
Hi everybody!

Some years ago I published example code how to integrate lilypond code in latex documents.
The attached file is an extended update, it might be used with pdflatex, lualatex or xelatex, and
it demonstrates how to use the new command line options that replaced --bigpdf in master.

The file should be translated with either
  • pdflatex --shell-escape lyInLatex
  • lualatex --shell-escape lyInLatex
  • pdflatex --shell-escape lyInLatex

After that run ghostscript to generate the final document that contains an optimized set of subsetted
fonts:
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=lyInLatex-final.pdf lyInLatex.pdf
Some documentation is included.

Knut


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

lyInLatex.tex (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: lilypond code in (pdf/lua/xe)latex documents

Mark Knoop-4
At 09:41 on 06 Dec 2017, Knut Petersen wrote:

>Hi everybody!
>
>Some years ago I published example code how to integrate lilypond code
>in latex documents. The attached file is an extended update, it might
>be used with pdflatex, lualatex or xelatex, and it demonstrates how to
>use the new command line options that replaced --bigpdf in master.
>
>The file should be translated with either
>
>  * pdflatex --shell-escape lyInLatex
>  * lualatex --shell-escape lyInLatex
>  * pdflatex --shell-escape lyInLatex

Thanks for this Knut, very helpful. Presumably the 3rd of these should be xelatex.

Interestingly, only pdflatex produces all four bars/systems of fragment 1. When run with lualatex and xelatex only the first system is shown. Any idea why this might be?


--
Mark Knoop

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: lilypond code in (pdf/lua/xe)latex documents

Mark Knoop-4
At 09:05 on 06 Dec 2017, Mark Knoop wrote:

>At 09:41 on 06 Dec 2017, Knut Petersen wrote:
>>Hi everybody!
>>
>>Some years ago I published example code how to integrate lilypond code
>>in latex documents. The attached file is an extended update, it might
>>be used with pdflatex, lualatex or xelatex, and it demonstrates how to
>>use the new command line options that replaced --bigpdf in master.
>>
>>The file should be translated with either
>>
>>  * pdflatex --shell-escape lyInLatex
>>  * lualatex --shell-escape lyInLatex
>>  * pdflatex --shell-escape lyInLatex  
>
>Thanks for this Knut, very helpful. Presumably the 3rd of these should
>be xelatex.
>
>Interestingly, only pdflatex produces all four bars/systems of
>fragment 1. When run with lualatex and xelatex only the first system
>is shown. Any idea why this might be?
>
Apologies - I was missing a hyphen in the commandline - all produce correct results.

--
Mark Knoop

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: lilypond code in (pdf/lua/xe)latex documents

Knut Petersen
Am 06.12.2017 um 10:20 schrieb Mark Knoop:
> The file should be translated with either
>
>   * pdflatex --shell-escape lyInLatex
>   * lualatex --shell-escape lyInLatex
>   * pdflatex --shell-escape lyInLatex
>> Thanks for this Knut, very helpful. Presumably the 3rd of these should
>> be xelatex.

Yes.
>> Interestingly, only pdflatex produces all four bars/systems of
>> fragment 1. When run with lualatex and xelatex only the first system
>> is shown. Any idea why this might be?
> Apologies - I was missing a hyphen in the commandline - all produce correct results.
;-)

Knut

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: lilypond code in (pdf/lua/xe)latex documents

Jacques Peron
Hello,

Thank you very much for this : I hadn't ever understood all those `\catcode` tricks.
Here is a modified version, that calls `lilypond` only when needed by computing a md5 hash of the content. What about making a package out of that and putting it on CTAN ? It would be more universal than lyluatex, so I think many could be interrested. And why not put it on a public repository, to have bug reports and feature requests ?

Thank you again,

Fr. Jacques Peron +

2017-12-06 10:29 GMT+01:00 Knut Petersen <[hidden email]>:
Am 06.12.2017 um 10:20 schrieb Mark Knoop:
The file should be translated with either

  * pdflatex --shell-escape lyInLatex
  * lualatex --shell-escape lyInLatex
  * pdflatex --shell-escape lyInLatex
Thanks for this Knut, very helpful. Presumably the 3rd of these should
be xelatex.

Yes.
Interestingly, only pdflatex produces all four bars/systems of
fragment 1. When run with lualatex and xelatex only the first system
is shown. Any idea why this might be?
Apologies - I was missing a hyphen in the commandline - all produce correct results.
;-)

Knut


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

lyInLatex.tex (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: lilypond code in (pdf/lua/xe)latex documents

Jacques Peron
P. S.: I forgot to add that I modified it to make it compatible with lilypond 2.18

2017-12-06 20:40 GMT+01:00 Jacques Peron <[hidden email]>:
Hello,

Thank you very much for this : I hadn't ever understood all those `\catcode` tricks.
Here is a modified version, that calls `lilypond` only when needed by computing a md5 hash of the content. What about making a package out of that and putting it on CTAN ? It would be more universal than lyluatex, so I think many could be interrested. And why not put it on a public repository, to have bug reports and feature requests ?

Thank you again,

Fr. Jacques Peron +

2017-12-06 10:29 GMT+01:00 Knut Petersen <[hidden email]>:
Am 06.12.2017 um 10:20 schrieb Mark Knoop:
The file should be translated with either

  * pdflatex --shell-escape lyInLatex
  * lualatex --shell-escape lyInLatex
  * pdflatex --shell-escape lyInLatex
Thanks for this Knut, very helpful. Presumably the 3rd of these should
be xelatex.

Yes.
Interestingly, only pdflatex produces all four bars/systems of
fragment 1. When run with lualatex and xelatex only the first system
is shown. Any idea why this might be?
Apologies - I was missing a hyphen in the commandline - all produce correct results.
;-)

Knut


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: lilypond code in (pdf/lua/xe)latex documents

Knut Petersen
In reply to this post by Jacques Peron
Am 06.12.2017 um 20:40 schrieb Jacques Peron:
Here is a modified version, that calls `lilypond` only when needed by computing a md5 hash of the content.

A good idea.

What about making a package out of that and putting it on CTAN ? It would be more universal than lyluatex, so I think many could be interrested. And why not put it on a public repository, to have bug reports and feature requests ?

Well, I think lilypond-user is a good place to publish code related to a lilypond/latex interface. Yes, it would be possible to make a latex .sty file and publish it on CTAN - but there are projects that are more important to me right now. Before I'd think of putting a style based on this code on CTAN, at least the following problems should be solved:
  • Extended error handling is necessary.
  • A check if write18 really is available should be implemented.
  • A check for supported ghostscript / lilypond versions should be implemented.
  • We must adapt command lines to the ghostscript / lilypond versions found.
  • Support also win/mac platforms.
  • Support of pure latex.
  • Optionally synchronize global-staff-size to the design size of the latex document class.
  • Some code to optionally synchronize fonts and fontsizes used by latex and lilypond would be nice.
  • It should be possible to automatically deleted temporary files.
  • Everything should be properly documented.
  • ...
Nothing of that is complicated, but it takes some time.

Knut

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user