| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
% % |
| 3 |
% This file is part of the 'lilyglyphs' LaTeX package. % |
| 4 |
% ========== % |
| 5 |
% % |
| 6 |
% https://github.com/openlilylib/lilyglyphs % |
| 7 |
% http://www.openlilylib.org/lilyglyphs % |
| 8 |
% % |
| 9 |
% Copyright 2012-2020 Urs Liska and others, [email protected] % |
| 10 |
% % |
| 11 |
% 'lilyglyphs' is free software: you can redistribute it and/or modify % |
| 12 |
% it under the terms of the LaTeX Project Public License, either % |
| 13 |
% version 1.3 of this license or (at your option) any later version. % |
| 14 |
% You may find the latest version of this license at % |
| 15 |
% http://www.latex-project.org/lppl.txt % |
| 16 |
% more information on % |
| 17 |
% http://latex-project.org/lppl/ % |
| 18 |
% and version 1.3 or later is part of all distributions of LaTeX % |
| 19 |
% version 2005/12/01 or later. % |
| 20 |
% % |
| 21 |
% This work has the LPPL maintenance status 'maintained'. % |
| 22 |
% The Current Maintainer of this work is Urs Liska (see above). % |
| 23 |
% % |
| 24 |
% This work consists of the files listed in the file 'manifest.txt' % |
| 25 |
% which can be found in the 'license' directory. % |
| 26 |
% % |
| 27 |
% This program is distributed in the hope that it will be useful, % |
| 28 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of % |
| 29 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. % |
| 30 |
% % |
| 31 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 32 |
|
| 33 |
\NeedsTeXFormat{LaTeX2e} |
| 34 |
\ProvidesPackage{lilyglyphsStyle} |
| 35 |
|
| 36 |
\RequirePackage{fontspec} |
| 37 |
|
| 38 |
% Of course we need lilyglyphs itself :-) |
| 39 |
\RequirePackage{lilyglyphs} |
| 40 |
|
| 41 |
% Improve typography and paragraph layout |
| 42 |
\RequirePackage{microtype} |
| 43 |
|
| 44 |
% Suppress superfluous ligature |
| 45 |
\RequirePackage[english]{selnolig} |
| 46 |
|
| 47 |
% Typeset XeLaTeX and LuaTeX logos regardless of engine used |
| 48 |
\RequirePackage{hologo} |
| 49 |
|
| 50 |
\frenchspacing |
| 51 |
|
| 52 |
% Enhanced table commands |
| 53 |
\RequirePackage{booktabs} |
| 54 |
\RequirePackage{longtable} |
| 55 |
|
| 56 |
% Tightly spaced lists |
| 57 |
\RequirePackage{mdwlist} |
| 58 |
|
| 59 |
% Typeset listings |
| 60 |
% (Special styles defined in OLLstyles.sty) |
| 61 |
\RequirePackage{listings} |
| 62 |
% Format listings with typewriter font by default |
| 63 |
\lstset{ |
| 64 |
frame=single, |
| 65 |
basicstyle=\fontspec{Liberation Mono}\footnotesize} |
| 66 |
|
| 67 |
% Common table format for reference tables |
| 68 |
\newenvironment{reftable}[2] |
| 69 |
{% |
| 70 |
\begin{center} |
| 71 |
\begin{longtable}[H]{lll} |
| 72 |
\caption{#1}\\ |
| 73 |
\label{tab:#2}\\ |
| 74 |
\toprule |
| 75 |
&\\ |
| 76 |
} |
| 77 |
{% |
| 78 |
&\\ |
| 79 |
\bottomrule |
| 80 |
\end{longtable} |
| 81 |
\end{center} |
| 82 |
} |
| 83 |
|
| 84 |
% Insert a picture with a glyph list from LilyPond's glyph list |
| 85 |
% #1 is the caption of the figure |
| 86 |
% #2 the label name |
| 87 |
% #5 the file name of the image |
| 88 |
\newcommand{\glyphlist}[3]{% |
| 89 |
\begin{figure}[htbp] |
| 90 |
\centering |
| 91 |
\includegraphics[width=.75\textwidth]{glyphlist/resources/#3} |
| 92 |
\caption{#1} |
| 93 |
\label{fig:#2} |
| 94 |
\end{figure} |
| 95 |
} |
| 96 |
|
| 97 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 98 |
% Character styles |
| 99 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 100 |
|
| 101 |
% Format LaTeX or LilyPond commands like \env with a prepended backslash |
| 102 |
\newcommand*{\cmd}[1]{\env{\textbackslash #1}} |
| 103 |
|
| 104 |
% Format directory names |
| 105 |
\newcommand*{\dir}[1]{\texttt{#1}} |
| 106 |
|
| 107 |
% Format environment names |
| 108 |
\newcommand*{\env}[1]{\texttt{#1}} |
| 109 |
|
| 110 |
% Format package names |
| 111 |
\newcommand*{\package}[1]{\texttt{#1}} |
| 112 |
|
| 113 |
% Add a TODO item that is easily spotted |
| 114 |
\newcommand{\todo}[1]{{\color{red}{\textbf{\textsf{[TODO: #1]}}}}} |
| 115 |
|
| 116 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 117 |
% Other commands |
| 118 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 119 |
|
| 120 |
% Reference an Issue on openLilyLib's Github account |
| 121 |
\newcommand*{\ghIssue}[1]{\href{https://github.com/openlilylib/lilyglyphs/issues/#1}{(GitHub-Issue \##1)}} |
| 122 |
|
| 123 |
% print "LilyPond" (may be formatted later) |
| 124 |
\newcommand*{\lilypond}{\texttt{LilyPond}} |
| 125 |
|
| 126 |
\newcommand*{\emmentaler}{\textsc{Emmentaler}} |
| 127 |
|
| 128 |
% print "openLilyLib" (may be formatted later) |
| 129 |
\newcommand*{\openlilylib}{\texttt{openLilyLib}} |
| 130 |
|
| 131 |
|
| 132 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 133 |
% Add fancyref for smart cross-references |
| 134 |
\RequirePackage{fancyref} |
| 135 |
|
| 136 |
% categories for subsection and subsubsection: |
| 137 |
|
| 138 |
% subsection - subsec: |
| 139 |
|
| 140 |
\newcommand*{\fancyrefsubseclabelprefix}{subsec} |
| 141 |
|
| 142 |
\fancyrefaddcaptions{english}{% |
| 143 |
\providecommand*{\frefsubsecname}{subsection}% |
| 144 |
\providecommand*{\Frefsubsecname}{Subsection}% |
| 145 |
} |
| 146 |
|
| 147 |
\frefformat{plain}{\fancyrefsubseclabelprefix}{\frefsubsecname\fancyrefdefaultspacing#1} |
| 148 |
\Frefformat{plain}{\fancyrefsubseclabelprefix}{\Frefsubsecname\fancyrefdefaultspacing#1} |
| 149 |
|
| 150 |
\frefformat{vario}{\fancyrefsubseclabelprefix}{% |
| 151 |
\frefsubsecname\fancyrefdefaultspacing#1#3% |
| 152 |
} |
| 153 |
\Frefformat{vario}{\fancyrefsubseclabelprefix}{% |
| 154 |
\Frefsubsecname\fancyrefdefaultspacing#1#3% |
| 155 |
} |
| 156 |
|
| 157 |
% subsubsection - subsubsec: |
| 158 |
|
| 159 |
\newcommand*{\fancyrefsubsubseclabelprefix}{subsubsec} |
| 160 |
|
| 161 |
\fancyrefaddcaptions{english}{% |
| 162 |
\providecommand*{\frefsubsubsecname}{subsection}% the same as for subsection |
| 163 |
\providecommand*{\Frefsubsubsecname}{Subsection}% |
| 164 |
} |
| 165 |
|
| 166 |
\frefformat{plain}{\fancyrefsubsubseclabelprefix}{\frefsubsubsecname\fancyrefdefaultspacing#1} |
| 167 |
\Frefformat{plain}{\fancyrefsubsubseclabelprefix}{\Frefsubsubsecname\fancyrefdefaultspacing#1} |
| 168 |
|
| 169 |
\frefformat{vario}{\fancyrefsubsubseclabelprefix}{% |
| 170 |
\frefsubsubsecname\fancyrefdefaultspacing#1#3% |
| 171 |
} |
| 172 |
\Frefformat{vario}{\fancyrefsubsubseclabelprefix}{% |
| 173 |
\Frefsubsubsecname\fancyrefdefaultspacing#1#3% |
| 174 |
} |
| 175 |
|
| 176 |
% End fancyref |
| 177 |
%%%%%%%%%%%%%%%%%% |
| 178 |
|
| 179 |
%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 180 |
% Options for use of hyperlinks |
| 181 |
% (make sure this is included last) |
| 182 |
\RequirePackage[% |
| 183 |
colorlinks, |
| 184 |
urlcolor=blue, |
| 185 |
bookmarks=true, |
| 186 |
bookmarksnumbered=true]{hyperref} |