diff options
author | Karl Berry <karl@freefriends.org> | 2015-01-11 22:50:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-01-11 22:50:01 +0000 |
commit | 9a32a7a9d63c685e263389fb8d77f6fc7fce616a (patch) | |
tree | 83e223e01c5b8503036efe14dfc1ea471c91b75e /Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.musicsymbols.code.tex | |
parent | 343b8c08bc86c86208e49112681665dd68e4e9a2 (diff) |
leadsheets (11jan15)
git-svn-id: svn://tug.org/texlive/trunk@36029 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.musicsymbols.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.musicsymbols.code.tex | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.musicsymbols.code.tex b/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.musicsymbols.code.tex new file mode 100644 index 00000000000..82a515786a3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/leadsheets/leadsheets.library.musicsymbols.code.tex @@ -0,0 +1,104 @@ +\LeadsheetsLibrary{musicsymbols}{2014/08/10 musical symbols} +\RequirePackage{etoolbox} + +% define a LaTeX font that uses the `musix' font from MusiXTeX: +\DeclareFontFamily{U}{musix}{}% +\DeclareFontShape{U}{musix}{m}{n}{% + <-12> musix11 + <12-15> musix13 + <15-18> musix16 + <18-23> musix20 + <23-> musix29 +}{}% + +% a font switch command: +\newrobustcmd*\musix{\usefont{U}{musix}{m}{n}\selectfont} +% a text font command: +\DeclareTextFontCommand{\textmusix}{\musix} + +% the `symbol' command: raises the symnol since most symbols are too low for +% use in normal text: +\newrobustcmd*\musicsymbol[2][0pt]{% + \raisebox{\dimexpr.5ex+(#1)\relax}{\textmusix{#2}}% +} + +% define the symbol +\renewrobustcmd*\sharp {\musicsymbol[.2ex]{4}\kern-.06em} +\renewrobustcmd*\flat {\kern-.05em\musicsymbol{2}\kern-.06em} +\renewrobustcmd*\natural {\musicsymbol{6}\kern-.06em} +\newrobustcmd*\doublesharp {\musicsymbol{5}\kern-.05em} +\newrobustcmd*\doubleflat {\kern-.05em\musicsymbol{3}\kern-.06em} +\newrobustcmd*\trebleclef {\musicsymbol{H}} +\newrobustcmd*\bassclef {\musicsymbol{J}} +\newrobustcmd*\altoclef {\musicsymbol{K}} +\newrobustcmd*\allabreve {\kern-.15em\musicsymbol{R}} +\newrobustcmd*\meterC {\kern-.15em\musicsymbol{S}} +\newrobustcmd*\wholerest {\musicsymbol{<}} +\newrobustcmd*\halfrest {\musicsymbol{=}} +\newrobustcmd*\quarterrest {\musicsymbol[-1ex]{>}\kern.25em} +\newrobustcmd*\eighthrest {\musicsymbol[-1ex]{?}\kern.33em} +\newrobustcmd*\sixteenthrest {\musicsymbol[-1ex]{@}\kern.33em} + +\newcommand*\leadsheets@size{\f@size pt} +\newlength\leadsheets@barheight + +\newrobustcmd*\genericbar[1]{% + \setlength\leadsheets@barheight\leadsheets@size + \rule[-.2\leadsheets@barheight]{#1}{\leadsheets@barheight}% +} + +\newcommand*\normalbarwidth{.02em} +\newcommand*\thickbarwidth{.15em} +\newcommand*\interbarwidth{.1em} + +\newrobustcmd*\leadsheets@thickbar{% + \genericbar{\thickbarwidth}% +} + +\newrobustcmd*\leadsheets@repeatcolon{% + \leavevmode + \setlength\leadsheets@barheight\leadsheets@size + \raise.1\leadsheets@barheight\hbox{:}% +} + +\newrobustcmd*\leadsheets@interbar{\kern\interbarwidth\relax} + +\newrobustcmd*\normalbar{% + \genericbar{\normalbarwidth}% +} + +\newrobustcmd*\leftrepeat{% + \leadsheets@thickbar + \leadsheets@interbar + \normalbar + \leadsheets@repeatcolon +} + +\newrobustcmd*\rightrepeat{% + \leadsheets@repeatcolon + \normalbar + \leadsheets@interbar + \leadsheets@thickbar +} + +\newrobustcmd*\leftrightrepeat{% + \leadsheets@repeatcolon + \leadsheets@thickbar + \leadsheets@interbar + \leadsheets@thickbar + \leadsheets@repeatcolon +} + +\newrobustcmd*\doublebar{% + \normalbar + \leadsheets@interbar + \normalbar +} + +\newrobustcmd*\stopbar{% + \normalbar + \leadsheets@interbar + \leadsheets@thickbar +} + +\endinput |