업데이트 1

업데이트 1

저는 Ubuntu 14.04에서 MuseScore 1.3을 사용하여 점수를 작성하고 있습니다. 그런 다음 이를 LilyPond 파일로 저장하고 \lilypondfile다음과 같이 를 사용하여 tex 문서에 포함시킵니다.

\documentclass[a4paper]{article}

\begin{document}

Larger examples can be put into a separate file, and introduced with \verb+\lilypondfile+.

\lilypondfile[quote,noindent]{scores/Exercise_1.05.ly}

\end{document}

그런 다음 컴파일하려면 다음을 수행합니다.

$ lilypond-book --pdf solfeo.lytex
$ xelatex solfeo.tex

그러나 삽입된 악보의 폭이 문서에 맞지 않고, 페이지의 한계를 넘어 확장됩니다.

맞지 않는 점수의 스크린샷

또한 lilypond-book.NET에서 전달하는 설정을 무시하는 것 같습니다 \lilypondfile[quote,noindent]{scores/Exercise_1.05.ly}. 잘 이해했다면 quote악보 앞에 음표를 인쇄하고 noindent첫 줄의 들여쓰기를 제거합니다. 메모를 인용하는 것도 아니고 들여쓰기를 제거하는 것도 아닙니다.

저는 Lilypond를 처음 접하고 MuseScore에서 문서의 여백을 변경하려고 시도했으며 일부 tex 명령도 시도했지만 적합하게 만드는 방법을 찾을 수 없습니다. PDF 로 ly 파일을 컴파일하면 lilypond완벽해 보입니다(그러나 이 경우 점수만 얻습니다). 점수가 여백을 넘어 확장되는 파일 ly을 파일에 포함할 때만 발생합니다 . lytex귀하의 제안이나 수정에 감사드립니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까? 감사해요!

PD 다음은 MuseScore에서 생성된 ly 코드입니다.

%=============================================
%   created by MuseScore Version: 1.3
%=============================================

\version "2.12.0"



#(set-default-paper-size "a4")

\paper {
  line-width    = 190\mm
  left-margin   = 10\mm
  top-margin    = 10\mm
  bottom-margin = 20\mm
  %%indent = 0 \mm 
  %%set to ##t if your score is less than one page: 
  ragged-last-bottom = ##t 
  ragged-bottom = ##f  
  %% in orchestral scores you probably want the two bold slashes 
  %% separating the systems: so uncomment the following line: 
  %% system-separator-markup = \slashSeparator 
  }

\header {
    }

AvoiceAA = \relative c'{
    \set Staff.instrumentName = #""
    \set Staff.shortInstrumentName = #""
    \clef treble
    %staffkeysig
    \key c \major 
    %barkeysig: 
    \key c \major 
    %bartimesig: 
    \time 4/4 
    \tempo "Andante" 4 = 96  a'2 a      | % 1
    a r      | % 2
    r a      | % 3
    r a      | % 4
    a r      | % 5
    a a      | % 6
    a a4 a      | % 7
    a r a2      | % 8
    r4 a a2      | % 9
    a4 r2 a4      | % 10
    a2 r4 a \bar "|."     | % 11
    a2 r \bar "|." 
}% end of last bar in partorvoice


\score { 
    << 
        \context Staff = ApartA << 
            \context Voice = AvoiceAA \AvoiceAA
        >>




      \set Score.skipBars = ##t
      %%\set Score.melismaBusyProperties = #'()
      \override Score.BarNumber #'break-visibility = #end-of-line-invisible
     %%every bar is numbered.!!!
      %% remove previous line to get barnumbers only at beginning of system.
       #(set-accidental-style 'modern-cautionary)
      \set Score.markFormatter = #format-mark-box-letters %%boxed rehearsal-marks
       \override Score.TimeSignature #'style = #'() %%makes timesigs always numerical
      %% remove previous line to get cut-time/alla breve or common time 
      \set Score.pedalSustainStyle = #'mixed 
       %% make spanners comprise the note it end on, so that there is no doubt that this note is included.
       \override Score.TrillSpanner #'(bound-details right padding) = #-2
      \override Score.TextSpanner #'(bound-details right padding) = #-1
      %% Lilypond's normal textspanners are too weak:  
      \override Score.TextSpanner #'dash-period = #1
      \override Score.TextSpanner #'dash-fraction = #0.5
      %% lilypond chordname font, like mscore jazzfont, is both far too big and extremely ugly ([email protected]):
      \override Score.ChordName #'font-family = #'roman 
      \override Score.ChordName #'font-size =#0 
      %% In my experience the normal thing in printed scores is maj7 and not the triangle. (olagunde):
      \set Score.majorSevenSymbol = \markup {maj7}
  >>

  %% Boosey and Hawkes, and Peters, have barlines spanning all staff-groups in a score,
  %% Eulenburg and Philharmonia, like Lilypond, have no barlines between staffgroups.
  %% If you want the Eulenburg/Lilypond style, comment out the following line:
  \layout {\context {\Score \consists Span_bar_engraver}}
}%% end of score-block 

#(set-global-staff-size 20)

업데이트 1

의 편집 결과를 붙여넣고 있습니다 lilypond-book. 하지만 스페인어로 되어 있기 때문에 이것이 여러분에게 얼마나 유용할지는 잘 모르겠습니다.

