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)
- lilypond environment, command give different results with the same input
- Lilypond, Texlive 2018 -> Texlive 2020 and... nothing works anymore HOT 7
- Fatal error: missing \begin{document} HOT 10
- Lilypond not recognized HOT 5
- Adding new Lilypond parts (TexLive 2020)
- Too much empty space on a page
- Failing to auto-compile HOT 3
- LilyPond raw-pdf does not give hoffset
- cannot start lilypond HOT 4
- Unprecedented error! Need Help! HOT 3
- Doctoral Thesis in musicology HOT 3
- lilypond 2.23.x and lyluatex (fragments not inserted) HOT 19
- Latex Error: ./filename.tex:62 Too many }'s. HOT 3
- Adjust text font size in lilypond HOT 3
- Missing final system on recompile HOT 6
- Trying (i.e. Failing) to Use Lilypond HOT 5
- Undefined control sequence HOT 2
- Lyluatex fails to compile documents in GitHub Actions HOT 12
- \setmainfont causes problems HOT 6
- The score doesn't contain any music 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.