Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large left padding with inline inserts #315

Open
dedocc opened this issue May 27, 2023 · 5 comments
Open

Large left padding with inline inserts #315

dedocc opened this issue May 27, 2023 · 5 comments

Comments

@dedocc
Copy link

dedocc commented May 27, 2023

I'm currently using upstream lyluatex with TeXLive 2022 on Fedora.
The \lilypond command produces large horizontal padding on the left of inline inserts.
This isn't the case when using the lilypond environment, which also has issues on its own (as already pointed out in #276)

I have compiled an example (had to rename the source test.tex file as a txt because github wouldn't let me upload it otherwise):

test.txt
test.pdf
test.log

@royabradley
Copy link

royabradley commented Sep 2, 2023

I am having the same issue. I recently submitted a question about this on tex.stackechange.com.

@reckel-jm
Copy link

Same problem here

@reckel-jm
Copy link

I am able to fix the issue for the second+ line of an insertet file by using:
\newcommand{\betweenLilyPondSystem}[1]{\newline\hspace{-10em}}
However, the same command for \newcommand{\preLilyPondExample} does not work. So the first line remains aligned in that way.

@reckel-jm
Copy link

reckel-jm commented Nov 7, 2023

After a brief investigation into the matter, I found out that the problem is most likely in connection with the calculation of the left side protrusion in function bbox_calc around line 215 of lyluatex.la:

function bbox_calc(x_1, x_2, y_1, y_2, line_width)
    local bb = {
        ['protrusion'] = -lib.convert_unit(("%fbp"):format(x_1)),
        ['r_protrusion'] = lib.convert_unit(("%fbp"):format(x_2)) - line_width,
        ['width'] = lib.convert_unit(("%fbp"):format(x_2))
    }

I can only assume that maybe the underlying luaoptions-lib.lua lib function convert_unit has changed working, leading to a wrong protrusion error.

As a quick fix, it helped me to change line 310 of lyluatex.la to (in fact setting any protrusion to 0):

local h_offset = indent_offset

@lukas-vlcek
Copy link

lukas-vlcek commented Mar 2, 2024

Also having the issue.

Moreover, I would welcome more examples, for instance I am trying to output something like \markup { \doubleflat 7 } (see markup examples here) and I am not sure how to do it. Right now I am using workaround \flatflat7 which does not require \lilypond environment at all but that does not allow me to include symbols like \markup { \multi-measure-rest-by-number #12 } etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants