jperon / lyluatex

Alternative à lilypond-book pour lualatex
MIT License
58 stars 11 forks source link

paper dimensions not correctly set for 'insert=systems' #271

Closed lemzwerg closed 5 years ago

lemzwerg commented 5 years ago

[1bb88622c451ad663be8fbed50114dba6c9f543f]

The paper dimensions should be set even for insert=systems. Here an example that exhibits the bug.

\documentclass[paper=a3,
               paper=landscape,
               pagesize=auto,
               DIV=10]{scrartcl}

\usepackage{lipsum}
\usepackage[debug]{lyluatex}

\begin{document}

\lipsum[2]

\begin{lilypond}
  \relative c' {
    e1 \break
    e1 \break
    e1
  }
\end{lilypond}

\lipsum[2]

\end{document}

Looking into the LilyPond log file you can find the line

warning: systems run off the page due to improper paper settings, setting default values

and indeed, the line width of the LilyPond snippet is too short, not being equivalent to the current \linewidth.

too-short-linewidth

uliska commented 5 years ago

Please supply the generated .ly file (debug option) -- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

lemzwerg commented 5 years ago

Here it is.

f12e4176164c9541b1d483985edf95cb.ly

uliska commented 5 years ago

OK, I see.

lyluatex only sets a papersize for insert=systems when it is explicitly given as a (package/local) option, which generally makes sense since the line width is the only thing that is relevant. But since LIlyPond (correctly) doesn't work properly when the line width (I assume left margin plus line width) exceeds the actual paper size this doesn't work in a given set of cases.

I think the straightforward solution is also the appropriate one: always set the paper size, because - at least in theory - the case shown in this example might even affect insert=inline.