Hello Father Michael,<br><br>Lilypond-book and xelatex work very well together when using a terminal: Lilypond-book wants to write to a directory other than the original directory (let's call it OUT) so as not to overwrite the original .tex file.<br>
<br>As a starter:<br>If you put your headers into a small file such as try-header.tex below, and your text (with the lilypond-code) in a file like the try.tex below (that "document" file is included as \input{try.tex} in the try-header.tex), you should do the following (a script-generated Makefile can automate all that for you):<br>
<br>mkdir OUT<br>lilypond-book --out OUT --pdf try-header.tex<br>cd OUT<br>xelatex -output-driver="xdvipdfmx -q -E" try-header.tex<br>cp try-header.tex ../try.tex<br>cd ..<br><br>You should now have a file try.pdf in the directory you work in (and you started out), and you can delete everything in the OUT file (and remove the OUT directory - if you leave it, lilypond-book will recognise the changes you make, and only compile what has changed. But OUT tends to get rather big...).<br>
<br>Obviously, the whole thing can be done with a script that does all the work for you. Feel free to ask me directly for a sample shell-script if you need some help there.<br><br>Rembrandt<br><br><br>% try-header.tex<br>
\documentclass{article}<br>
\usepackage{xunicode,fontspec,xltxtra}<br>\setmainfont{Times New Roman}<br>\setsansfont{Gentium}<br><br>\usepackage{graphicx}<br>\input{try.tex}<br><br>%try.tex<br>\begin{document}<br>\title{A short document with LilyPond and xelatex}<br>
\maketitle<br>Normal \textbf{font} commands inside the \emph{text} work,<br>because they \textsf{are supported by \LaTeX{} and XeteX.}<br>If you want to use specific commands like \verb+\XeTeX+, you<br>should include them again in a \verb+\ifxetex+ environment.<br>
You can use this to print the \XeLaTeX{} which is not known to normal \LaTeX .<br>In normal text you can easily use LilyPond commands, like this:<br>\begin{lilypond}<br>{a2 b c'8 c' c' c'}<br>\end{lilypond}<br>
\noindent<br>and so on.<br>The fonts of snippets set with LilyPond will have to be set from<br>inside<br>of the snippet. For this you should read the AU on how to use<br>lilypond-book.<br>\end{document}<br><br><br><div class="gmail_quote">
On Sun, Jun 22, 2008 at 4:32 PM, Fr. Michael Gilmary <<a href="mailto:FrMichaelGilmary@maronitemonks.org" target="_blank">FrMichaelGilmary@maronitemonks.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear All:<br>
<br>
First, thanks for all the helpful advice. I've benefited and am grateful.<br>
<br>
I've used Lilypond with an engine written for LaTeX and it works fine. I<br>
have also tried to use a preamble and small file example that pretends<br>
to work with XeLaTeX, employing the ifxetex package (this is included in<br>
the pdf doc "lilypond-learning" pp. 167-8, and I've dropped the German<br>
sample). There are a number of things strange (it seems to me) about the<br>
way the document compiles --- not the least of which is the following<br>
warning:<br>
<br>
> This .map file looks like a dvips format fontmap file.<br>
> ** WARNING ** -- Current input buffer is: HoeflerTextOrnaments<br>
> hoeflertextornaments <hoeflertextornaments.enc<br>
> ** WARNING ** -- Reading fontmap file stopped at: file="dvipdfm.map",<br>
> line=25.<br>
> ** WARNING ** Deleting fontmap record for "ASCII"<br>
> ** WARNING ** Deleting fontmap record for "AmiciLogo"<br>
> ** WARNING ** Deleting fontmap record for "AmiciLogoBold"<br>
> ** WARNING ** Deleting fontmap record for "AmiciLogoBoldRslant"<br>
> ** WARNING ** Deleting fontmap record for "AmiciLogoBoldSlant"<br>
> ** WARNING ** Deleting fontmap record for "AmiciLogoRslant"<br>
> ** WARNING ** Deleting fontmap record for "AmiciLogoSlant"<br>
> ** WARNING ** Deleting fontmap record for "AuriocusKalligraphicus"<br>
> ** WARNING ** Deleting fontmap record for "AuriocusKalligraphicusBold"<br>
> ** WARNING ** Deleting fontmap record for<br>
> "AuriocusKalligraphicusBoldRslant"<br>
> ** WARNING ** Deleting fontmap record for<br>
> "AuriocusKalligraphicusBoldSlant"<br>
> ** WARNING ** Deleting fontmap record for "AuriocusKalligraphicusRslant"<br>
> ** WARNING ** Deleting fontmap record for "AuriocusKalligraphicusSlant"<br>
> ** WARNING ** Deleting fontmap record for "Cheq"<br>
> ** WARNING ** Deleting fontmap record for "Cherokee"<br>
> ** WARNING ** Deleting fontmap record for "Cherokeeb"<br>
> ** WARNING ** Deleting fontmap record for "Cherokeebo"<br>
> ** WARNING ** Deleting fontmap record for "Cherokeeo"<br>
> ** WARNING ** Deleting fontmap record for "EpiOlmec"<br>
<br>
Before it gets that far, however, it stops at the lilypond environment,<br>
not recognizing it. So it sets the page /without music/ if I continue by<br>
pressing the return key.<br>
<br>
I'm working on Mac OS <a href="http://10.4.11." target="_blank">10.4.11.</a> Any other info needed?<br>
<br>
It seems that no one in the lilypond world can help after I posted this<br>
question on their user group forum and the developer's list.<br>
<br>
Thanks in advance! And be assured of our prayers.<br>
<br>
fr. michael gilmary<br>
<br>
<br>
%%%%%%%%%%%%%%%%%%%<br>
%%%%%%%%%%%%%%%%%%%<br>
Sample file<br>
%%%%%%%%%%%%%%%%%%%<br>
%%%%%%%%%%%%%%%%%%%<br>
<br>
> %!TEX encoding = UTF-8 Unicode<br>
> %!TEX TS-program = xelatex-xdvipdfmx<br>
><br>
> \documentclass{article}<br>
> \usepackage{ifxetex}<br>
> \ifxetex<br>
> %xetex specific stuff<br>
> \usepackage{xunicode,fontspec,xltxtra}<br>
> \setmainfont{Times New Roman}<br>
> \setsansfont{Arial}<br>
> \else<br>
><br>
> %%This can be empty if you are not going to use pdftex<br>
> \usepackage[T1]{fontenc}<br>
> \usepackage[utf8]{inputenc}<br>
> \usepackage{mathptmx}%Times<br>
> \usepackage{helvet}%Helvetica<br>
> \fi<br>
> %Here you can insert all packages that pdftex also understands<br>
><br>
> \usepackage{graphicx}<br>
> \begin{document}<br>
> \title{A short document with LilyPond and xelatex}<br>
> \maketitle<br>
> Normal \textbf{font} commands inside the \emph{text} work,<br>
> because they \textsf{are supported by \LaTeX{} and XeteX.}<br>
> If you want to use specific commands like \verb+\XeTeX+, you<br>
> should include them again in a \verb+\ifxetex+ environment.<br>
> You can use this to print the \ifxetex \XeTeX{} command \else<br>
> XeTeX command \fi which is not known to normal \LaTeX .<br>
> In normal text you can easily use LilyPond commands, like this:<br>
> \begin{lilypond}<br>
> {a2 b c'8 c' c' c'}<br>
> \end{lilypond}<br>
> \noindent<br>
> and so on.<br>
> The fonts of snippets set with LilyPond will have to be set from<br>
> inside<br>
> of the snippet. For this you should read the AU on how to use<br>
> lilypond-book.<br>
><br>
><br>
> \end{document}<br>
<br>
<br>
_______________________________________________<br>
XeTeX mailing list<br>
<a href="mailto:postmaster@tug.org" target="_blank">postmaster@tug.org</a><br>
<a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
</blockquote></div><br><br clear="all"><br>-- <br> 人有不為也而後可有為