jperon / lyluatex

Alternative à lilypond-book pour lualatex
MIT License
56 stars 11 forks source link

Lilypond not recognized #279

Open Brayanokles opened 4 years ago

Brayanokles commented 4 years ago

Hello everybody,

I am trying to make a new booklet. I made a test-version without too much lay-out:

\documentclass[a4paper]{article}

\documentclass[a4paper]{article}

\usepackage{lyluatex}

% Taal
\usepackage[ngerman]{babel} %taal
\usepackage{fouriernc} %lettertype
\usepackage[utf8]{inputenc} % speciale tekens

\begin{document}

\begin{lilypond}
\relative c' {
a2 a2 a2
}
\end{lilypond}

\end{document} 

The output is showed this:

(c:/texlive/2020/texmf-dist/tex/latex/graphics/lscape.sty))c:/texlive/2020/texm
f-dist/scripts/lyluatex/lyluatex.lua:1335: attempt to index a nil value (field 
'metadata')
stack traceback:
    c:/texlive/2020/texmf-dist/scripts/lyluatex/lyluatex.lua:1335: in function 'ly
luatex.lua.get_font_family'
    [\directlua]:1: in main chunk.
\ly@currentfonts ..._font_family(font.current()))}
                                                  \rmfamily \edef \rmfamilyi...

l.16 \end{lilypond}

? 

What am I doing wrong?

jperon commented 4 years ago

The problem comes from fonts : lyluatex uses the mechanisms of lualatex to use system fonts (TrueType / OpenType). fouriernc and inputenc are "old" mechanisms of LaTeX, that aren't compatible.

jperon commented 4 years ago

You'll find here some ideas to replace fouriernc with lualatex. If it doesn't matter for you to use another font style than schoolbook, libertine is a beautiful and well-integrated font.

Brayanokles commented 4 years ago

In Word, I sometimes use book antiqua. I found a font that is suitable for Latex, but how do I install that?

I am trying a few TrueType/OpenType, but no success: for example Libre Baskerville is not working.

Brayanokles commented 4 years ago

I found this one: \setmainfont{QTSchoolCentury}

And that's a beautiful font. Thanks for inspiring me.

jperon commented 4 years ago

I've just tested with Book Antiqua :

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Book Antiqua}

\usepackage[pass-fonts]{lyluatex}

\begin{document}

a - b - c

\begin{ly}
{a b c}
\addlyrics{a -- b -- c}
\end{ly}

\end{document}

It works as expected. You'll notice the pass-fonts option : thanks to the great work of @uliska, it ensures you get the same font in scores and in the body of your document. test.pdf