diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-main.tex')
-rw-r--r-- | Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-main.tex | 259 |
1 files changed, 92 insertions, 167 deletions
diff --git a/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-main.tex b/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-main.tex index c7f0f93506d..95b463c90c1 100644 --- a/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-main.tex +++ b/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-main.tex @@ -1,6 +1,6 @@ %GregorioTeX main file. % -% Copyright (C) 2007-2021 The Gregorio Project (see CONTRIBUTORS.md) +% Copyright (C) 2007-2019 The Gregorio Project (see CONTRIBUTORS.md) % % This file is part of Gregorio. % @@ -21,7 +21,17 @@ % The version of gregorio. All gregoriotex*.tex files must have the same. % All gtex files must also have the same version. -\xdef\gre@gregoriotexversion{6.0.0-beta1}% GREGORIO_VERSION - VersionManager.py +\xdef\gre@gregoriotexversion{5.2.1}% GREGORIO_VERSION - VersionManager.py + +\ifluatex% + \ifnum\luatexversion<76% + \gre@error{Error: this document must be compiled with LuaTeX (lualatex) 0.76 or later}% + \fi% +\else% + \gre@error{Error: this document must be compiled with LuaTeX (lualatex)}% +\fi% + + % first some macros to allow checks for version: % Tests that all gregoriotex files are of the same version. @@ -621,6 +631,16 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% macros for the score reference (unused) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def\grescorereference#1{% OBSOLETE + \gre@error{\protect\grescorereference\space is obsolete.\MessageBreak It does nothing; stop using it.}% + \relax % +}% + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting the things above the initial %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -730,28 +750,14 @@ % - typeset the text above the lines if relevant, and making sure we execute it only once % - not do anything else -\newif\ifgre@showabovelinestext% -\gre@showabovelinestexttrue% - -\def\gresetabovelinestext#1{% - \IfStrEqCase{#1}{% - {visible}{\gre@showabovelinestexttrue}% - {invisible}{\gre@showabovelinestextfalse}% - }[% all other cases - \gre@error{Unknown option, "#1" for \protect\gresetabovelinestext\MessageBreak Possible options are: 'visible' and 'invisible'}% - ]% -}% - \xdef\gre@currenttextabovelines{}% \def\GreSetTextAboveLines#1{% - \ifgre@showabovelinestext% - \gdef\gre@currenttextabovelines{% - \gre@typesettextabovelines{#1}{0}% - \gdef\gre@currenttextabovelines{}% - \relax % - }% - \fi% + \gdef\gre@currenttextabovelines{% + \gre@typesettextabovelines{#1}{0}% + \gdef\gre@currenttextabovelines{}% + \relax % + }% }% % typesets the text or nabc neumes above the line @@ -1031,55 +1037,37 @@ ]% }% -\newif\ifgre@showtranslation% -\gre@showtranslationtrue% - -\def\gresettranslation#1{% - \IfStrEqCase{#1}{% - {visible}{\gre@showtranslationtrue}% - {invisible}{\gre@showtranslationfalse}% - }[% all other cases - \gre@error{Unknown option, "#1" for \protect\gresettranslation\MessageBreak Possible options are: 'visible' and 'invisible'}% - ]% -}% - \def\GreWriteTranslation#1{% - \ifgre@showtranslation% - \ifgre@translationcentering % - \setbox\gre@box@temp@width=\hbox{#1}% - \gre@dimen@temp@five=\dimexpr((\wd\gre@box@syllabletext - \wd\gre@box@temp@width) / 2)\relax% - \gre@mark@translation % - \kern\gre@dimen@temp@five % - \raise\gre@space@dimen@spacebeneathtext\hbox to 0pt{\vbox to 0pt{\vss\hbox to 0pt{\gre@style@translation#1\endgre@style@translation\hss}}}% - \kern-\gre@dimen@temp@five % - \else % - \gre@mark@translation % - \raise\gre@space@dimen@spacebeneathtext\hbox to 0pt{\vbox to 0pt{\vss\hbox to 0pt{\gre@style@translation#1\endgre@style@translation\hss}}}% - \fi % - \fi% + \ifgre@translationcentering % + \setbox\gre@box@temp@width=\hbox{#1}% + \gre@dimen@temp@five=\dimexpr((\wd\gre@box@syllabletext - \wd\gre@box@temp@width) / 2)\relax% + \gre@mark@translation % + \kern\gre@dimen@temp@five % + \raise\gre@space@dimen@spacebeneathtext\hbox to 0pt{\vbox to 0pt{\vss\hbox to 0pt{\gre@style@translation#1\endgre@style@translation\hss}}}% + \kern-\gre@dimen@temp@five % + \else % + \gre@mark@translation % + \raise\gre@space@dimen@spacebeneathtext\hbox to 0pt{\vbox to 0pt{\vss\hbox to 0pt{\gre@style@translation#1\endgre@style@translation\hss}}}% + \fi % }% \def\GreWriteTranslationWithCenterBeginning#1{% - \ifgre@showtranslation% - \ifgre@breakintranslation\else% - \GreBeginNLBArea{0}{1}% - \fi % - \gre@attr@center=1\relax % - \gre@mark@translation % - \raise\gre@space@dimen@spacebeneathtext\hbox to 0pt{\kern 0pt\vbox to 0pt{\vss\hbox to 0pt{\gre@style@translation#1\endgre@style@translation\hss}}\kern 0pt}% - \unsetluatexattribute{\gre@attr@center}% - \relax % - \fi% + \ifgre@breakintranslation\else% + \GreBeginNLBArea{0}{1}% + \fi % + \gre@attr@center=1\relax % + \gre@mark@translation % + \raise\gre@space@dimen@spacebeneathtext\hbox to 0pt{\kern 0pt\vbox to 0pt{\vss\hbox to 0pt{\gre@style@translation#1\endgre@style@translation\hss}}\kern 0pt}% + \unsetluatexattribute{\gre@attr@center}% + \relax % }% \newif\ifgre@mustdotranslationcenterend% \gre@mustdotranslationcenterendfalse% \def\GreTranslationCenterEnd{% - \ifgre@showtranslation% - \gre@mustdotranslationcenterendtrue% - \relax % - \fi% + \gre@mustdotranslationcenterendtrue% + \relax % }% \def\gre@dotranslationcenterend{% @@ -1126,19 +1114,6 @@ ]% }% -\newif\ifgre@noteadditionalspacelinestext% -\def\gresetnoteadditionalspacelinestext#1{% - \IfStrEqCase{#1}{% - {automatic}% - {\gre@noteadditionalspacelinestextfalse}% - {manual}% - {\gre@noteadditionalspacelinestexttrue}% - }[% all other cases - \gre@error{Unrecognized option "#1" for \protect\gresetnoteadditionalspacelinestext\MessageBreak Possible options are: 'automatic' and 'manual'}% - ]% -}% -\gresetnoteadditionalspacelinestext{automatic}%default setting - % gre@attr@dash (see its definition in gregorio-syllable) is 0 when we are in a score, and unset when we are not \newif\ifgre@beginningofscore% @@ -1161,14 +1136,10 @@ \let\gre@pitch@overbrace\gre@pitch@i % \let\gre@char@bar@virgula\GreCPVirgulaTwo % \let\gre@char@bar@virgulahigh\GreCPVirgulaThree % - \let\gre@char@bar@virgulaparen\GreCPVirgulaParenTwo % - \let\gre@char@bar@virgulaparenhigh\GreCPVirgulaParenThree % \let\gre@char@bar@divisiominimis\GreCPDivisioMinimisTwo % \let\gre@char@bar@divisiominimishigh\GreCPDivisioMinimisThree % \let\gre@char@bar@divisiominima\GreCPDivisioMinimaTwo % \let\gre@char@bar@divisiominimahigh\GreCPDivisioMinimaThree % - \let\gre@char@bar@divisiominimaparen\GreCPDivisioMinimaParenTwo % - \let\gre@char@bar@divisiominimaparenhigh\GreCPDivisioMinimaParenThree % \let\gre@char@bar@divisiominor\GreCPDivisioMinorTwo % \let\gre@char@bar@divisiomaior\GreCPDivisioMaiorTwo % \let\gre@char@bar@divisiomaiordotted\GreCPDivisioMaiorDottedTwo % @@ -1184,14 +1155,10 @@ \let\gre@pitch@overbrace\gre@pitch@k % \let\gre@char@bar@virgula\GreCPVirgulaThree % \let\gre@char@bar@virgulahigh\GreCPVirgulaFour % - \let\gre@char@bar@virgulaparen\GreCPVirgulaParenThree % - \let\gre@char@bar@virgulaparenhigh\GreCPVirgulaParenFour % \let\gre@char@bar@divisiominimis\GreCPDivisioMinimisThree % \let\gre@char@bar@divisiominimishigh\GreCPDivisioMinimisFour % \let\gre@char@bar@divisiominima\GreCPDivisioMinimaThree % \let\gre@char@bar@divisiominimahigh\GreCPDivisioMinimaFour % - \let\gre@char@bar@divisiominimaparen\GreCPDivisioMinimaParenThree % - \let\gre@char@bar@divisiominimaparenhigh\GreCPDivisioMinimaParenFour % \let\gre@char@bar@divisiominor\GreCPDivisioMinorThree % \let\gre@char@bar@divisiomaior\GreCPDivisioMaiorThree % \let\gre@char@bar@divisiomaiordotted\GreCPDivisioMaiorDottedThree % @@ -1207,14 +1174,10 @@ \let\gre@pitch@overbrace\gre@pitch@m % \let\gre@char@bar@virgula\GreCPVirgulaFour % \let\gre@char@bar@virgulahigh\GreCPVirgulaFive % - \let\gre@char@bar@virgulaparen\GreCPVirgulaParenFour % - \let\gre@char@bar@virgulaparenhigh\GreCPVirgulaParenFive % \let\gre@char@bar@divisiominimis\GreCPDivisioMinimisFour % \let\gre@char@bar@divisiominimishigh\GreCPDivisioMinimisFive % \let\gre@char@bar@divisiominima\GreCPDivisioMinimaFour % \let\gre@char@bar@divisiominimahigh\GreCPDivisioMinimaFive % - \let\gre@char@bar@divisiominimaparen\GreCPDivisioMinimaParenFour % - \let\gre@char@bar@divisiominimaparenhigh\GreCPDivisioMinimaParenFive % \let\gre@char@bar@divisiominor\GreCPDivisioMinorFour % \let\gre@char@bar@divisiomaior\GreCPDivisioMaiorFour % \let\gre@char@bar@divisiomaiordotted\GreCPDivisioMaiorDottedFour % @@ -1230,14 +1193,10 @@ \let\gre@pitch@overbrace\gre@pitch@p % \let\gre@char@bar@virgula\GreCPVirgulaFive % \let\gre@char@bar@virgulahigh\GreCPVirgulaSix % - \let\gre@char@bar@virgulaparen\GreCPVirgulaParenFive % - \let\gre@char@bar@virgulaparenhigh\GreCPVirgulaParenSix % \let\gre@char@bar@divisiominimis\GreCPDivisioMinimisFive % \let\gre@char@bar@divisiominimishigh\GreCPDivisioMinimisSix % \let\gre@char@bar@divisiominima\GreCPDivisioMinimaFive % \let\gre@char@bar@divisiominimahigh\GreCPDivisioMinimaSix % - \let\gre@char@bar@divisiominimaparen\GreCPDivisioMinimaParenFive % - \let\gre@char@bar@divisiominimaparenhigh\GreCPDivisioMinimaParenSix % \let\gre@char@bar@divisiominor\GreCPDivisioMinorFive % \let\gre@char@bar@divisiomaior\GreCPDivisioMaiorFive % \let\gre@char@bar@divisiomaiordotted\GreCPDivisioMaiorDottedFive % @@ -1283,6 +1242,8 @@ \gre@computespaces% \gre@cancelpenalties % \gre@attr@dash=0\relax % + \xdef\gre@exhyphencharsave{\the\exhyphenchar}% + \exhyphenchar=-1\relax % \gre@generatelines % \noindent% \gre@calculate@additionalspaces{#2}{#3}{#4}{#5}% @@ -1333,6 +1294,7 @@ \gre@removetranslationspace % \gre@normalinitial % \gre@restorepenalties % + \exhyphenchar=\gre@exhyphencharsave % \gre@dimen@temp@one=0pt\relax% \gre@dimen@temp@two=0pt\relax% \gre@dimen@temp@three=0pt\relax% @@ -1585,10 +1547,6 @@ %% 20: space between a punctum inclinatum and a "no-bar" glyph two pitches above %% 21: space between a punctum inclinatum and a "no-bar" glyph three or four pitches above %% 22: half-space -%% 23: Space between two puncta inclinata on a unison -%% 24: Space before a right-leaning puncta inclinatum when the pitch is ascending (up to 4 pitches away) -%% 25: Space before a left-leaning puncta inclinatum when the pitch is descending (up to 4 pitches away) -%% 26: Space after after a non-punctum inclinatum and before the upright punctum inclinatum \def\gre@get@spaceskip#1{% \gre@trace{gre@get@spaceskip{#1}}% \ifcase#1% @@ -1644,7 +1602,7 @@ \or% case 25 \gre@skip@temp@four = \gre@space@skip@ascendingpunctuminclinatumdescendingshift\relax% \or% case 26 - \gre@skip@temp@four = \gre@space@skip@uprightpunctuminclinatumshift\relax% + \gre@skip@temp@four = \gre@space@skip@unisonpunctuminclinatumshift\relax% \else% \gre@error{Unrecognized spaceskip #1}% \fi% @@ -1667,13 +1625,13 @@ % 2: no line break area due to <nlba> tag \xdef\gre@nlbstate{0}% -\newcount\gre@saved@prenlba@nobreakpenalty% -\newcount\gre@saved@prenlba@endofwordpenalty% -\newcount\gre@saved@prenlba@endofsyllablepenalty% -\newcount\gre@saved@prenlba@endafterbarpenalty% -\newcount\gre@saved@prenlba@endafterbaraltpenalty% -\newcount\gre@saved@prenlba@endofelementpenalty% -\newcount\gre@saved@prenlba@hyphenpenalty% +\newcount\gre@nobreakpenaltysave% +\newcount\gre@endofwordpenaltysave% +\newcount\gre@endofsyllablepenaltysave% +\newcount\gre@endafterbarpenaltysave% +\newcount\gre@endafterbaraltpenaltysave% +\newcount\gre@endofelementpenaltysave% +%\newcount\gre@hyphenpenaltysave% in gregoriotex-spaces.tex % first argument is if if the nlba is starting in neumes or not % second argument is if it is called from translation centering or not \def\GreBeginNLBArea#1#2{% @@ -1690,25 +1648,20 @@ \fi % \fi % \ifnum\gre@nlbinitialstate=0\relax % - \global\gre@saved@prenlba@nobreakpenalty=\gre@space@count@nobreakpenalty\relax % - \global\gre@space@count@nobreakpenalty=10001\relax % + \global\gre@nobreakpenaltysave=\gre@space@count@nobreakpenalty\relax % + \global\gre@endofwordpenaltysave=\gre@space@count@endofwordpenalty\relax % + \global\gre@endofsyllablepenaltysave=\gre@space@count@endofsyllablepenalty\relax % + \global\gre@endafterbarpenaltysave=\gre@space@count@endafterbarpenalty\relax % + \global\gre@endafterbaraltpenaltysave=\gre@space@count@endafterbaraltpenalty\relax % + \global\gre@endofelementpenaltysave=\gre@space@count@endofelementpenalty\relax % + \global\gre@hyphenpenaltysave=\gre@space@count@hyphenpenalty\relax % % - \global\gre@saved@prenlba@endofwordpenalty=\gre@space@count@endofwordpenalty\relax % + \global\gre@space@count@nobreakpenalty=10001\relax % \global\gre@space@count@endofwordpenalty=10001\relax % - % - \global\gre@saved@prenlba@endofsyllablepenalty=\gre@space@count@endofsyllablepenalty\relax % \global\gre@space@count@endofsyllablepenalty=10001\relax % - % - \global\gre@saved@prenlba@endafterbarpenalty=\gre@space@count@endafterbarpenalty\relax % \global\gre@space@count@endafterbarpenalty=10001\relax % - % - \global\gre@saved@prenlba@endafterbaraltpenalty=\gre@space@count@endafterbaraltpenalty\relax % \global\gre@space@count@endafterbaraltpenalty=10001\relax % - % - \global\gre@saved@prenlba@endofelementpenalty=\gre@space@count@endofelementpenalty\relax % \global\gre@space@count@endofelementpenalty=10001\relax % - % - \global\gre@saved@prenlba@hyphenpenalty=\gre@space@count@hyphenpenalty\relax % \global\gre@space@count@hyphenpenalty=10001\relax % \fi % }% @@ -1729,13 +1682,13 @@ % if gre@nlbstate is not 0, then nothing should happend \ifnum\gre@nlbstate=0\relax % \ifnum\gre@nlbinitialstate=0\else % - \global\gre@space@count@nobreakpenalty=\gre@saved@prenlba@nobreakpenalty\relax % - \global\gre@space@count@endofwordpenalty=\gre@saved@prenlba@endofwordpenalty\relax % - \global\gre@space@count@endofsyllablepenalty=\gre@saved@prenlba@endofsyllablepenalty\relax % - \global\gre@space@count@endafterbarpenalty=\gre@saved@prenlba@endafterbarpenalty\relax % - \global\gre@space@count@endafterbaraltpenalty=\gre@saved@prenlba@endafterbaraltpenalty\relax % - \global\gre@space@count@endofelementpenalty=\gre@saved@prenlba@endofelementpenalty\relax % - \global\gre@space@count@hyphenpenalty=\gre@saved@prenlba@hyphenpenalty\relax % + \global\gre@space@count@nobreakpenalty=\gre@nobreakpenaltysave\relax % + \global\gre@space@count@endofwordpenalty=\gre@endofwordpenaltysave\relax % + \global\gre@space@count@endofsyllablepenalty=\gre@endofsyllablepenaltysave\relax % + \global\gre@space@count@endafterbarpenalty=\gre@endafterbarpenaltysave\relax % + \global\gre@space@count@endafterbaraltpenalty=\gre@endafterbaraltpenaltysave\relax % + \global\gre@space@count@endofelementpenalty=\gre@endofelementpenaltysave\relax % + \global\gre@space@count@hyphenpenalty=\gre@hyphenpenaltysave\relax % \ifcase #1\relax % 0 \gre@penalty{\the\gre@space@count@endofelementpenalty}% \or % 1 @@ -1816,34 +1769,25 @@ \gre@trace@end% }% -%% font calibration distances -\newdimen\gre@dimen@stafflinethicknessbase% -\newdimen\gre@dimen@glyphraisebase% -\newdimen\gre@dimen@interstafflinedistancebase% -\newdimen\gre@dimen@inclinatumonlinemoravshiftbase% -\newdimen\gre@dimen@inclinatumonlinemorahshiftbase% -\newdimen\gre@dimen@inclinatumofflinemorahshiftbase% - \def\gre@setgregoriofontscaled[#1]#2#3{% \gre@trace{gre@setgregoriofontscaled[#1]{#2}{#3}}% - \if\relax\detokenize{#1}\relax % - \xdef\gre@gregoriofontname{#2}% - \expandafter\xdef\csname gre@fontfactor@#2\endcsname{#3}% - \gre@loadgregoriofont% - \gdef\GreCPVirgaReversaAscendensOnDLine##1{##1}% - \else % - \xdef\gre@gregoriofontname{#2-#1}% - \expandafter\xdef\csname gre@fontfactor@#2-#1\endcsname{#3}% - \gre@loadgregoriofont% - \gdef\GreCPVirgaReversaAscendensOnDLine##1{\GreCPVirgaReversaLongqueueAscendens}% - \fi % - % currently all fonts use the same calibration distances - \gre@dimen@stafflinethicknessbase=1500sp\relax % - \gre@dimen@glyphraisebase=-22000sp\relax% - \gre@dimen@interstafflinedistancebase=30000sp\relax% - \gre@dimen@inclinatumonlinemoravshiftbase=4500sp\relax% - \gre@dimen@inclinatumonlinemorahshiftbase=3700sp\relax% - \gre@dimen@inclinatumofflinemorahshiftbase=2500sp\relax% + \IfStrEq{#2}{parmesan}{%%% OBSOLETE + \gre@obsolete{'parmesan' font}{'granapadano' font}%%% OBSOLETE + }{%%% OBSOLETE + % keep this section + \if\relax\detokenize{#1}\relax % + \xdef\gre@gregoriofontname{#2}% + \expandafter\xdef\csname gre@fontfactor@#2\endcsname{#3}% + \gre@loadgregoriofont% + \gdef\GreCPVirgaReversaAscendensOnDLine##1{##1}% + \else % + \xdef\gre@gregoriofontname{#2-#1}% + \expandafter\xdef\csname gre@fontfactor@#2-#1\endcsname{#3}% + \gre@loadgregoriofont% + \gdef\GreCPVirgaReversaAscendensOnDLine##1{\GreCPVirgaReversaLongqueueAscendens}% + \fi % + }%%% OBSOLETE + \relax % \gre@trace@end% }% @@ -1896,6 +1840,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\grechangestyle#1#2{% + \IfStrEq{#1}{biginitial}{\gre@obsolete{biginitial style}{initial style}}{}%%% OBSOLETE \@ifnextchar[{\gre@changestyle{#1}{#2}}{\gre@changestyle{#1}{#2}[\relax]}% }% @@ -1932,20 +1877,6 @@ %% score including %%%%%%%%%%%%%%%%%%% - -\def\gre@maketable#1{\ifx\relax#1\else,"#1"\expandafter\gre@maketable\fi} - -\def\gresetgregpath#1{% - \def\gre@input@path{#1}% - \directlua{ - gre_input_path = {""\expandafter\gre@maketable\gre@input@path\relax} - } -} - -\ifx\gre@input@path\@undefined - \let\gre@input@path\input@path -\fi - % Flag to track compilation behavior % 0 = never compile (default) % 1 = auto compile (compile outdated scores and those lacking a compiled version) @@ -1979,8 +1910,6 @@ % This forces gregoriotex to recompile the gabc file. \def\gre@gregorioscore#1{% - \begingroup% - \let\input@path\gre@input@path% \ifcase\gre@compilegabc% case 0, never compile \gre@debugmsg{compile}{Refusing to compile #1}% \input #1% @@ -1992,7 +1921,6 @@ \directlua{gregoriotex.include_score([[#1]], true, \gre@allowdeprecated@asboolean)}% \fi% \relax% - \endgroup% }% % The internal macro called when \gregorioscore is called with the optional argument. Behavior is determined by the value of the argument: @@ -2000,8 +1928,6 @@ % a - perform the checks to see if the score needs to be recompiled and do so only if necessary % f - force the compilation of the score before including it \def\gre@gregorioscore@option[#1]#2{% - \begingroup% - \let\input@path\gre@input@path% \ifx #1n\relax% \gre@debugmsg{compile}{Override not compiling #2}% \input #2% @@ -2019,7 +1945,6 @@ \fi% \fi% \relax% - \endgroup% }% % The main macro used by the user to input scores into the document. |