
私は 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
で渡している設定を無視しているようです\lilypondfile[quote,noindent]{scores/Exercise_1.05.ly}
。私がよく理解していれば、quote
スコアの前に音符を印刷し、noindent
最初の行のインデントを削除します。音符を引用することも、インデントを削除することもありません。
私は Lilypond を初めて使用しており、MuseScore でドキュメントの余白を変更しようと試み、tex コマンドもいくつか試しましたが、適合させる方法が見つかりません。ly ファイルを PDF でコンパイルすると、完璧に見えます (ただし、その場合はスコアのみが表示されます)。スコアが余白を超えるのは、ファイルをファイルに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 lilypond-book (GNU LilyPond) 2.18.2 solfeo.lytex を読み込んでいます... デフォルトのページ設定を検出するために、ファイル `/tmp/tmpN3IGhy.tex' で `pdflatex' を実行します。 解剖中… スニペットを書いています... 処理... lilypond を実行しています... GNU リリーポンド 2.18.2 «snippet-map-3001632500490555250.ly» に進みます 分析... «solfeo.lytex» プロセス 分析... 次のエントリを再度入力してください: «scores/Exercise_1.05.ly» 音楽を解釈する...[8] グラフィック オブジェクトを事前処理します... 線の太さを計算します... システムを破壊しました... 上のページに戻ります «ba/lily-399811ac.eps»... «ba/lily-399811ac.pdf» で証明されました... 上のページのスクロール「ba/lily-399811ac-1.eps」... 上のページのスクロール「ba/lily-399811ac-2.eps」... «ba/lily-399811ac-1.pdf» で変換されました... «ba/lily-399811ac-2.pdf» で変換されました... 「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 ファイルに自動的に組み込むという複雑な方法にすぎません。
同じことを手作業で行うこともできますが、私の意見では、EPS バックエンドを使用して音楽のサイズに合わせてトリミングされた画像を作成することで、はるかに簡単に行うことができlilypond
ます。
そうすると、唯一の実際の LaTeX コンポーネントは、パッケージを使用して PDF イメージを組み込むことになりますgraphicx
。重要な点は、ソースで画像の幅を設定しlilypond
、それを自然なサイズで LaTeX ドキュメントに含めることができることです。
以下の例では、すべての音楽サンプル ソース ファイルにファイルを\include
追加し、コンパイルすると切り取られた PDF が生成されます。example.ly
.ly
この例では 3 つのファイルがあります:
example.ly
-- 切り取られた音楽例のページレイアウトlilypond
score.ly
\includes
--ページレイアウトが指示する音楽の例example.ly
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
あり、それらの画像のデフォルトの幅を行の幅に設定して、ページからオーバーフローしないようにしているからです。