summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/gregoriotex/gregoriosyms.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/gregoriotex/gregoriosyms.sty')
-rw-r--r--Master/texmf-dist/tex/lualatex/gregoriotex/gregoriosyms.sty107
1 files changed, 107 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/lualatex/gregoriotex/gregoriosyms.sty b/Master/texmf-dist/tex/lualatex/gregoriotex/gregoriosyms.sty
new file mode 100644
index 00000000000..622f3b1470f
--- /dev/null
+++ b/Master/texmf-dist/tex/lualatex/gregoriotex/gregoriosyms.sty
@@ -0,0 +1,107 @@
+%GregorioTeX file.
+%
+% Copyright (C) 2008-2015 The Gregorio Project (see CONTRIBUTORS.md)
+%
+% This file is part of Gregorio.
+%
+% Gregorio is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% Gregorio is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with Gregorio. If not, see <http://www.gnu.org/licenses/>.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{gregoriosyms}
+ [2016/03/10 v4.1.1 GregorioTeX symbols only.]% PARSE_VERSION_DATE_LTX
+
+% If gregoriotex has been loaded, then we need to abort the loading process of this package here in order to avoid some conflicts.
+\ifcsname gregoriotex@symbols@loaded\endcsname\endinput\fi%
+
+\RequirePackage{kvoptions}%
+\RequirePackage{ifluatex}%
+\RequirePackage{luatexbase}%
+\RequirePackage{luaotfload}
+\RequirePackage{luamplib}%
+\RequirePackage{xstring}%
+
+\newluatexcatcodetable\gre@atletter %
+\setluatexcatcodetable\gre@atletter{%
+ \catcode`\@=11 %
+}%
+
+% The version of gregorio. All gregoriotex*.tex files must have the same.
+% All gtex files must also have the same version.
+\xdef\gre@gregorioversion{4.1.1}% GREGORIO_VERSION - VersionManager.py
+
+\providecommand{\gre@declarefileversion}[2]{\relax}
+
+\def\gre@error#1{\PackageError{GregorioTeX}{#1}{}}%
+\def\gre@warning#1{\PackageWarning{GregorioTeX}{#1}}%
+\def\gre@bug#1{\PackageError{GregorioTeX}{#1 !! This is a bug in Gregorio. Please report it at https://github.com/gregorio-project/gregorio/issues}{}}%
+\def\gre@typeout{\typeout}
+
+\SetupKeyvalOptions{prefix=gre@}
+\DeclareStringOption{debug}[all]
+
+% This option allows the user to transform all deprecation messages
+% into errors. Allowing one to determine if the TeX file is compliant
+% with future versions of gregoriotex. To enable, use gregoriotex with
+% this option: allowdeprecated=false
+\DeclareBoolOption[true]{allowdeprecated}
+
+\ProcessKeyvalOptions*
+
+\def\gre@debugmsg#1#2{%
+ \IfStrEq{\gre@debug}{}{}%
+ %false
+ {\IfStrEq{#1}{all}%
+ %true
+ {\gre@error{Debug error: ‘all’ is not a permitted keyword}}%
+ %false
+ {\IfStrEq{\gre@debug}{all}%
+ %true
+ {\gre@typeout{GregorioTeX debug: (#1) #2}}%
+ %false
+ {\IfSubStr{\gre@debug}{#1}%
+ %true
+ {\gre@typeout{GregorioTeX debug: (#1) #2}}%
+ %false
+ {\relax}%
+ }%
+ }%
+ }%
+}%
+
+% Macro to handle deprecated macros.
+% #1 - the deprecated macro
+% #2 - the correct macro to use
+\def\gre@deprecated#1#2{%
+ \ifgre@allowdeprecated%
+ \gre@warning{#1\space is deprecated.\MessageBreak Use #2\space instead}%
+ \else%
+ \gre@error{#1\space is deprecated.\MessageBreak Use #2\space instead}%
+ \fi%
+ \relax%
+}%
+
+\def\gre@obsolete#1#2{%
+ \gre@error{#1\space is obsolete.\MessageBreak Use #2\space instead}%
+ \relax%
+}%
+\AtBeginDocument{\IfStrEq{\gre@debug}{}{}{\typeout{GregorioTeX is in debug mode}\typeout{\gre@debug\space messages will be printed to the log.}}}%
+
+\long\def\gre@iflatex#1{#1}
+\input gregoriotex-symbols.tex
+
+\xdef\gre@gregoriotexluaversion{\directlua{tex.write(gregoriotex.get_gregorioversion())}}%
+
+% Test to make sure that gregoriotex.lua is of the same version.
+\IfStrEq*{\gre@gregoriotexluaversion}{\gre@gregorioversion}{}{%else
+ \gre@error{uncoherent file versions: gregoriosyms.sty is in version \number\gre@gregorioversion \space\space while gregoriotex.lua is in version \gre@gregoriotexluaversion}}%