Learn how to typeset musical notation, symbols, and scores professionally in LaTeX.

Essential Music Packages

\usepackage{musixtex}       % Complete music typesetting
\usepackage{harmony}        % Chord symbols
\usepackage{guitar}         % Guitar chord diagrams
\usepackage{abc}            % ABC notation support
\usepackage{lilyglyphs}     % LilyPond symbols
\usepackage{leadsheets}     % Lead sheets and songs

Musical Symbols

SymbolLaTeXDescription
\quarternoteQuarter note
\eighthnoteEighth note
\twonotesBeamed eighth notes
\flatFlat
\sharpSharp
\naturalNatural
𝄞\trebleclefTreble clef
𝄢\bassclefBass clef
𝄐\textmusicalnoteGeneric note

Basic Music Notation

Note Values and Rests

% Note values
\whole          % Whole note
\half           % Half note
\quarter        % Quarter note
\eighth         % Eighth note
\sixteenth      % Sixteenth note

% Rests
\wholerest      % Whole rest
\halfrest       % Half rest
\quarterrest    % Quarter rest
\eighthrest     % Eighth rest

% Dotted notes
\quarter.       % Dotted quarter
\half..         % Double dotted half

Accidentals and Key Signatures

% Accidentals
C\sharp         % C sharp
B\flat          % B flat
F\natural       % F natural
G\doublesharp   % G double sharp
D\doubleflat    % D double flat

% Key signatures
\keysignature{3\sharp}    % A major / F# minor
\keysignature{2\flat}     % Bb major / G minor
\keysignature{0}          % C major / A minor

Chord Notation

Chord Symbols with harmony

% Basic chords
\Cma            % C major
\Cmi            % C minor
\Cdim           % C diminished
\Caug           % C augmented

% Seventh chords
\CmaSe          % C major 7
\CmiSe          % C minor 7
\Cdom           % C7 (dominant)
\CmiSeFlat      % C minor 7 flat 5

% Extended chords
\Cnine          % C9
\Celeven        % C11
\Cthirteen      % C13

% Slash chords
C/G             % C major over G
Am/F            % A minor over F

Rendered output:

\CmaC
\CmaSeCmaj7
\CmiSeFlatCm7♭5
F\sharp miF♯m

Guitar Chord Diagrams

Using the guitar Package

% Basic chord diagram
\gtab{C}{3:002010}
\gtab{G}{3:002220}
\gtab{Am}{X02210}
\gtab{F}{1:X33211}

% With finger positions
\gtab*{D}{XX0232:000132}
\gtab*{Em}{022000:012000}

% Barre chords
\gtab{Bm}{2:X13321}
\gtab{F\sharp m}{2:133111}

Simple Scores with MusiXTeX

Basic Staff Notation

\begin{music}
\instrumentnumber{1}
\setstaffs1{1}
\generalmeter{\meterfrac44}
\startpiece

% Simple melody
\notes\qu c\en    % Quarter note C
\notes\hu d\en    % Half note D
\notes\qu{ef}\en  % Quarter notes E and F
\notes\wh g\en    % Whole note G

\endpiece
\end{music}

Two-Staff System

\begin{music}
\instrumentnumber{1}
\setstaffs1{2}              % Two staves
\setclef1{\treble\bass}     % Treble and bass clefs
\generalmeter{\meterfrac44}
\startpiece

% Right hand
\notes\qu{ceg}\en           % C major chord
\notes\qu{ceg}\en
% Left hand
\Notes\ql{C}\en
\Notes\ql{G}\en

\endpiece
\end{music}

Lead Sheets with leadsheets

Song Structure

\begin{song}{title={My Song}, 
             composer={John Doe}, 
             key={C major}}

\begin{verse}
\chord{C}This is the \chord{Am}first line
\chord{F}Of my \chord{G}song \chord{C}today
\end{verse}

\begin{chorus}
\chord{F}Sing a\chord{C}long
\chord{G}Everyone \chord{C}sing
\end{chorus}

\end{song}

Rhythm Notation

Time Signatures and Tempo

% Time signatures
\timesignature{4}{4}        % 4/4 time
\timesignature{3}{4}        % 3/4 time
\timesignature{6}{8}        % 6/8 time
\timesignature{5}{4}        % 5/4 time

