4

I want to insert a musical symbol (fermata) in a Tikz picture, using lilyglyphs package. This is my code :

\documentclass[symmetric,justified,marginals=raggedouter]{tufte-book}
\usepackage{lilyglyphs}
\usepackage{adjmulticol,tikz}

\begin{document}

\begin{figure*}[h]
\begin{tikzpicture}
\node[anchor=west,font=\tiny](a)at(10.8cm,2.6cm){\lilyGlyph{fermata}\strut};
\end{tikzpicture}
\end{figure*}

\end{document}

Unfortunatly, the symbol don't appear and it is write "[Scale=1.0]emmentaler~16.otffermata". What is missing on my code ? For other reasons, I use to the musicography package in my document... Perhaps it is possible to insert this symbol with this package ?

Phil8544
  • 407
  • I just get ! Undefined control sequence. l.9 ...est,font=\tiny](a)at(10.8cm,2.6cm){\lilyGlypg {fermata}\strut};. –  Apr 29 '20 at 20:37
  • You have a typo: it should be \lilyGlyph -- note the h at the end. Presumably you also need to compile this with XeLaTeX. –  Apr 29 '20 at 20:41
  • However, if I remove the typo, the error disappears: it has to be \lilyGlyph, not \lilyGlypg. In general, if you ignore error messages in LaTeX you cannot expect to get a reasonable output. –  Apr 29 '20 at 20:42
  • Sorry, I fixed the typo error, but it still doesn't work (and I add the new error message ...) – Phil8544 Apr 29 '20 at 21:45

1 Answers1

4

This works for me with XeLaTeX without any error:

\documentclass[symmetric,justified,marginals=raggedouter]{tufte-book}
\usepackage{lilyglyphs}
\usepackage{adjmulticol,tikz}

%alternative for the package lilyglyphs
\usepackage{fontspec}
\newfontfamily\emmentaler{emmentaler-11.otf}[Scale=MatchLowercase] %other fonts: emmentaler-11.otf emmentaler-13.otf emmentaler-14.otf emmentaler-16.otf emmentaler-18.otf emmentaler-20.otf emmentaler-23.otf emmentaler-26.otf
\newcommand\directFermata{{\emmentaler{}\symbol{"E132}}}

\begin{document}

\begin{figure*}[h]
\begin{tikzpicture}
    \node[anchor=west,font=\tiny] (a) at (10.8cm,2.6cm) {\lilyGlyph{scripts.ufermata}};
    \node[anchor=west,font=\tiny] (a) at (10.5cm,2.6cm) {\fermata\strut};
    \node[anchor=west,font=\tiny] (a) at (10.0cm,2.6cm) {\directFermata\strut};
\end{tikzpicture}
\end{figure*}

\end{document}

But it does not work on pdfLaTeX since the command you use requires https://ctan.org/pkg/fontspec. This is also written in the second paragraph of the lilyglyphs' manual's section "1 Introduction" and in the first paragraph of the section "Quick Start".

You could also draw your own fermata with Tikz. It is one of the simpler music symbols. Or you could import it as pdf file, see https://tex.stackexchange.com/a/441624/128553. Both ways make you independent from https://ctan.org/pkg/fontspec in your main document.

enter image description here

CampanIgnis
  • 4,624