$ lilypond-book --pdf solfeo.lytex

릴리폰드북(GNU LilyPond) 2.18.2
solfeo.lytex 읽는 중...
기본 페이지 설정을 감지하려면 `/tmp/tmpN3IGhy.tex' 파일에서 `pdflatex'를 실행하세요.

해부 중...
단편 작성 중...
처리 중...
달리는 백합 연못...
GNU 릴리폰드 2.18.2
프로세산도 «snippet-map-3001632500490555250.ly»
아날리잔도...
프로세산도 «solfeo.lytex»
아날리잔도...
Renombrando la entrada a: «scores/Exercise_1.05.ly»
음악 해석...[8]
Preprocesando los objetos gráficos...
Calculando los saltos de linea...
Dibujando los sistemas...
Salida de la página hacia «ba/lily-399811ac.eps»...
«ba/lily-399811ac.pdf»로 전환...
Salida de la página hacia «ba/lily-399811ac-1.eps»...
Salida de la página hacia «ba/lily-399811ac-2.eps»...
«ba/lily-399811ac-1.pdf»로 변환...
«ba/lily-399811ac-2.pdf»로 변환...
Escribiendo «ba/lily-399811ac-systems.texi»...
설명 «ba/lily-399811ac-systems.tex»...
설명 «ba/lily-399811ac-systems.count»...
엔호라부에나. 완벽하게 편집되었으며 만족스럽습니다.
파일 연결 중...
/media/admin/DATOS/Dropbox/code/solfeo-book/out/solfeo.tex 컴파일 중...
`/media/admin/DATOS/Dropbox/code/solfeo-book/out/solfeo.tex' 작성 중...

이게 도움이 되길 바란다

업데이트 2

나는 다른 접근 방식을 시도했습니다. 대신 MuseScore에서 MusicXML로 내보냈습니다. 그런 다음 다음을 사용했습니다.

musicxml2ly Exercise_1.05.xml -o Exercise_1.05_.ly

.xml파일을 파일로 변환 .ly하고 다시 컴파일합니다. 여전히 너비가 화면에 맞지 않습니다 =( 아이디어가 부족합니다.

답변1

lilypond-book이는 각 예제의 잘린 PDF 이미지를 생성한 다음 자동으로 LaTeX 파일에 포함시키는 복잡한 방법일 뿐입니다.

lilypond제 생각에는 EPS 백엔드를 사용하여 음악 크기에 맞게 잘린 이미지를 생성하면 훨씬 더 간단하게 손으로 동일한 작업을 수행할 수 있습니다 .

그렇다면 유일한 실제 LaTeX 구성 요소는 다음을 사용하여 PDF 이미지를 포함하는 것입니다.graphicx .중요한 점은 소스에서 이미지의 너비를 설정한 lilypond다음 LaTeX 문서에 원래 크기로 포함시킬 수 있다는 것입니다.

아래 예에서는 모든 음악 예제 소스 파일에 파일을 \include포함 할 수 있으며 , 컴파일하면 잘린 PDF가 생성됩니다.example.ly.ly


이 예에서는 세 개의 파일이 있습니다.

    1. example.ly-- 잘린 음악 예제의 페이지 레이아웃lilypond
    1. score.ly\includes-- 페이지 레이아웃이 명령하는 음악적 예example.ly
    1. analysis.tex-- 이미지가 포함되는 방법을 보여주는 샘플 TeX 파일입니다.

파일 1,example.ly

% STYLE SHEET FOR IN-TEXT EXAMPLES

\version "2.18.2"

#( ly:set-option 'backend 'eps )

\paper{
  indent = 0.75\in
  line-width = 6.5\in
    top-margin = 1\in
    bottom-margin = 2\in
    ragged-bottom = ##t
    ragged-last-bottom = ##t
  oddFooterMarkup=##f
  oddHeaderMarkup=##f
  bookTitleMarkup = ##f
  scoreTitleMarkup = ##f
}

파일 2 --score.ly

\version "2.18.2"
\include "example.ly"

Music = { 
    \clef "tenor"
    \time 3/4
    c4 d4 e4 |
    f2 g4~ |
    g4 a2 |
    b2. |
    c'2. |
    \bar "||"
}

\score{
    <<
        \new Staff { \Music }
    >>
    \layout {}
}

파일 3 -analysis.tex

\documentclass{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}

\section{Music Example}

\lipsum[1]
See example~\ref{fig:score1}.

%*******************
\begin{figure}
\includegraphics{score}\centering
\caption{Score example 1}
\label{fig:score1}
\end{figure}
%*******************

\lipsum[2]


\end{document}

여기에 이미지 설명을 입력하세요

답변2

알고 있는 오래된 질문이지만 오늘 해결책을 찾고 있었기 때문에 여전히 관련성이 있는 것 같습니다. 제가 사용하고 있는 솔루션은 다음과 같습니다. 이를 문서의 서문에 넣기만 하면 됩니다.

\usepackage{graphicx}
\setkeys{Gin}{width=\linewidth}

이는 내부적으로 사용되는 내용이 있고 \includegraphics페이지가 넘치지 않도록 해당 이미지의 기본 너비를 줄 너비로 설정했기 때문에 작동합니다.

관련 정보