Git Product home page Git Product logo

lyluatex-bash's Introduction

lyluatex

Alternative to lilypond-book for lualatex

Build Status

Installation

For a single document

Copy all lyluatex*.sty and lyluatex*.lua files into the folder containing the document you wish to typeset.

For all documents compiled with your LaTeX distribution

TeXLive version

Just run this command:

tlmgr install lyluatex

Last version

Copy all lyluatex*.sty and lyluatex*.lua files from this repository into your texmf tree, then run mktexlsr.

Usage

In the preable of your document, include the package lyluatex:

\usepackage{lyluatex}

The program option permits the definition of an alternative path to lilypond, for example:

\usepackage[program=/opt/lilypond-dev/lilypond]{lyluatex}

Thereafter, you can include a lilypond file with the command:

\lilypondfile[staffsize=17]{PATH/TO/THE/FILE}

The argument staffsize, which is optional, changes the size of the score. You can change the size for all the subsequent scores in a document by placing the following command before your first include statement to be so affected:

\setluaoption{ly}{staffsize}{24}

Next, you simply need to compile the document normally with the command lualatex -shell-escape:

lualatex -shell-escape DOCUMENT.TEX

Another "more secure" option is to add lilypond and gs to default allowed commands:

shell_escape_commands=$(kpsewhich -expand-var '$shell_escape_commands'),lilypond,gs lualatex DOCUMENT.TEX

On systems with low RAM, when working on big documents, you could encounter buffer overflows in lilypond calls. In that case, first compile with luatex's command line option --draftmode to generate all LilyPond output snippets, then compile again without this option to generate the output PDF.

You can also input music directly into your document with the lilypond environment. This is only recommended for relatively short snippets. For example:

\begin{lilypond}
\relative c' { c d e f g a b c }
\end{lilypond}

Finally, for truly short snippets, there is also the \lily command. Example:

\lilypond[staffsize=12]{c' d' g'}

Nota bene: The \lilypond command does not support blocks of LilyPond code with explicit \score blocks. Such code must be included with the lilypond environment or as a separate file.

Migration from lilypond-book

In order to facilitate the migration from lilypond-book, \lilypondfile, the environment lilypond and the command \lilypond should work nearly as with lilypond-book; for even more identical behaviour, call lyluatex as follows:

\usepackage[program=/opt/lilypond-dev/lilypond]{lyluatex}

That way, documents typeset with lilypond-book can be adapted to use lyluatex without much difficulty.

Note about MiKTeX

The main author doesn’t use MiKTeX, and won’t make any effort to support it. Nevertheless, pull requests in order to support it will be taken in account.

Actually, lyluatex works with MiKTeX with LilyPond 2.22: there’s a known bug with LilyPond 2.24: #301.

Credits

See Contributors.md.

Contributing

If you want improvements or encounter an error, do not hesitate to to report the issue. If you have programming skills, you may also propose your changes via a pull request.

This extension is and will remain free; if you find it useful and wish to encourage its development by a donation, many thanks!

lyluatex-bash's People

Contributors

jperon avatar lemzwerg avatar luensche avatar mmeyn avatar rpspringuel avatar szollbrecht avatar uliska avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.