Nota brings engraved music notation into LaTeX documents. It is intended for articles, teaching material, musicological examples, critical editions, and other documents where scores need to sit naturally beside text.
Instead of exporting and cropping a new graphic after every musical edit, add
the score file to your project and write \score{file.mei}. Nota measures the
space available in LaTeX and engraves the music for that space. The document
still controls its margins, columns, page breaks, and surrounding text.
Nota accepts MEI, MusicXML, Humdrum, ABC, Plaine & Easie, and MuseScore files.
The image above is a contact sheet of the complete A4 article demo. It includes music flowing between paragraphs, full-page scores, a short example inside a figure, and several score formats.
There is also an A3 two-sided book demo with
asymmetric margins, larger notation, and a two-column passage. Both PDFs are
generated from the LaTeX sources in examples/latex/.
Load the package and include a score:
\documentclass{article}
\usepackage{nota}
\begin{document}
Text before the music.
\score{opening.mei}
Text after the music.
\end{document}\score{piece.mei} % systems flow between the surrounding text
\score[full]{piece.mei} % full score pages inside the LaTeX document
\score[example]{motif.krn} % one compact example, suitable for a figureThe default layout renders each system separately, allowing LaTeX to break a
long score across pages. full creates pages as tall as the document's text
area. example keeps the breaks encoded in the score and crops the output to
the musical excerpt.
font
- Description: Music font passed to Verovio. The default is
Leipzig. - Values:
Leipzig,Bravura,Gootville,Leland,Petaluma, or another font installed for Verovio. - Example:
\score[font=Leland]{piece.mei}
unit
- Description: Staff size. One unit is half the distance between two staff lines. When omitted, Nota scales it from the current LaTeX font size.
- Values: A number from
4.5to12. - Example:
\score[unit=8]{piece.mei}
indent
- Description: Indents only the first system of the default, in-flow layout. The default is no indent.
- Values: Any TeX dimension smaller than the current line width.
- Example:
\score[indent=15pt]{piece.mei}
full
- Description: Uses full-page score layout. It is a flag, not a key-value option.
- Values: No value.
- Example:
\score[full]{piece.mei}
example
- Description: Preserves encoded breaks and produces a compact excerpt. It is a flag, not a key-value option.
- Values: No value.
- Example:
\score[example]{motif.krn}
font, unit, and indent can be set in three places:
\usepackage[font=Leipzig, unit=7]{nota} % document default
\begingroup
\notasetup{font=Leland, unit=8} % until this TeX group ends
\score{chapter.mei}
\endgroup
\score[font=Bravura, unit=6]{piece.mei} % this score onlyThe setting nearest to \score wins. full and example can be used on an
individual score or inside a grouped \notasetup; they are not package
options.
Nota supports the formats accepted by Verovio, including:
- MEI:
.mei - MusicXML:
.musicxml,.xml,.mxl - Humdrum:
.krn - ABC:
.abc - Plaine & Easie:
.pae - MuseScore:
.msczwhen the MuseScore CLI is installed
Nota is not on CTAN yet, so install it from the repository.
You need:
- LaTeX 2022-06-01 or newer with
graphicx - Verovio on
PATH rsvg-convertfrom librsvg- Go 1.22 or newer to build the renderer
- MuseScore's
mscorecommand only for.msczinput
Clone and install Nota into your local TeX tree and ~/.local/bin:
git clone https://github.com/manolisky/nota.git
cd nota
make install-localMake sure ~/.local/bin is on PATH, then check the installation:
kpsewhich nota.sty
nota-render --versionCompile a document with:
xelatex paper.tex
nota-render paper
xelatex paper.tex
xelatex paper.texThe first LaTeX pass records the scores. nota-render engraves them. The later
LaTeX passes include the generated music and settle references. Output is kept
in paper-nota/, and unchanged scores are reused from the render cache.
Nota separates document layout from music engraving:
- The LaTeX package measures
\linewidth,\textheight, and the current font size when it reaches each\scorecommand. - It writes those measurements and the score request to
<jobname>.nota.aux. - The Go renderer reads the requests and invokes Verovio for each score.
- Verovio engraves canonical SVG pages using SMuFL music fonts.
- librsvg converts the SVG pages to PDF for LaTeX's
graphicxpackage. - Later LaTeX passes place the generated pages in the document.
The main technologies are:
- LaTeX for document layout, page breaking, and final typesetting
- Go for the
nota-rendercommand, caching, and concurrent rendering - Verovio for music engraving and score-format conversion
- SMuFL for standardized music symbols and fonts
- SVG and PDF for portable, vector score graphics
Rendering is a separate build step, so Nota does not require
--shell-escape.
