My workflow consists almost exclusively of producing musical examples for
including in Latex. I have the following code in a style file that will
crop things as small as possible. After that you will have to adjust the
line width manually (depending on your latex document's \textwidth).

#(ly:set-option 'backend 'eps)
#(ly:set-option 'aux-files #f)

\paper {
  left-margin = 0
  right-margin = 0
  oddFooterMarkup=##f
  oddHeaderMarkup=##f
  indent = 0
}

On 17 January 2016 at 15:04, Simon Albrecht <[email protected]> wrote:

> On 17.01.2016 13:01, Carl-Henrik Buschmann wrote:
>
>> Good suggestion. This of course works fine but it means manual labor and
>> guessing.  What is the point of a computer if it cannot do this for us?
>>
>> I tried -dpreview but could not get it to work. Help a poor noob, please.
>>
>
> The command line would be
> $lilypond -dpreview INPUTFILE.ly
> In case you use Frescobaldi, you can do it via the ‘Lilypond/Engrave
> (custom)’ dialogue.
>
> HTH, Simon
>
>
>>
>> Den 17. jan. 2016 kl. 12.49 skrev Pierre Perol-Schneider <
>> [email protected] <mailto:[email protected]
>> >>:
>>
>> Hi Carl-Henrik,
>>>
>>> Simply defined the 'paper' dimension you'd like :
>>>
>>> \paper {
>>>   paper-height = 150
>>>   paper-width = 50
>>> }
>>>
>>> E.g. :
>>>
>>> \version "2.19.35"
>>>
>>> %-------------------------------
>>> % Global variables
>>> %-------------------------------
>>> global = {
>>>   \time 4/4
>>>   \key c \major
>>> }
>>>
>>> %-------------------------------
>>> % Music
>>> %-------------------------------
>>> NRT = \relative {
>>>   \global
>>>   \clef G
>>>   \hideNotes
>>>   c' d e
>>> }
>>>
>>> high = \relative {
>>>   \global
>>>   \clef G
>>>   \hideNotes
>>>   c' d e
>>> }
>>>
>>> low = \relative {
>>>   \global
>>>   \clef F
>>>   \hideNotes
>>>   c d e
>>> }
>>>
>>> %-------------------------------
>>> % Score
>>> %-------------------------------
>>>
>>> \paper {
>>>   paper-height = 150
>>>   paper-width = 50
>>>   top-margin = 0
>>>   bottom-margin = 0
>>>   left-margin = 0
>>>   right-margin = 0
>>>   indent = 22
>>> }
>>>
>>> \header {
>>>   tagline = ""
>>> }
>>>
>>> \score {
>>>   <<
>>>     \new Staff \with { instrumentName = "Analysis" }
>>>       { \NRT }
>>>     \new GrandStaff \with { instrumentName = "Woodwind" } <<
>>>       \new Staff { \high }
>>>       \new Staff { \low }
>>>     >>
>>>     \new GrandStaff \with { instrumentName = "Brass" } <<
>>>       \new Staff { \high }
>>>       \new Staff { \low }
>>>     >>
>>>     \new GrandStaff \with { instrumentName = "Strings" } <<
>>>       \new Staff { \high }
>>>       \new Staff { \low }
>>>     >>
>>>     \new GrandStaff \with {
>>>       instrumentName = \markup \right-column {
>>>         "Piano"
>>>         "Aux."
>>>         }
>>>       } <<
>>>       \new Staff { \high }
>>>       \new Staff { \low }
>>>     >>
>>>   >>
>>>
>>> %-------------------------------
>>> % Layout
>>> %-------------------------------
>>>   \layout {
>>>     \context {
>>>       \Score
>>>       timing = ##f
>>>     }
>>>     \context {
>>>       \GrandStaff
>>>       \override InstrumentName.self-alignment-X = #RIGHT %% or 1
>>>     }
>>>     \context {
>>>       \Staff
>>>       \omit TimeSignature
>>>       \override InstrumentName.self-alignment-X = #RIGHT %% or 1
>>>     }
>>>   }
>>> }
>>>
>>>
>>> HTH,
>>> Pierre
>>>
>>> 2016-01-17 12:30 GMT+01:00 Carl-Henrik Buschmann <[email protected]
>>> <mailto:[email protected]>>:
>>>
>>>     > 17. jan. 2016 kl. 12.22 skrev Simon Albrecht <
>>> [email protected] <mailto:[email protected]>>:
>>>     >
>>>     > On 17.01.2016 12:10, Carl-Henrik Buschmann wrote:
>>>     >>
>>>     >> 2) I need to export pngs for my latex documents and i would
>>>     like the bounding box to be as small as possible. How do i do this?
>>>     >
>>>     > It’s not quite clear what you want. Perhaps:
>>>     > \paper {
>>>     >  top-margin = 0
>>>     >  bottom-margin = 0
>>>     >  left-margin = 0
>>>     >  right-margin = 0
>>>     > }
>>>     > ?
>>>     >
>>>     > Best, Simon
>>>
>>>     When making snippets I dont need the entire A4 paper, i just need
>>>     the music. The bounding box is the area exported, or cropped if
>>>     you like. In Sibelius i can check a box and it eliminates all
>>>     unnecessary white space.
>>>     _______________________________________________
>>>     lilypond-user mailing list
>>>     [email protected] <mailto:[email protected]>
>>>     https://lists.gnu.org/mailman/listinfo/lilypond-user
>>>
>>>
>>>
>>
>> _______________________________________________
>> lilypond-user mailing list
>> [email protected]
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>
>
> _______________________________________________
> lilypond-user mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to