Comments (4)
I'm not sure I understand very well, but I've no objection !
from lyluatex.
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:
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:
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.
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.
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)
- \setmainfont causes problems HOT 6
- The score doesn't contain any music HOT 5
- MiKTeX with LilyPond 2.24: blank scores
- attempt to index a nil value ( field 'metadata') HOT 5
- lyluatex runs slowly on mac HOT 8
- Includepaths no longer working HOT 3
- Reuse precompiled files in different document HOT 3
- Some weird alignment issues when using a custom header HOT 5
- TexLive can't find Lilypond anymore HOT 5
- Make lyluatex work with LilyPond 2.25.4 and newer HOT 2
- Make lyluatex process LilyPond snippets in parallel HOT 6
- Error in lilypond-Log: "/bin/sh: 1: Syntax error: Unterminated quoted string" HOT 4
- Print copyright and tagline below song
- Suppress bar numbers HOT 2
- Large left padding with inline inserts HOT 5
- Can't compile on MacOS - bad argument #1 to 'rawget' HOT 1
- Make lyluatex work with LilyPond v2.25.5 and newer
- Found something incompatible with `fragment` HOT 4
- Compilation fails when using `--output-dir=build` option
- included score is not horizontally centered. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lyluatex.