% Tempo markings
\tempo{Allegro}
\tempo{Andante \quarternote = 72}
\tempo{Presto \halfnote = 140}

% Metronome markings
MM \quarternote = 120
MM \halfnote. = 60

Musical Expressions

Dynamics and Articulation

% Dynamics
\pp     % Pianissimo
\p      % Piano
\mp     % Mezzo-piano
\mf     % Mezzo-forte
\f      % Forte
\ff     % Fortissimo

% Crescendo and diminuendo
\cresc  % Crescendo
\dim    % Diminuendo
\<      % Hairpin crescendo
\>      % Hairpin diminuendo

% Articulation
\staccato       % Staccato dot
\accent         % Accent mark
\tenuto         % Tenuto line
\fermata        % Fermata

ABC Notation Integration

Using ABC Notation

% ABC notation example
\begin{abc}[name=melody]
X:1
T:Simple Melody
M:4/4
L:1/4
K:C
C D E F | G2 G2 | F E D C | C4 ||
\end{abc}

% Inline ABC
\abcinline{C D E F G}

Musical Analysis

Roman Numeral Analysis

% Roman numerals for harmony
\newcommand{\romnum}[1]{\textsc{#1}}

In C major: \romnum{I} - \romnum{IV} - \romnum{V} - \romnum{I}

% With inversions
\romnum{I}\textsuperscript{6} - \romnum{IV}\textsuperscript{6/4} - \romnum{V}\textsuperscript{7}

% Minor keys (lowercase)
In A minor: \romnum{i} - \romnum{iv} - \romnum{V} - \romnum{i}

Form Analysis

% Sections
\textbf{A:} mm. 1-8
\textbf{B:} mm. 9-16
\textbf{A':} mm. 17-24

% Phrases
\begin{tikzpicture}
\draw[thick] (0,0) -- (4,0);
\draw[thick] (0,0) -- (0,0.2);
\draw[thick] (4,0) -- (4,0.2);
\node at (2,-0.3) {4 measures};
\end{tikzpicture}

Lyrics and Text

Aligning Lyrics to Music

\begin{music}
\instrumentnumber{1}
\setstaffs1{1}
\setlyrics1{1}
\startpiece

\notes\qu{c}\en
\lyrics{This }
\notes\qu{d}\en
\lyrics{is }
\notes\qu{e}\en
\lyrics{my }
\notes\hu{f}\en
\lyrics{song }

\endpiece
\end{music}

Musical Tables

Interval Reference Table

\begin{table}[h]
\centering
\begin{tabular}{|l|c|c|}
\hline
\textbf{Interval} & \textbf{Semitones} & \textbf{Example} \\
\hline
Unison & 0 & C-C \\
Minor 2nd & 1 & C-D♭ \\
Major 2nd & 2 & C-D \\
Minor 3rd & 3 & C-E♭ \\
Major 3rd & 4 & C-E \\
Perfect 4th & 5 & C-F \\
Tritone & 6 & C-F♯ \\
Perfect 5th & 7 & C-G \\
\hline
\end{tabular}
\caption{Common musical intervals}
\end{table}

Special Music Characters

Unicode Music Symbols

% Requires fontspec and XeLaTeX/LuaLaTeX
\usepackage{fontspec}

% Musical symbols
🎵 🎶 🎼 🎹 🎸 🎺 🎻 🥁

% Note values
𝅝 𝅗𝅥 𝅘𝅥 𝅘𝅥𝅮 𝅘𝅥𝅯 𝅘𝅥𝅰 𝅘𝅥𝅱 𝅘𝅥𝅲

% Clefs
𝄞 𝄢 𝄡 𝄟 𝄠

Best Practices

Choose the Right Package

Select packages based on your needs - MusiXTeX for full scores, harmony for chord symbols

Consistent Notation

Use standard music notation conventions throughout

Clear Layout

Ensure adequate spacing between staves and systems

Compile Multiple Times

Music packages often require multiple compilation passes

Troubleshooting

Common issues:

  • MusiXTeX requires special compilation: Run musixtex command
  • Font conflicts: Some music fonts require specific setup
  • Spacing issues: Manual adjustment often needed for complex scores

Further Reading