[XeTeX] Lilypond + XeLaTeX

Rembrandt Wolpert r.f.wolpert at gmail.com
Sun Jun 22 20:25:02 CEST 2008


Hello Father Michael,

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.

As a starter:
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):

mkdir OUT
lilypond-book --out OUT --pdf try-header.tex
cd OUT
xelatex  -output-driver="xdvipdfmx -q -E" try-header.tex
cp try-header.tex ../try.tex
cd ..

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...).

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.

Rembrandt


% try-header.tex
\documentclass{article}
\usepackage{xunicode,fontspec,xltxtra}
\setmainfont{Times New Roman}
\setsansfont{Gentium}

\usepackage{graphicx}
\input{try.tex}

%try.tex
\begin{document}
\title{A short document with LilyPond and xelatex}
\maketitle
Normal \textbf{font} commands inside the \emph{text} work,
because they \textsf{are supported by \LaTeX{} and XeteX.}
If you want to use specific commands like \verb+\XeTeX+, you
should include them again in a \verb+\ifxetex+ environment.
You can use this to print the \XeLaTeX{} which is not known to normal \LaTeX
.
In normal text you can easily use LilyPond commands, like this:
\begin{lilypond}
{a2 b c'8 c' c' c'}
\end{lilypond}
\noindent
and so on.
The fonts of snippets set with LilyPond will have to be set from
inside
of the snippet. For this you should read the AU on how to use
lilypond-book.
\end{document}


On Sun, Jun 22, 2008 at 4:32 PM, Fr. Michael Gilmary <
FrMichaelGilmary at maronitemonks.org> wrote:

> Dear All:
>
> First, thanks for all the helpful advice. I've benefited and am grateful.
>
> I've used Lilypond with an engine written for LaTeX and it works fine. I
> have also tried to use a preamble and small file example that pretends
> to work with XeLaTeX, employing the ifxetex package (this is included in
> the pdf doc "lilypond-learning" pp. 167-8, and I've dropped the German
> sample). There are a number of things strange (it seems to me) about the
> way the document compiles --- not the least of which is the following
> warning:
>
> > This .map file looks like a dvips format fontmap file.
> > ** WARNING ** -- Current input buffer is: HoeflerTextOrnaments
> > hoeflertextornaments <hoeflertextornaments.enc
> > ** WARNING ** -- Reading fontmap file stopped at: file="dvipdfm.map",
> > line=25.
> > ** WARNING ** Deleting fontmap record for "ASCII"
> > ** WARNING ** Deleting fontmap record for "AmiciLogo"
> > ** WARNING ** Deleting fontmap record for "AmiciLogoBold"
> > ** WARNING ** Deleting fontmap record for "AmiciLogoBoldRslant"
> > ** WARNING ** Deleting fontmap record for "AmiciLogoBoldSlant"
> > ** WARNING ** Deleting fontmap record for "AmiciLogoRslant"
> > ** WARNING ** Deleting fontmap record for "AmiciLogoSlant"
> > ** WARNING ** Deleting fontmap record for "AuriocusKalligraphicus"
> > ** WARNING ** Deleting fontmap record for "AuriocusKalligraphicusBold"
> > ** WARNING ** Deleting fontmap record for
> > "AuriocusKalligraphicusBoldRslant"
> > ** WARNING ** Deleting fontmap record for
> > "AuriocusKalligraphicusBoldSlant"
> > ** WARNING ** Deleting fontmap record for "AuriocusKalligraphicusRslant"
> > ** WARNING ** Deleting fontmap record for "AuriocusKalligraphicusSlant"
> > ** WARNING ** Deleting fontmap record for "Cheq"
> > ** WARNING ** Deleting fontmap record for "Cherokee"
> > ** WARNING ** Deleting fontmap record for "Cherokeeb"
> > ** WARNING ** Deleting fontmap record for "Cherokeebo"
> > ** WARNING ** Deleting fontmap record for "Cherokeeo"
> > ** WARNING ** Deleting fontmap record for "EpiOlmec"
>
> Before it gets that far, however, it stops at the lilypond environment,
> not recognizing it. So it sets the page /without music/ if I continue by
> pressing the return key.
>
> I'm working on Mac OS 10.4.11. Any other info needed?
>
> It seems that no one in the lilypond world can help after I posted this
> question on their user group forum and the developer's list.
>
> Thanks in advance! And be assured of our prayers.
>
> fr. michael gilmary
>
>
> %%%%%%%%%%%%%%%%%%%
> %%%%%%%%%%%%%%%%%%%
>                  Sample file
> %%%%%%%%%%%%%%%%%%%
> %%%%%%%%%%%%%%%%%%%
>
> > %!TEX encoding =  UTF-8 Unicode
> > %!TEX TS-program =  xelatex-xdvipdfmx
> >
> > \documentclass{article}
> > \usepackage{ifxetex}
> > \ifxetex
> > %xetex specific stuff
> > \usepackage{xunicode,fontspec,xltxtra}
> > \setmainfont{Times New Roman}
> > \setsansfont{Arial}
> > \else
> >
> > %%This can be empty if you are not going to use pdftex
> > \usepackage[T1]{fontenc}
> > \usepackage[utf8]{inputenc}
> > \usepackage{mathptmx}%Times
> > \usepackage{helvet}%Helvetica
> > \fi
> > %Here you can insert all packages that pdftex also understands
> >
> > \usepackage{graphicx}
> > \begin{document}
> > \title{A short document with LilyPond and xelatex}
> > \maketitle
> > Normal \textbf{font} commands inside the \emph{text} work,
> > because they \textsf{are supported by \LaTeX{} and XeteX.}
> > If you want to use specific commands like \verb+\XeTeX+, you
> > should include them again in a \verb+\ifxetex+ environment.
> > You can use this to print the \ifxetex \XeTeX{} command \else
> > XeTeX command \fi which is not known to normal \LaTeX .
> > In normal text you can easily use LilyPond commands, like this:
> > \begin{lilypond}
> > {a2 b c'8 c' c' c'}
> > \end{lilypond}
> > \noindent
> > and so on.
> > The fonts of snippets set with LilyPond will have to be set from
> > inside
> > of the snippet. For this you should read the AU on how to use
> > lilypond-book.
> >
> >
> > \end{document}
>
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>



-- 
人有不為也而後可有為
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/xetex/attachments/20080622/3ed9b301/attachment.html 


More information about the XeTeX mailing list