diff options
author | Norbert Preining <norbert@preining.info> | 2021-03-02 03:04:42 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-03-02 03:04:42 +0000 |
commit | 4763ec8ceefaf2b038d591b8c15d88d081aec6c9 (patch) | |
tree | 113e7c21358dd01318b8e7a1e3f3228ec33bc563 /support/gregoriotex/tex/luatex/gregoriotex-main.tex | |
parent | 3a1a102e980610859d9f1b197733d6ce6a541c62 (diff) |
CTAN sync 202103020304
Diffstat (limited to 'support/gregoriotex/tex/luatex/gregoriotex-main.tex')
-rw-r--r-- | support/gregoriotex/tex/luatex/gregoriotex-main.tex | 259 |
1 files changed, 167 insertions, 92 deletions
diff --git a/support/gregoriotex/tex/luatex/gregoriotex-main.tex b/support/gregoriotex/tex/luatex/gregoriotex-main.tex index 95b463c90c..c7f0f93506 100644 --- a/support/gregoriotex/tex/luatex/gregoriotex-main.tex +++ b/support/gregoriotex/tex/luatex/gregoriotex-main.tex @@ -1,6 +1,6 @@ %GregorioTeX main file. % -% Copyright (C) 2007-2019 The Gregorio Project (see CONTRIBUTORS.md) +% Copyright (C) 2007-2021 The Gregorio Project (see CONTRIBUTORS.md) % % This file is part of Gregorio. % @@ -21,17 +21,7 @@ % The version of gregorio. All gregoriotex*.tex files must have the same. % All gtex files must also have the same version. -\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% - - +\xdef\gre@gregoriotexversion{6.0.0-beta1}% GREGORIO_VERSION - VersionManager.py % first some macros to allow checks for version: % Tests that all gregoriotex files are of the same version. @@ -631,16 +621,6 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -750,14 +730,28 @@ % - 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{% - \gdef\gre@currenttextabovelines{% - \gre@typesettextabovelines{#1}{0}% - \gdef\gre@currenttextabovelines{}% - \relax % - }% + \ifgre@showabovelinestext% + \gdef\gre@currenttextabovelines{% + \gre@typesettextabovelines{#1}{0}% + \gdef\gre@currenttextabovelines{}% + \relax % + }% + \fi% }% % typesets the text or nabc neumes above the line @@ -1037,37 +1031,55 @@ ]% }% +\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@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 % + \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% }% \def\GreWriteTranslationWithCenterBeginning#1{% - \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 % + \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% }% \newif\ifgre@mustdotranslationcenterend% \gre@mustdotranslationcenterendfalse% \def\GreTranslationCenterEnd{% - \gre@mustdotranslationcenterendtrue% - \relax % + \ifgre@showtranslation% + \gre@mustdotranslationcenterendtrue% + \relax % + \fi% }% \def\gre@dotranslationcenterend{% @@ -1114,6 +1126,19 @@ ]% }% +\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% @@ -1136,10 +1161,14 @@ \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 % @@ -1155,10 +1184,14 @@ \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 % @@ -1174,10 +1207,14 @@ \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 % @@ -1193,10 +1230,14 @@ \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 % @@ -1242,8 +1283,6 @@ \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}% @@ -1294,7 +1333,6 @@ \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% @@ -1547,6 +1585,10 @@ %% 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% @@ -1602,7 +1644,7 @@ \or% case 25 \gre@skip@temp@four = \gre@space@skip@ascendingpunctuminclinatumdescendingshift\relax% \or% case 26 - \gre@skip@temp@four = \gre@space@skip@unisonpunctuminclinatumshift\relax% + \gre@skip@temp@four = \gre@space@skip@uprightpunctuminclinatumshift\relax% \else% \gre@error{Unrecognized spaceskip #1}% \fi% @@ -1625,13 +1667,13 @@ % 2: no line break area due to <nlba> tag \xdef\gre@nlbstate{0}% -\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 +\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% % 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{% @@ -1648,20 +1690,25 @@ \fi % \fi % \ifnum\gre@nlbinitialstate=0\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@nobreakpenalty=\gre@space@count@nobreakpenalty\relax % \global\gre@space@count@nobreakpenalty=10001\relax % + % + \global\gre@saved@prenlba@endofwordpenalty=\gre@space@count@endofwordpenalty\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 % }% @@ -1682,13 +1729,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@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 % + \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 % \ifcase #1\relax % 0 \gre@penalty{\the\gre@space@count@endofelementpenalty}% \or % 1 @@ -1769,25 +1816,34 @@ \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}}% - \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 % + \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% \gre@trace@end% }% @@ -1840,7 +1896,6 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\grechangestyle#1#2{% - \IfStrEq{#1}{biginitial}{\gre@obsolete{biginitial style}{initial style}}{}%%% OBSOLETE \@ifnextchar[{\gre@changestyle{#1}{#2}}{\gre@changestyle{#1}{#2}[\relax]}% }% @@ -1877,6 +1932,20 @@ %% 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) @@ -1910,6 +1979,8 @@ % 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% @@ -1921,6 +1992,7 @@ \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: @@ -1928,6 +2000,8 @@ % 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% @@ -1945,6 +2019,7 @@ \fi% \fi% \relax% + \endgroup% }% % The main macro used by the user to input scores into the document. |