Giter Club home page Giter Club logo

Comments (4)

jperon avatar jperon commented on June 1, 2024

I'm not sure I understand very well, but I've no objection !

from lyluatex.

uliska avatar uliska commented on June 1, 2024

OK, I see now that it's not that simple and that I need some help from the lilypond-user list, but I can fake an example.

By default LaTeX aligns an image with the left margin of the surrounding text. When suppressing parindent this looks like this:

image

However, I would prefer giving users the possibility (because I would usually do it like this) not to align the border of the image but the first barline and have the system bracket (or whatever brackets are used, maybe even short instrument names) protrude in the left margin like this:

image

For this we have to know (set) the exact width of the left margin of the score and offset the position in the LaTeX file accordingly.

Unfortunately the cropped layout always crops the left margin, so we can't easily retrieve the necessary information (because the actual value dependes on the actual staff organization (a PianoStaff brace over three staves is wider than over two etc.). I'll have to see if there's a way to make LilyPond produce a usable score for this use case.

from lyluatex.

uliska avatar uliska commented on June 1, 2024

A clearer description of the problem in the attached PDF.

I think this problem is already touched in the code by defaulting the line width to the text's line width minus 10 pt. But as the elements to the left are of arbitrary width this is not a real solution.

from lyluatex.

uliska avatar uliska commented on June 1, 2024

Having asked on lilypond-user I found an answer myself. The solution consists of a number of steps, and I would like to give it a try myself:

  • Add a left-margin option to the score definition
    This must be sufficient to handle all protruding elements and small enough to allow line-width to fit on the paper size.
    It must be given in points (\pt => bp/big points in LaTeX)
  • compile using eps backend (as it already is done)
  • read the first value from the BoundingBox line from the main eps file:
    %%BoundingBox: 27 -209 532 -18 means a value of 27 points
    head -n 3 my-file.eps | tail -n 1 | cut -d " " -f 2 does that
    [Edit: I have implemented it in Lua instead]
  • calculate the offset as left-margin minus that bounding box value
  • When copying the value from the -systems.tex file prepend each entry with \hspace*{-<bb-value>}
  • Make sure there is no parindent. Store the current value in a local variable and restore it after the music

from lyluatex.

Related Issues (20)

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.