6

This is related to a previous question How to change \footnote notation locally to music symbols/notes?.

I am hoping to change, the \symfootnote * and \dagger define below to

  1. the \sharp and \flat music symbols.

or

  1. the G clef (Treble clef) and F clef (Bass clef) symbols.

While other parts of enumerations are perfectly fine to me.

If you can do 1, it is a perfectly good answer for me.

If you can do 2, it is a bonus to me but it is not necessary.

How do I do that within PDFLaTeX (without using XeLaTeX or LuaLaTeX) as @Alan Munn did in How to change \footnote notation locally to music symbols/notes?

enter image description here

Here is my failed attempt so far:

\documentclass{article}


\newcommand{\symfootnote}[1]{%
\let\oldthefootnote=\thefootnote%
\stepcounter{mpfootnote}%
\addtocounter{footnote}{-1}%
\renewcommand{\thefootnote}{\fnsymbol{\sharp\flat}}%
\footnote{#1}%
\let\thefootnote=\oldthefootnote%
}

\begin{document}

This document\footnote{first letter} may have 
several\footnote{second letter} 
footnotes\symfootnote{first symbol}. 

While most of them\footnote{third letter} are 
alphabetical\footnote{fourth letter}, some are 
symbolic\symfootnote{second symbol} also, to 
preserve variety\footnote{fifth letter}.

\end{document}

An outcome like this in PDFLaTeX (not using XeLaTeX nor LuaLaTeX) will be an excellent answer too!

enter image description here

  • 1
    If you want different footnote series, (called 'apparatus') then you should use the bigfoot/manyfoot package, and assign the symbol list in roughly the same way. For a LaTeX solution you would need to find a font or package that supplies the clefs. I couldn't find one. I guess you could create a character using images of the clefs if you really needed LaTeX. See e.g. How to turn a figure into a symbol? and Create a symbol font from SVG symbols. – Alan Munn Jan 25 at 17:42
  • 1
    I’ve slightly edited your question to remove an ambiguity: the latex command on some systems is an alias for the PDFTeX engine, but “LaTeX” more often refers to the language itself, compiled on any engine. – Davislor Jan 25 at 23:06
  • @Davislor, thanks for the info!!!! +1 – wonderich Jan 25 at 23:39
  • Are you able to make the 1st and the 2nd symbols to be "the \sharp and \flat music symbols" respectively? – wonderich Jan 25 at 23:46
5

Typically when multiple footnote apparatus are used, one is used on a per page basis, and one is used with a more global numbering system (per chapter or document). Symbol footnote systems are almost exclusively implemented on a per page basis, since there is usually a very small set of symbols, and so they are inappropriate for document or chapter wide scope. One fairly standard way to implement this in LaTeX is to use the bigfoot package, This package implements the manyfoot package with some improvements, and you should consult the manyfoot documentation for how to use it.

So here's an example of how to do this. The first example uses pdfLaTeX, but lacks the clefs. I have not managed to find either of the clef symbols in any Type1 font. But many fonts contain the accidentals, so they can be implemented easily. By design, manyfoot separates the two different footnote series, so you can't have interspersed numeric and symbol footnotes. The second example simply uses the same method described in my previous answer, but adds the bigfoot code for the different numbering systems.

pdfLaTeX with just sharp and flat symbols

% compile with pdfLaTeX
\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{bigfoot} % See the manyfoot package for documentation
\usepackage[symbol*]{footmisc}
\DeclareNewFootnote{B}
\DefineFNsymbols*{music}{{$\sharp$}{$\flat$}*{$\dag$}}
\DeclareNewFootnote{A}
\renewcommand{\thefootnoteA}{\fnsymbol{footnoteA}}
\MakePerPage{footnoteA}
\setfnsymbol{music}
\begin{document}
Some text\footnoteB{A regular footnote.} Some text\footnoteA{A symbol footnote}. Some text\footnoteB{Another regular footnote} Some text\footnoteA{Another symbol footnote} Some text\footnoteA{A symbol footnote} Some text\footnoteA{A symbol footnote}.
\end{document}

output of code

LuaLaTeX or XeLaTeX with clef symbols added

% compile with LuaLaTeX or XeLaTeX
\documentclass{article}

\usepackage[]{bigfoot} % See the manyfoot package for documentation
\usepackage[symbol*]{footmisc}
\usepackage{fontspec}
\newfontfamily\musicfont[Scale=MatchUppercase]{Free Serif}
\DeclareTextFontCommand{\textmusic}{\musicfont}
\newcommand*\clefG{\textmusic{\char"1D122}}
\newcommand*\clefF{\textmusic{\char"1D11E}}

\DeclareNewFootnote{B}
\DeclareNewFootnote{A}
\DefineFNsymbols*{music}{\clefG\clefF{\textmusic{\sharp}}{\textmusic{\flat}}}
\setfnsymbol{music}
\renewcommand{\thefootnoteA}{\fnsymbol{footnoteA}}
\MakePerPage{footnoteA}

\begin{document}
Some text\footnoteB{A regular footnote.} Some text\footnoteA{A symbol footnote}. Some text\footnoteB{Another regular footnote} Some text\footnoteA{Another symbol footnote} Some text\footnoteA{A symbol footnote}
\end{document}

output of code

pdfLaTeX using images for the clefs

If you really need to use pdfLaTeX and require the clef symbols, then you could insert them as graphics. To do this I made images of the clefs using the standalone package and LuaLaTeX. Here's the document for the treble clef. This produced a file clefF.pdf.

\documentclass[]{standalone}
\usepackage{fontspec}
\setmainfont{Free Serif}
\newcommand*\clefG{\char"1D122}
\newcommand*\clefF{\char"1D11E}
\begin{document}
\fontsize{60}{60}\selectfont
\clefF
\end{document}

For the bass clef, I used the same procedure, but I also used the pdfcrop script to crop the resulting image, since the default crop used by standalone didn't seem to crop completely. So after I created clefG.pdf I used the command pdfcrop clefG.pdf. This produced clefG-crop.pdf which I renamed back to be clefG.pdf. Now we can define commands to insert the clef images as symbols:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{graphicx}
\DeclareRobustCommand\clefG{\includegraphics[height=1.5ex]{clefG}}
\DeclareRobustCommand\clefF{\includegraphics[height=2ex]{clefF}}
\usepackage{bigfoot}
\usepackage[symbol*]{footmisc}
\DeclareNewFootnote{B}
\DefineFNsymbols*{music}{{\clefG}{\clefF}{$\sharp$}{$\flat$}}
\DeclareNewFootnote{A}
\renewcommand{\thefootnoteA}{\fnsymbol{footnoteA}}
\setfnsymbol{music}
\begin{document}
Some text\footnoteB{A regular footnote.} Some text\footnoteA{A symbol footnote}. Some text\footnoteB{Another regular footnote} Some text\footnoteA{Another symbol footnote} Some text\footnoteA{A symbol footnote} Some text\footnoteA{A symbol footnote}.
\end{document}

output of code

  • thanks +1, excellent!!! – wonderich Jan 28 at 0:25
  • Good lessons for all of us. – wonderich Jan 28 at 0:25
  • Dear Alan, I like to accept your answer, but could you help me on one thing: – wonderich Jan 28 at 0:53
  • If I just wish to minimally modify my code, could I do something like (similar to yours): \renewcommand{\thefootnote}{\fnsymbols{{$\sharp$}{$\flat$}*{$\dag$}}} – wonderich Jan 28 at 0:53
  • but which gives the same effect as your first part of answer? (This is just modifying one line in my code -- but for unknown reason, it cannot work) – wonderich Jan 28 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.