From f691c3de0ad3b6901c33679bd1ebe37745ef3066 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sat, 30 Jan 2021 16:31:12 -0500 Subject: [PATCH 01/37] Refactor saved penalties Registers for saved values are renamed to all consistently have `@saved@` in them. Lines of `\gre@cancelpenalties` are reorganized so that the saving and changing of each item are right next to each other. This makes it easier to check that every change has its appropriate value saved first. (cherry picked from commit 194e303568aff5c261c49bd97e5ddabad147b10a) --- tex/gregoriotex-spaces.tex | 89 ++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 38 deletions(-) diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index ff8d9c56c..37a18e54f 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -35,17 +35,17 @@ -\newcount\gre@hyphenpenaltysave% -\newcount\gre@exhyphenpenaltysave% -\newcount\gre@doublehyphendemeritssave% -\newcount\gre@finalhyphendemeritssave% -\newcount\gre@brokenpenaltysave% -\newcount\gre@loosenesssave% -\newcount\gre@tolerancesave% -\newcount\gre@pretolerancesave% -\newskip\gre@emergencystretchsave% -\newcount\gre@widowpenaltysave% -\newcount\gre@clubpenaltysave% +\newcount\gre@saved@hyphenpenalty% +\newcount\gre@saved@exhyphenpenalty% +\newcount\gre@saved@doublehyphendemerits% +\newcount\gre@saved@finalhyphendemerits% +\newcount\gre@saved@brokenpenalty% +\newcount\gre@saved@looseness% +\newcount\gre@saved@tolerance% +\newcount\gre@saved@pretolerance% +\newskip\gre@saved@emergencystretch% +\newcount\gre@saved@widowpenalty% +\newcount\gre@saved@clubpenalty% \newskip\gre@saved@parskip% \newskip\gre@saved@lineskip% \newskip\gre@saved@baselineskip% @@ -55,53 +55,66 @@ \def\gre@cancelpenalties{% \gre@trace{gre@cancelpenalties}% - \global\gre@hyphenpenaltysave=\hyphenpenalty\relax % - \global\gre@exhyphenpenaltysave=\exhyphenpenalty\relax % - \global\gre@doublehyphendemeritssave=\doublehyphendemerits\relax % - \global\gre@finalhyphendemeritssave=\finalhyphendemerits\relax % - \global\gre@brokenpenaltysave=\brokenpenalty\relax % - \global\gre@loosenesssave=\looseness\relax % - \global\gre@tolerancesave=\tolerance\relax % - \global\gre@pretolerancesave=\pretolerance\relax % - \global\gre@emergencystretchsave=\emergencystretch\relax % - \global\gre@widowpenaltysave=\widowpenalty\relax % - \global\gre@clubpenaltysave=\clubpenalty\relax % - % - \global\gre@saved@parskip=\parskip% - \global\gre@saved@lineskip=\lineskip% - \global\gre@saved@baselineskip=\baselineskip% - \global\gre@saved@lineskiplimit=\lineskiplimit% + \global\gre@saved@hyphenpenalty=\hyphenpenalty\relax % \hyphenpenalty=\gre@space@count@hyphenpenalty % + % + \global\gre@saved@exhyphenpenalty=\exhyphenpenalty\relax % \exhyphenpenalty=\gre@space@count@hyphenpenalty % + % + \global\gre@saved@doublehyphendemerits=\doublehyphendemerits\relax % \doublehyphendemerits=0\relax % + % + \global\gre@saved@finalhyphendemerits=\finalhyphendemerits\relax % \finalhyphendemerits=0\relax % + % + \global\gre@saved@brokenpenalty=\brokenpenalty\relax % \brokenpenalty=\gre@space@count@brokenpenalty % + % + \global\gre@saved@looseness=\looseness\relax % \looseness=\gre@space@count@looseness % + % + \global\gre@saved@tolerance=\tolerance\relax % \tolerance=\gre@space@count@tolerance % + % + \global\gre@saved@pretolerance=\pretolerance\relax % \pretolerance=\gre@space@count@pretolerance % + % + \global\gre@saved@emergencystretch=\emergencystretch\relax % \emergencystretch=\gre@space@skip@emergencystretch\relax % + % + \global\gre@saved@widowpenalty=\widowpenalty\relax % \widowpenalty=\gre@space@count@widowpenalty % + % + \global\gre@saved@clubpenalty=\clubpenalty\relax % \clubpenalty=\gre@space@count@clubpenalty % + % + \global\gre@saved@parskip=\parskip% \parskip=\gre@space@skip@parskip% + % + \global\gre@saved@lineskip=\lineskip% \lineskip=\gre@space@skip@lineskip% + % + \global\gre@saved@baselineskip=\baselineskip% \baselineskip=\gre@space@skip@baselineskip% + % + \global\gre@saved@lineskiplimit=\lineskiplimit% \lineskiplimit=\gre@space@skip@lineskiplimit% \gre@trace@end% }% \def\gre@restorepenalties{% \gre@trace{gre@restorepenalties}% - \hyphenpenalty=\gre@hyphenpenaltysave % - \exhyphenpenalty=\gre@exhyphenpenaltysave % - \doublehyphendemerits=\gre@doublehyphendemeritssave % - \finalhyphendemerits=\gre@finalhyphendemeritssave % - \brokenpenalty=\gre@brokenpenaltysave % - \looseness=\gre@loosenesssave % - \tolerance=\gre@tolerancesave % - \pretolerance=\gre@pretolerancesave % - \emergencystretch=\gre@emergencystretchsave % - \widowpenalty=\gre@widowpenaltysave % - \clubpenalty=\gre@clubpenaltysave % + \hyphenpenalty=\gre@saved@hyphenpenalty % + \exhyphenpenalty=\gre@saved@exhyphenpenalty % + \doublehyphendemerits=\gre@saved@doublehyphendemerits % + \finalhyphendemerits=\gre@saved@finalhyphendemerits % + \brokenpenalty=\gre@saved@brokenpenalty % + \looseness=\gre@saved@looseness % + \tolerance=\gre@saved@tolerance % + \pretolerance=\gre@saved@pretolerance % + \emergencystretch=\gre@saved@emergencystretch % + \widowpenalty=\gre@saved@widowpenalty % + \clubpenalty=\gre@saved@clubpenalty % \parskip=\gre@saved@parskip% \lineskip=\gre@saved@lineskip% \baselineskip=\gre@saved@baselineskip% From 3c5ff3038c478077e6c3675715f69b5105f2f38a Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 11:59:55 -0500 Subject: [PATCH 02/37] Identify prescore saved registers Identify save registers that are used for prescore values to be restored at the end of the score. --- tex/gregoriotex-spaces.tex | 90 +++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index 37a18e54f..995306f57 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -35,90 +35,90 @@ -\newcount\gre@saved@hyphenpenalty% -\newcount\gre@saved@exhyphenpenalty% -\newcount\gre@saved@doublehyphendemerits% -\newcount\gre@saved@finalhyphendemerits% -\newcount\gre@saved@brokenpenalty% -\newcount\gre@saved@looseness% -\newcount\gre@saved@tolerance% -\newcount\gre@saved@pretolerance% -\newskip\gre@saved@emergencystretch% -\newcount\gre@saved@widowpenalty% -\newcount\gre@saved@clubpenalty% -\newskip\gre@saved@parskip% -\newskip\gre@saved@lineskip% -\newskip\gre@saved@baselineskip% -\newskip\gre@saved@lineskiplimit% +\newcount\gre@saved@prescore@hyphenpenalty% +\newcount\gre@saved@prescore@exhyphenpenalty% +\newcount\gre@saved@prescore@doublehyphendemerits% +\newcount\gre@saved@prescore@finalhyphendemerits% +\newcount\gre@saved@prescore@brokenpenalty% +\newcount\gre@saved@prescore@looseness% +\newcount\gre@saved@prescore@tolerance% +\newcount\gre@saved@prescore@pretolerance% +\newskip\gre@saved@prescore@emergencystretch% +\newcount\gre@saved@prescore@widowpenalty% +\newcount\gre@saved@prescore@clubpenalty% +\newskip\gre@saved@prescore@parskip% +\newskip\gre@saved@prescore@lineskip% +\newskip\gre@saved@prescore@baselineskip% +\newskip\gre@saved@prescore@lineskiplimit% %% The following macros cancel some useless penalties, and reinstates them %% at the end of a score \def\gre@cancelpenalties{% \gre@trace{gre@cancelpenalties}% - \global\gre@saved@hyphenpenalty=\hyphenpenalty\relax % + \global\gre@saved@prescore@hyphenpenalty=\hyphenpenalty\relax % \hyphenpenalty=\gre@space@count@hyphenpenalty % % - \global\gre@saved@exhyphenpenalty=\exhyphenpenalty\relax % + \global\gre@saved@prescore@exhyphenpenalty=\exhyphenpenalty\relax % \exhyphenpenalty=\gre@space@count@hyphenpenalty % % - \global\gre@saved@doublehyphendemerits=\doublehyphendemerits\relax % + \global\gre@saved@prescore@doublehyphendemerits=\doublehyphendemerits\relax % \doublehyphendemerits=0\relax % % - \global\gre@saved@finalhyphendemerits=\finalhyphendemerits\relax % + \global\gre@saved@prescore@finalhyphendemerits=\finalhyphendemerits\relax % \finalhyphendemerits=0\relax % % - \global\gre@saved@brokenpenalty=\brokenpenalty\relax % + \global\gre@saved@prescore@brokenpenalty=\brokenpenalty\relax % \brokenpenalty=\gre@space@count@brokenpenalty % % - \global\gre@saved@looseness=\looseness\relax % + \global\gre@saved@prescore@looseness=\looseness\relax % \looseness=\gre@space@count@looseness % % - \global\gre@saved@tolerance=\tolerance\relax % + \global\gre@saved@prescore@tolerance=\tolerance\relax % \tolerance=\gre@space@count@tolerance % % - \global\gre@saved@pretolerance=\pretolerance\relax % + \global\gre@saved@prescore@pretolerance=\pretolerance\relax % \pretolerance=\gre@space@count@pretolerance % % - \global\gre@saved@emergencystretch=\emergencystretch\relax % + \global\gre@saved@prescore@emergencystretch=\emergencystretch\relax % \emergencystretch=\gre@space@skip@emergencystretch\relax % % - \global\gre@saved@widowpenalty=\widowpenalty\relax % + \global\gre@saved@prescore@widowpenalty=\widowpenalty\relax % \widowpenalty=\gre@space@count@widowpenalty % % - \global\gre@saved@clubpenalty=\clubpenalty\relax % + \global\gre@saved@prescore@clubpenalty=\clubpenalty\relax % \clubpenalty=\gre@space@count@clubpenalty % % - \global\gre@saved@parskip=\parskip% + \global\gre@saved@prescore@parskip=\parskip% \parskip=\gre@space@skip@parskip% % - \global\gre@saved@lineskip=\lineskip% + \global\gre@saved@prescore@lineskip=\lineskip% \lineskip=\gre@space@skip@lineskip% % - \global\gre@saved@baselineskip=\baselineskip% + \global\gre@saved@prescore@baselineskip=\baselineskip% \baselineskip=\gre@space@skip@baselineskip% % - \global\gre@saved@lineskiplimit=\lineskiplimit% + \global\gre@saved@prescore@lineskiplimit=\lineskiplimit% \lineskiplimit=\gre@space@skip@lineskiplimit% \gre@trace@end% }% \def\gre@restorepenalties{% \gre@trace{gre@restorepenalties}% - \hyphenpenalty=\gre@saved@hyphenpenalty % - \exhyphenpenalty=\gre@saved@exhyphenpenalty % - \doublehyphendemerits=\gre@saved@doublehyphendemerits % - \finalhyphendemerits=\gre@saved@finalhyphendemerits % - \brokenpenalty=\gre@saved@brokenpenalty % - \looseness=\gre@saved@looseness % - \tolerance=\gre@saved@tolerance % - \pretolerance=\gre@saved@pretolerance % - \emergencystretch=\gre@saved@emergencystretch % - \widowpenalty=\gre@saved@widowpenalty % - \clubpenalty=\gre@saved@clubpenalty % - \parskip=\gre@saved@parskip% - \lineskip=\gre@saved@lineskip% - \baselineskip=\gre@saved@baselineskip% - \lineskiplimit=\gre@saved@lineskiplimit% + \hyphenpenalty=\gre@saved@prescore@hyphenpenalty % + \exhyphenpenalty=\gre@saved@prescore@exhyphenpenalty % + \doublehyphendemerits=\gre@saved@prescore@doublehyphendemerits % + \finalhyphendemerits=\gre@saved@prescore@finalhyphendemerits % + \brokenpenalty=\gre@saved@prescore@brokenpenalty % + \looseness=\gre@saved@prescore@looseness % + \tolerance=\gre@saved@prescore@tolerance % + \pretolerance=\gre@saved@prescore@pretolerance % + \emergencystretch=\gre@saved@prescore@emergencystretch % + \widowpenalty=\gre@saved@prescore@widowpenalty % + \clubpenalty=\gre@saved@prescore@clubpenalty % + \parskip=\gre@saved@prescore@parskip% + \lineskip=\gre@saved@prescore@lineskip% + \baselineskip=\gre@saved@prescore@baselineskip% + \lineskiplimit=\gre@saved@prescore@lineskiplimit% \gre@trace@end% }% From 3eec44016db06fdac9697922f17acfd091410cd9 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 14:44:39 -0500 Subject: [PATCH 03/37] Another prescore register `\exhyphenchar` is another register whose value is saved before a score and restored afterwards. It makes sense, therefore, to have both operations handled by the same macros which handle it for everything else. --- tex/gregoriotex-main.tex | 3 --- tex/gregoriotex-spaces.tex | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index 48ce60d9e..4d1698596 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -1232,8 +1232,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}% @@ -1284,7 +1282,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% diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index 995306f57..1b3baad00 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -37,6 +37,7 @@ \newcount\gre@saved@prescore@hyphenpenalty% \newcount\gre@saved@prescore@exhyphenpenalty% +\newcount\gre@saved@prescore@exhyphenchar% \newcount\gre@saved@prescore@doublehyphendemerits% \newcount\gre@saved@prescore@finalhyphendemerits% \newcount\gre@saved@prescore@brokenpenalty% @@ -61,6 +62,9 @@ \global\gre@saved@prescore@exhyphenpenalty=\exhyphenpenalty\relax % \exhyphenpenalty=\gre@space@count@hyphenpenalty % % + \global\gre@saved@prescore@exhyphenchar=\exhyphenchar\relax % + \exhyphenchar=-1\relax% + % \global\gre@saved@prescore@doublehyphendemerits=\doublehyphendemerits\relax % \doublehyphendemerits=0\relax % % @@ -106,6 +110,7 @@ \gre@trace{gre@restorepenalties}% \hyphenpenalty=\gre@saved@prescore@hyphenpenalty % \exhyphenpenalty=\gre@saved@prescore@exhyphenpenalty % + \exhyphenchar=\gre@saved@prescore@exhyphenchar % \doublehyphendemerits=\gre@saved@prescore@doublehyphendemerits % \finalhyphendemerits=\gre@saved@prescore@finalhyphendemerits % \brokenpenalty=\gre@saved@prescore@brokenpenalty % From 2b9448beeeb7ecbdea01e0b637a08e437dccaefe Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 14:48:08 -0500 Subject: [PATCH 04/37] NLBA save registers Identify the registers used to save values before a No Line Break Area. --- tex/gregoriotex-main.tex | 49 ++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index 4d1698596..0e77a67ee 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -1612,13 +1612,13 @@ % 2: no line break area due to 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{% @@ -1635,20 +1635,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 % }% @@ -1669,13 +1674,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 From 5d38a1f6d42428a6eaa2c1dc04cbf2b6f4f35628 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 14:52:52 -0500 Subject: [PATCH 05/37] Prenotes save registers Identify the registers used to save stuff before notes are printed. --- tex/gregoriotex-syllable.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tex/gregoriotex-syllable.tex b/tex/gregoriotex-syllable.tex index b00f90ae4..acb2e68e7 100644 --- a/tex/gregoriotex-syllable.tex +++ b/tex/gregoriotex-syllable.tex @@ -397,8 +397,8 @@ \global\gre@count@lastglyphiscavum=0\relax % \global\gre@firstglyphtrue% \global\gre@boxingtrue% - \let\ifgre@lastendswithmorasave\ifgre@lastendswithmora% - \xdef\gre@savedlastoflinecount{\number\gre@lastoflinecount\relax }% + \let\ifgre@saved@prenotes@lastendswithmora\ifgre@lastendswithmora% + \xdef\gre@saved@prenotes@lastoflinecount{\number\gre@lastoflinecount\relax }% \ifgre@shownotes% \setbox\gre@box@syllablenotes=\hbox{#1}% \else% @@ -406,7 +406,6 @@ \fi% \gre@debugmsg{spacing}{Width of notes: \the\wd\gre@box@syllablenotes}% \global\gre@boxingfalse% - \global\gre@lastoflinecount=\gre@savedlastoflinecount\relax % \global\gre@firstglyphtrue% % now gre@lastendswithmora is true if this syllable ends with a % punctum mora, but we still want to keep gre@lastendswithmora if we @@ -419,7 +418,8 @@ \else % \gre@thisendswithmorafalse % \fi % - \let\ifgre@lastendswithmora\ifgre@lastendswithmorasave % + \let\ifgre@lastendswithmora\ifgre@saved@prenotes@lastendswithmora% + \global\gre@lastoflinecount=\gre@saved@prenotes@lastoflinecount\relax % \global\gre@count@lastglyphiscavum=0\relax % \global\gre@skip@bar@lastskip=0pt\relax % \global\gre@endofscorefalse % From 24874a8a04496941ee813b8182178c3747dc257b Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 15:01:20 -0500 Subject: [PATCH 06/37] Syllable printing saves Identify the save registers that get used during the syllable rewriting process. --- tex/gregoriotex-syllable.tex | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tex/gregoriotex-syllable.tex b/tex/gregoriotex-syllable.tex index acb2e68e7..6b7a23ab3 100644 --- a/tex/gregoriotex-syllable.tex +++ b/tex/gregoriotex-syllable.tex @@ -773,18 +773,18 @@ \gre@trace@end% }% -\let\gre@save@endsyllablepart\gre@nothing\relax % -\let\gre@save@fixedtextformat\gre@textnormal\relax % -\let\gre@save@pointandclick\gre@nothing\relax % +\let\gre@saved@syllable@endsyllablepart\gre@nothing\relax % +\let\gre@saved@syllable@fixedtextformat\gre@textnormal\relax % +\let\gre@saved@syllable@pointandclick\gre@nothing\relax % \def\gre@push@endsyllable#1{% \gre@trace{gre@push@endsyllable{#1}}% - \let\gre@save@endsyllablepart\gre@nothing\relax % - \let\gre@save@fixedtextformat\gre@textnormal\relax % - \let\gre@save@pointandclick\gre@nothing\relax % + \let\gre@saved@syllable@endsyllablepart\gre@nothing\relax % + \let\gre@saved@syllable@fixedtextformat\gre@textnormal\relax % + \let\gre@saved@syllable@pointandclick\gre@nothing\relax % \gre@if@rewritesyllable{% - \let\gre@save@endsyllablepart\gre@endsyllablepart\relax % - \let\gre@save@fixedtextformat\gre@fixedtextformat\relax % - \xdef\gre@save@pointandclick{#1}% + \let\gre@saved@syllable@endsyllablepart\gre@endsyllablepart\relax % + \let\gre@saved@syllable@fixedtextformat\gre@fixedtextformat\relax % + \xdef\gre@saved@syllable@pointandclick{#1}% }{}% \relax % \gre@trace@end% @@ -792,15 +792,15 @@ \def\gre@emit@syllabletext#1{% \gre@trace{gre@emit@syllabletext{#1}}% - \ifx\gre@save@endsyllablepart\gre@nothing % + \ifx\gre@saved@syllable@endsyllablepart\gre@nothing % \gre@fixedtextformat{#1}% \else % - \ifx\gre@save@fixedtextformat\gre@fixedtextformat % + \ifx\gre@saved@syllable@fixedtextformat\gre@fixedtextformat % \gre@debugmsg{syllablerewriting}{merging format when prepending previous last syllable part}% - \gre@fixedtextformat{\gre@pointandclick{\gre@save@endsyllablepart}{\gre@save@pointandclick}#1}% + \gre@fixedtextformat{\gre@pointandclick{\gre@saved@syllable@endsyllablepart}{\gre@saved@syllable@pointandclick}#1}% \else % \gre@debugmsg{syllablerewriting}{prepending previous last syllable part}% - \gre@save@fixedtextformat{\gre@pointandclick{\gre@save@endsyllablepart}{\gre@save@pointandclick}}% + \gre@saved@syllable@fixedtextformat{\gre@pointandclick{\gre@saved@syllable@endsyllablepart}{\gre@saved@syllable@pointandclick}}% \gre@fixedtextformat{#1}% \fi % \fi % @@ -878,7 +878,7 @@ #1% \gre@firstglyphtrue% \gre@dimen@bolextra = 0pt\relax% - \gre@calculate@textaligncenter{\gre@save@endsyllablepart}{\gre@firstsyllablepart}{\gre@middlesyllablepart}{0}% we first get the width between the alignment point and the end of the syllable + \gre@calculate@textaligncenter{\gre@saved@syllable@endsyllablepart}{\gre@firstsyllablepart}{\gre@middlesyllablepart}{0}% we first get the width between the alignment point and the end of the syllable \gre@syllablenotes{#9}% we put the notes in a box, so that we have the width of it % now we calculate the begin difference, that is to say \gre@dimen@notesaligncenter - \gre@dimen@textaligncenter \gre@dimen@begindifference=\dimexpr(\gre@dimen@notesaligncenter - \gre@dimen@textaligncenter)\relax % @@ -1255,7 +1255,7 @@ % there are two different cases that have almost nothing in common : the case where there is something written under the bar, and the case where there is nothing. % first of all we need to calculate previousenddifference, begindifference, enddifference and nextbegindifference. #1% - \gre@calculate@textaligncenter{\gre@save@endsyllablepart}{\gre@firstsyllablepart}{\gre@middlesyllablepart}{0}% + \gre@calculate@textaligncenter{\gre@saved@syllable@endsyllablepart}{\gre@firstsyllablepart}{\gre@middlesyllablepart}{0}% \ifgre@showlyrics% \setbox\gre@box@syllabletext=\hbox{% \IfSubStr{\gre@debug}{,barspacing,}% From 141f1a47cc6e3ab7391d5d9705955e57ea975801 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 15:01:55 -0500 Subject: [PATCH 07/37] Line delay saves Identify the save register that is used when the newline is delayed. --- tex/gregoriotex-syllable.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tex/gregoriotex-syllable.tex b/tex/gregoriotex-syllable.tex index 6b7a23ab3..e162ff2c4 100644 --- a/tex/gregoriotex-syllable.tex +++ b/tex/gregoriotex-syllable.tex @@ -1272,7 +1272,7 @@ \setbox\gre@box@syllabletext=\box\voidb@x% \fi% \gre@debugmsg{barspacing}{Width of bar text: \the\wd\gre@box@syllabletext}% - \global\let\gre@newlinecommonsaved\gre@newlinecommon % + \global\let\gre@saved@prelinedelay@newlinecommon\gre@newlinecommon % \global\let\gre@newlinecommon\gre@newlinecommondelayed % \xdef\gre@newlinearg{-1}% \gre@syllablenotes{#9}% @@ -1335,7 +1335,7 @@ {\raise 12pt\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}% {}% do nothing if not debugging \fi% - \global\let\gre@newlinecommon\gre@newlinecommonsaved % + \global\let\gre@newlinecommon\gre@saved@prelinedelay@newlinecommon % \GreNoBreak% % get into position to place the penalty \ifdim\gre@dimen@enddifference < 0pt\relax% @@ -1418,7 +1418,7 @@ \gre@clearsyllable{bar}% \fi% % then we check if there is something to write - \global\let\gre@newlinecommon\gre@newlinecommonsaved % + \global\let\gre@newlinecommon\gre@saved@prelinedelay@newlinecommon % \gre@debugmsg{ifdim}{ wd(gre@box@syllabletext) = 0pt}% \ifdim\wd\gre@box@syllabletext = 0 pt\relax % % the most difficult case : when there is nothing to write From 6d93c3b090c4a67219b6d3b66ff96e2bfd1ab30a Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 15:05:06 -0500 Subject: [PATCH 08/37] Clarify name Add a `@` into the function name to make it easier to read. --- tex/gregoriotex-signs.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tex/gregoriotex-signs.tex b/tex/gregoriotex-signs.tex index 64898d250..7c196c9f3 100644 --- a/tex/gregoriotex-signs.tex +++ b/tex/gregoriotex-signs.tex @@ -238,8 +238,8 @@ \gre@trace@end% } -\def\gre@saveclefextrema#1#2{% - \gre@trace{gre@saveclefextrema{#1}{#2}}% +\def\gre@save@clefextrema#1#2{% + \gre@trace{gre@save@clefextrema{#1}{#2}}% % compute the clef extrema \ifcase#1\or % first@1 \global\let\gre@pitch@cleftop\gre@pitch@e % @@ -308,7 +308,7 @@ \def\GreInitialClefPosition#1#2{% \gre@trace{GreInitialClefPosition{#1}{#2}}% \ifgre@showclef % - \gre@saveclefextrema{#1}{#2}% + \gre@save@clefextrema{#1}{#2}% \fi % \gre@trace@end% }% @@ -325,7 +325,7 @@ %% #8: if 3, it means that we must not put a flat after the secondary clef, otherwise it's the height of the flat \def\gre@typeclef#1#2#3#4#5#6#7#8{% \gre@trace{gre@typeclef{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}% - \gre@saveclefextrema{#2}{#7}% + \gre@save@clefextrema{#2}{#7}% \gre@boxclef{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% \ifcase#3% \gre@update@clefwidth@current{\wd\gre@box@temp@width}% From 7866a11d761fdd5c2f400a31603f1e47861c8946 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 16:08:31 -0500 Subject: [PATCH 09/37] Updates to doc_check.sh Assume use of GNU sed at all times. --- doc_check.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc_check.sh b/doc_check.sh index f304efcb4..d165d29fa 100755 --- a/doc_check.sh +++ b/doc_check.sh @@ -12,6 +12,7 @@ # The script is not perfect, and especially has trouble with classes of macros # which have only one entry in the documentation. +#set -x #echo on HERE=`pwd` @@ -36,16 +37,16 @@ sed -i.temp 's:.*OBSOLETE.*::' $CODEFILE sed -i.temp 's:.*DEPRECATED.*::' $CODEFILE #remove trailing comments -gsed -i.temp 's/%.*$//' $CODEFILE +sed -i.temp 's/%.*$//' $CODEFILE #remove whitespace -gsed -i.temp 's/^[ \t]*//;s/[ \t]*$//' $CODEFILE +sed -i.temp 's/^[ \t]*//;s/[ \t]*$//' $CODEFILE #remove new and trailing code sed -i.temp 's:.*\\new[a-z]*{*\(\\*[a-zA-Z@]*\)[\\}]*.*:\1:' $CODEFILE #get rid of work around def -sed -i.temp -E 's:\\def\\x{::' $CODEFILE +sed -i.temp '/\\def\\x/d' $CODEFILE #accept only first def on line sed -i.temp -E 's:\\[gex]?def:special:' $CODEFILE @@ -87,6 +88,7 @@ sed -i.temp 's:.*count@temp@.*::' $CODEFILE #registers for saved values sed -i.temp 's:\\gre@saved@.*::' $CODEFILE +sed -i.temp '/\\ifgre@saved@.*/d' $CODEFILE #macros used to process options sed -i.temp 's:\\gre@autocompile::' $CODEFILE @@ -120,7 +122,7 @@ sed -i.temp 's:\\macroname{\([^}]*\)}.*:\1:' $DOCFILE sed -i.temp 's:\\textbackslash :\\:' $DOCFILE #styles -sed -i.temp 's:.*\stylename{\([a-z]*\)}.*:\1:' $DOCFILE +sed -i.temp 's:.*stylename{\([a-z]*\)}.*:\1:' $DOCFILE #distances sed -i.temp 's:\\begin{gdimension}{\([a-z@]*\)}.*:\1:' $DOCFILE @@ -146,7 +148,7 @@ grep -h '\\gre@deprecated.*' *.tex | grep -v '\\def\\' >> $DOCFILE grep -h '\\gre@obsolete.*' *.tex | grep -v '\\def\\' >> $DOCFILE #remove whitespace -gsed -i.temp 's/^[ \t]*//;s/[ \t]*$//' $DOCFILE +sed -i.temp 's/^[ \t]*//;s/[ \t]*$//' $DOCFILE sed -i.temp 's:.*\\gre@deprecated{.*::' $DOCFILE sed -i.temp 's:.*\\gre@obsolete{.*::' $DOCFILE From adf1bb3ef3d68cfe9065dbb9cc4f21000e66b00d Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 16:09:26 -0500 Subject: [PATCH 10/37] Fix typos --- doc/Command_Index_User.tex | 2 +- doc/Command_Index_gregorio.tex | 2 +- tex/gregoriotex-main.tex | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Command_Index_User.tex b/doc/Command_Index_User.tex index dd00ca685..bee9e6785 100644 --- a/doc/Command_Index_User.tex +++ b/doc/Command_Index_User.tex @@ -150,7 +150,7 @@ \subsubsection{Including scores} compile the gabc file into a gtex file. This is similar to \texttt{[a]} except the gabc is compiled every time. -\macroname{\textbackslash gregetgregpath}{\{\#1\}}{gregoriotex-main.tex} +\macroname{\textbackslash gresetgregpath}{\{\#1\}}{gregoriotex-main.tex} Set a list of additional directories which should be searched for scores. Directories may be absolute or relative, but must end with a slash (\verb=/=) and enclosed in braces (\verb={}=), even if there is only one additional directory. For example, to look in a directory called “Scores” which is alongside the main project directory, one could use the following: \begin{latexcode} diff --git a/doc/Command_Index_gregorio.tex b/doc/Command_Index_gregorio.tex index da84d9207..efc096141 100644 --- a/doc/Command_Index_gregorio.tex +++ b/doc/Command_Index_gregorio.tex @@ -302,7 +302,7 @@ \section{Gregorio Controls} & \texttt{1} & The notes around the bar are far, \verb=@short= versions of spaces will be used.\\ \end{argtable} -\macroname{\textbackslash GreDivisioMinimaHigh}{\#1\#2\#3}{gregoriotex-signs.tex} +\macroname{\textbackslash GreDivisioMinimisHigh}{\#1\#2\#3}{gregoriotex-signs.tex} Macro to typeset a divisio ``minimis'' (eighth bar) on the ledger line above the staff. \begin{argtable} diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index 0e77a67ee..014d24a9d 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -1870,12 +1870,12 @@ %%%%%%%%%%%%%%%%%%% -\def\gre@maketabl#1{\ifx\relax#1\else,"#1"\expandafter\gre@maketabl\fi} +\def\gre@maketable#1{\ifx\relax#1\else,"#1"\expandafter\gre@maketabl\fi} \def\gresetgregpath#1{% \def\gre@input@path{#1}% \directlua{ - gre_input_path = {""\expandafter\gre@maketabl\gre@input@path\relax} + gre_input_path = {""\expandafter\gre@maketable\gre@input@path\relax} } } From 5fb128783ed2e462fc49d46d3068d14c0d9ed4a4 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 16:10:01 -0500 Subject: [PATCH 11/37] Add missing documention for InDivisio versions for Mimimis bar --- doc/Command_Index_gregorio.tex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/Command_Index_gregorio.tex b/doc/Command_Index_gregorio.tex index efc096141..2b3a15259 100644 --- a/doc/Command_Index_gregorio.tex +++ b/doc/Command_Index_gregorio.tex @@ -642,6 +642,12 @@ \section{Gregorio Controls} \macroname{\textbackslash GreInDivisioMinimaHigh}{\#1\#2\#3}{gregoriotex-signs.tex} Same as \verb=\GreDivisioMinimaHigh= except inside a syllable. +\macroname{\textbackslash GreInDivisioMinimis}{\#1\#2\#3}{gregoriotex-signs.tex} +Same as \verb=\GreDivisioMinimis= except inside a syllable. + +\macroname{\textbackslash GreInDivisioMinimisHigh}{\#1\#2\#3}{gregoriotex-signs.tex} +Same as \verb=\GreDivisioMinimisHigh= except inside a syllable. + \macroname{\textbackslash GreInDivisioMinor}{\#1\#2}{gregoriotex-signs.tex} Same as \verb=\GreDivisioMinor= except inside a syllable. From 9ad41cb9f53f4d3ba7718ce5045d10a435c893d0 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 16:19:59 -0500 Subject: [PATCH 12/37] Rename macro for clarity. Other macros which save some value have the "save" keyword surrounded by `@` --- doc/Command_Index_internal.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Command_Index_internal.tex b/doc/Command_Index_internal.tex index c9cb52408..2bfb72a85 100644 --- a/doc/Command_Index_internal.tex +++ b/doc/Command_Index_internal.tex @@ -1218,7 +1218,7 @@ \section{Gregorio\TeX{} Controls} \macroname{\textbackslash gre@pitch@clefbottom}{}{gregoriotex-spaces.tex} The pitch of the lowest point of the current clef. -\macroname{\textbackslash gre@saveclefextrema}{\#1\#2}{gregoriotex-signs.tex} +\macroname{\textbackslash gre@save@clefextrema}{\#1\#2}{gregoriotex-signs.tex} Computes the pitches of the lowest and highest points of a clef and saves them into \verb=\gre@pitch@cleftop= and \verb=\gre@pitch@clefbottom=. From 3d403846058314546a506d989e29d462ce4f242c Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 16:20:50 -0500 Subject: [PATCH 13/37] Discretionary registers Identify the registers associated with saving values before a discretionary. --- tex/gregoriotex-spaces.tex | 53 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index 1b3baad00..449d1e973 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -916,16 +916,6 @@ % the one taken into account for above lines nabc height \newdimen\gre@dimen@additionaltopspacenabc\relax% -% backup demensions for the previous -\newdimen\gre@saved@dimen@additionalbottomspace\relax% -\newdimen\gre@saved@dimen@additionaltopspace\relax% -\newdimen\gre@saved@dimen@additionaltopspacealt\relax% -\newdimen\gre@saved@dimen@additionaltopspacenabc\relax% -\newdimen\gre@saved@dimen@currenttranslationheight\relax% -\newdimen\gre@saved@dimen@textlower\relax% -\newdimen\gre@saved@dimen@currentabovelinestextheight\relax% -\newdimen\gre@saved@dimen@constantglyphraise\relax% - \newcount\gre@space@count@additionaltopspacethreshold\relax% \gre@space@count@additionaltopspacethreshold=2 @@ -957,29 +947,40 @@ \gre@trace@end% }% +% some backup demensions for use around discretionaries +\newdimen\gre@saved@prediscretionary@dimen@additionalbottomspace\relax% +\newdimen\gre@saved@prediscretionary@dimen@additionaltopspace\relax% +\newdimen\gre@saved@prediscretionary@dimen@additionaltopspacealt\relax% +\newdimen\gre@saved@prediscretionary@dimen@additionaltopspacenabc\relax% +\newdimen\gre@saved@prediscretionary@dimen@currenttranslationheight\relax% +\newdimen\gre@saved@prediscretionary@dimen@textlower\relax% +\newdimen\gre@saved@prediscretionary@dimen@currentabovelinestextheight\relax% +\newdimen\gre@saved@prediscretionary@dimen@constantglyphraise\relax% + + \def\gre@save@additionalspaces{% \gre@trace{gre@save@additionalspaces}% - \global\gre@saved@dimen@additionalbottomspace=\gre@dimen@additionalbottomspace\relax% - \global\gre@saved@dimen@additionaltopspace=\gre@dimen@additionaltopspace\relax% - \global\gre@saved@dimen@additionaltopspacealt=\gre@dimen@additionaltopspacealt\relax% - \global\gre@saved@dimen@additionaltopspacenabc=\gre@dimen@additionaltopspacenabc\relax% - \global\gre@saved@dimen@currenttranslationheight=\gre@dimen@currenttranslationheight\relax% - \global\gre@saved@dimen@textlower=\gre@dimen@textlower\relax% - \global\gre@saved@dimen@currentabovelinestextheight=\gre@dimen@currentabovelinestextheight\relax% - \global\gre@saved@dimen@constantglyphraise=\gre@dimen@constantglyphraise\relax% + \global\gre@saved@prediscretionary@dimen@additionalbottomspace=\gre@dimen@additionalbottomspace\relax% + \global\gre@saved@prediscretionary@dimen@additionaltopspace=\gre@dimen@additionaltopspace\relax% + \global\gre@saved@prediscretionary@dimen@additionaltopspacealt=\gre@dimen@additionaltopspacealt\relax% + \global\gre@saved@prediscretionary@dimen@additionaltopspacenabc=\gre@dimen@additionaltopspacenabc\relax% + \global\gre@saved@prediscretionary@dimen@currenttranslationheight=\gre@dimen@currenttranslationheight\relax% + \global\gre@saved@prediscretionary@dimen@textlower=\gre@dimen@textlower\relax% + \global\gre@saved@prediscretionary@dimen@currentabovelinestextheight=\gre@dimen@currentabovelinestextheight\relax% + \global\gre@saved@prediscretionary@dimen@constantglyphraise=\gre@dimen@constantglyphraise\relax% \gre@trace@end% }% \def\gre@restore@additionalspaces{% \gre@trace{gre@restore@additionalspaces}% - \global\gre@dimen@additionalbottomspace=\gre@saved@dimen@additionalbottomspace\relax% - \global\gre@dimen@additionaltopspace=\gre@saved@dimen@additionaltopspace\relax% - \global\gre@dimen@additionaltopspacealt=\gre@saved@dimen@additionaltopspacealt\relax% - \global\gre@dimen@additionaltopspacenabc=\gre@saved@dimen@additionaltopspacenabc\relax% - \global\gre@dimen@currenttranslationheight=\gre@saved@dimen@currenttranslationheight\relax% - \global\gre@dimen@textlower=\gre@saved@dimen@textlower\relax% - \global\gre@dimen@currentabovelinestextheight=\gre@saved@dimen@currentabovelinestextheight\relax% - \global\gre@dimen@constantglyphraise=\gre@saved@dimen@constantglyphraise\relax% + \global\gre@dimen@additionalbottomspace=\gre@saved@prediscretionary@dimen@additionalbottomspace\relax% + \global\gre@dimen@additionaltopspace=\gre@saved@prediscretionary@dimen@additionaltopspace\relax% + \global\gre@dimen@additionaltopspacealt=\gre@saved@prediscretionary@dimen@additionaltopspacealt\relax% + \global\gre@dimen@additionaltopspacenabc=\gre@saved@prediscretionary@dimen@additionaltopspacenabc\relax% + \global\gre@dimen@currenttranslationheight=\gre@saved@prediscretionary@dimen@currenttranslationheight\relax% + \global\gre@dimen@textlower=\gre@saved@prediscretionary@dimen@textlower\relax% + \global\gre@dimen@currentabovelinestextheight=\gre@saved@prediscretionary@dimen@currentabovelinestextheight\relax% + \global\gre@dimen@constantglyphraise=\gre@saved@prediscretionary@dimen@constantglyphraise\relax% \gre@trace@end% }% From da209271b9b00cf90ef64021233908ea7fc447c9 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 16:24:03 -0500 Subject: [PATCH 14/37] Fix documentation for saved registers --- doc/Command_Index_internal.tex | 83 +--------------------------------- 1 file changed, 2 insertions(+), 81 deletions(-) diff --git a/doc/Command_Index_internal.tex b/doc/Command_Index_internal.tex index 2bfb72a85..233bcf583 100644 --- a/doc/Command_Index_internal.tex +++ b/doc/Command_Index_internal.tex @@ -25,6 +25,8 @@ \section{Gregorio\TeX{} Controls} document and are listed here for programmer documentation purposes only. +Sometimes it is necessary to temporarily change some register or macro for the purpose of some particular operation and then restore it to its previous value. In those case we define a \verb=\gre@saved@...= register or macro associated with it (\eg \verb=\gre@dimen@constantglyphraise= is saved just before a discretionary to \verb=\gre@saved@prediscretionary@dimen@constantglyphraise= and restored from it afterwards). These registers/macros are not listed in this documentation. + \macroname{\textbackslash gre@error}{\#1}{gregoriotex.sty \textup{and} gregoriotex.tex} Prints an error to the \TeX\ output log. @@ -565,9 +567,6 @@ \section{Gregorio\TeX{} Controls} \macroname{\textbackslash gre@lastoflinecount}{}{gregoriotex-main.tex} Count to track where on the line we are. Values are \texttt{0} (we are not near the end of a line), \texttt{1} (we’re at the last syllable of the line), and \texttt{2} (we just set the last syllable of the line and so are at the first syllable of a new line). -\macroname{\textbackslash gre@savedlastoflinecount}{}{gregoriotex-main.tex} -A spot to save the \verb=\gre@lastoflinecount= so we can change it temporarily and revert to the saved value later. - \macroname{\textbackslash gre@newlinecommon}{\#1\#2}{gregoriotex-main.tex} The macro which needs to be called each time a new lines is started. @@ -616,9 +615,6 @@ \section{Gregorio\TeX{} Controls} \macroname{\textbackslash gre@opening@syllabletext}{}{gregoriotex-syllable.tex} Macro that stores the computed \TeX\ code for rendering the text of the first syllable. -\macroname{\textbackslash gre@exhyphencharsave}{}{gregoriotex-main.tex} -Macro for saving the ex hyphen character so that it can be restored at the end of the score. - \macroname{\textbackslash gre@factor}{}{gregoriotex-main.tex} Count which stores the current staff size. @@ -1101,19 +1097,6 @@ \section{Gregorio\TeX{} Controls} \#2 & \TeX\ code & Code to perform when \emph{not} rewriting the syllable\\ \end{argtable} -\macroname{\textbackslash gre@save@endsyllablepart}{}{gregoriotex-syllable.tex} -Control sequence aliased to the carry-over syllable part to be moved to the next syllable. - -\macroname{\textbackslash gre@save@fixedtextformat}{\#1}{gregoriotex-syllable.tex} -Control sequence aliased to the fixed text format for the carry-over syllable part to be moved to the next syllable. - -\begin{argtable} - \#1 & string & The carry-over syllable part, as with \verb=\gre@fixednexttextformat=\\ -\end{argtable} - -\macroname{\textbackslash gre@save@pointandclick}{}{gregoriotex-syllable.tex} -Control sequence aliased to the line:char:column of the point-and-click link for the carry-over syllable part to be moved to the next syllable\\ - \macroname{\textbackslash gre@push@endsyllable}{\#1}{gregoriotex-syllable.tex} Sets the save aliases to push the end-syllable part of the current syllable to the next syllable if necessary. @@ -1393,9 +1376,6 @@ \section{Gregorio\TeX{} Controls} \macroname{\textbackslash gre@newlinecommondelayed}{}{gregoriotex-syllable.tex} Macro used in place of \verb=\gre@newlinecommon= when the line break must be delayed. -\macroname{\textbackslash gre@newlinecommonsaved}{}{gregoriotex-syllable.tex} -Macro for storing original behavior of \verb=\gre@newlinecommon= so that it can be restored after the delayed line break takes effect. - \macroname{\textbackslash gre@punctum@mora}{\#1\#2\#3\#4}{gregoriotex-signs.tex} Macro to typeset a punctum mora. @@ -1904,9 +1884,6 @@ \subsection{Flags} \macroname{\textbackslash ifgre@disablevepisema}{}{gregoriotex-signs.tex} Boolean to disable the printing of vertical episemata. -\macroname{\textbackslash ifgre@lastendswithmorasave}{}{gregoriotex-syllable.tex} -Boolean for saving \verb=\ifgre@lastendswithmora= for later restoration. - \macroname{\textbackslash gre@lasteuouaeindex}{}{gregoriotex-main.tex} Count which keeps track of the most recent euouae area. @@ -2025,10 +2002,6 @@ \subsection{Distances} These additional distances are calculated by Gregorio based on the values for the user customizable distances and what may be going on in the score at the time of their use. -In some cases it is necessary to temporarily manipulate some of these distances for the purpose of some particular operation and then restore them to their previous values. In that case the distance will have a \verb=\gre@saved@...= register associated with it (\eg \verb=\gre@dimen@constantglyphraise= is saved to and restored from \verb=\gre@saved@dimen@constantglyphraise=). - -We also have save registries for \verb=\baselineskip=, \verb=\lineskip=, \verb=\lineskiplimit=, \verb=\parskip=, and \verb=\parfillskip= so that we can modify the way line breaking decisions are handled inside a score without affecting the rest of the document. - \macroname{\textbackslash gre@dimen@morawidth}{}{gregoriotex-spaces.tex} Width of a punctum mora (reinitialized at each score, lazily recomputed). @@ -2237,58 +2210,6 @@ \subsection{Penalties} \macroname{\textbackslash gre@restorepenalties}{}{gregoriotex-spaces.tex} Macro called at the end of the score to restore the text penalties. -\macroname{\textbackslash gre@brokenpenaltysave}{}{gregoriotex-spaces.tex} -A place to save the current value of the broken penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@clubpenaltysave}{}{gregoriotex-spaces.tex} -A place to save the current value of the club penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@widowpenaltysave}{}{gregoriotex-spaces.tex} -A place to save the current value of the widow penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@emergencystretchsave}{}{gregoriotex-spaces.tex} -A place to save the current value of the emergency stretch so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@endafterbarpenaltysave}{}{gregoriotex-main.tex} -A place to save the current value of the end after bar penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@endafterbaraltpenaltysave}{}{gregoriotex-main.tex} -A place to save the current value of the alternate end after bar penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@endofelementpenaltysave}{}{gregoriotex-main.tex} -A place to save the current value of the end of element penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@endofsyllablepenaltysave}{}{gregoriotex-main.tex} -A place to save the current value of the end of syllable penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@endofwordpenaltysave}{}{gregoriotex-main.tex} -A place to save the current value of the end of word penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@exhyphenpenaltysave}{}{gregoriotex-spaces.tex} -A place to save the current value of the ex hyphen penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@hyphenpenaltysave}{}{gregoriotex-main.tex \textup{and} gregoriotex-spaces.tex} -A place to save the current value of the hyphen penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@nobreakpenaltysave}{}{gregoriotex-main.tex} -A place to save the current value of the no break penalty so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@doublehyphendemeritssave}{}{gregoriotex-spaces.tex} -A place to save the current value of the double hyphen demerits so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@finalhyphendemeritssave}{}{gregoriotex-spaces.tex} -A place to save the current value of the final hyphen demerits so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@loosenesssave}{}{gregoriotex-spaces.tex} -A place to save the current value of the looseness so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@tolerancesave}{}{gregoriotex-spaces.tex} -A place to save the current value of the tolerance so that we can change it temporarily and then restore it later. - -\macroname{\textbackslash gre@pretolerancesave}{}{gregoriotex-spaces.tex} -A place to save the current value of the pretolerance so that we can change it temporarily and then restore it later. - - \subsection{Backwards compatibility} Depending on version of Lua\TeX / \LaTeX, some primitives have different names We define the following local aliases to account for this eventuality. From e867df29e80996117291ec70f98348fd58e7f88f Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Mon, 1 Feb 2021 15:16:23 -0500 Subject: [PATCH 15/37] Missed discretionary register --- tex/gregoriotex-spaces.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index 449d1e973..b1a477970 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -1047,7 +1047,7 @@ \def\gre@calculate@textaligncenter#1#2#3#4{% \gre@trace{gre@calculate@textaligncenter{#1}{#2}{#3}{#4}}% \ifnum#4=0\relax% - \gre@widthof{\gre@save@fixedtextformat{#1}\gre@fixedtextformat{#2#3}}% + \gre@widthof{\gre@saved@syllable@fixedtextformat{#1}\gre@fixedtextformat{#2#3}}% \else % \gre@widthof{\gre@fixedtextformat{#1}\gre@fixednexttextformat{#2#3}}% \fi % From 0e7979aaa5179f4b50665f5afe4af4f50d3d4e63 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Mon, 1 Feb 2021 15:17:29 -0500 Subject: [PATCH 16/37] Another typo Missed this in adf1bb3ef3d68cfe9065dbb9cc4f21000e66b00d --- tex/gregoriotex-main.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index 014d24a9d..050d321d7 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -1870,7 +1870,7 @@ %%%%%%%%%%%%%%%%%%% -\def\gre@maketable#1{\ifx\relax#1\else,"#1"\expandafter\gre@maketabl\fi} +\def\gre@maketable#1{\ifx\relax#1\else,"#1"\expandafter\gre@maketable\fi} \def\gresetgregpath#1{% \def\gre@input@path{#1}% From 6843ef68a4d7afb5c340de4ab4cf751e9af2cbf6 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Tue, 2 Feb 2021 14:38:51 -0500 Subject: [PATCH 17/37] Debugging snippets Allow the snippet files to persist after compilation to help with debugging. **Note:** Since we reuse the same snippet filename for all snippets, only the last snippet will be preserved if a document contains more than one. --- tex/gregoriotex.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tex/gregoriotex.lua b/tex/gregoriotex.lua index 6350b1ae2..5f029a0fb 100644 --- a/tex/gregoriotex.lua +++ b/tex/gregoriotex.lua @@ -995,8 +995,10 @@ local function direct_gabc(gabc, header, allow_deprecated) end glog:close() end - os.remove(snippet_filename) - os.remove(snippet_logname) + if not (debug_types_activated['snippet'] or debug_types_activated['all']) then + os.remove(snippet_filename) + os.remove(snippet_logname) + end end local function get_gregoriotexluaversion() From 6f59c54f1b24901a7c69bfacedb97068e2b3cf73 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Tue, 2 Feb 2021 14:39:55 -0500 Subject: [PATCH 18/37] Overly specific match We need to get rid of the `\par` commands in the snippet, but the extra spaces aren't really all that important and can safely stay. --- tex/gregoriotex.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tex/gregoriotex.lua b/tex/gregoriotex.lua index 5f029a0fb..df90cb6fb 100644 --- a/tex/gregoriotex.lua +++ b/tex/gregoriotex.lua @@ -966,7 +966,7 @@ local function direct_gabc(gabc, header, allow_deprecated) local f = io.open(snippet_filename, 'w') -- trims spaces on both ends (trim6 from http://lua-users.org/wiki/StringTrim) gabc = gabc:match('^()%s*$') and '' or gabc:match('^%s*(.*%S)') - f:write('name:direct-gabc;\n'..(header or '')..'\n%%\n'..gabc:gsub('\\par ', '\n')) + f:write('name:direct-gabc;\n'..(header or '')..'\n%%\n'..gabc:gsub('\\par', '\n')) f:close() local cmd = string.format([[%s -W %s-o "%%s" -l "%s" "%s"]], gregorio_exe(), deprecated, snippet_logname, snippet_filename) From 64fa5bdf6b27b722e4e7c1cc92d801dd2b9d1d4e Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Tue, 2 Feb 2021 16:54:05 -0500 Subject: [PATCH 19/37] Update to iftex package Fixes #1481 --- tex/gregoriosyms.sty | 4 +- tex/gregoriotex-common.tex | 3 + tex/gregoriotex-main.tex | 10 --- tex/gregoriotex.sty | 4 +- tex/gregoriotex.tex | 159 +++++++++++++++++++------------------ 5 files changed, 89 insertions(+), 91 deletions(-) diff --git a/tex/gregoriosyms.sty b/tex/gregoriosyms.sty index 6945f2efc..93d55eab5 100644 --- a/tex/gregoriosyms.sty +++ b/tex/gregoriosyms.sty @@ -21,11 +21,13 @@ \ProvidesPackage{gregoriosyms} [2019/04/06 v5.2.1 GregorioTeX symbols only.]% PARSE_VERSION_DATE_LTX +\RequirePackage{iftex}% +\RequireLuaTeX + % 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}% diff --git a/tex/gregoriotex-common.tex b/tex/gregoriotex-common.tex index 1e582a511..3295de6bd 100644 --- a/tex/gregoriotex-common.tex +++ b/tex/gregoriotex-common.tex @@ -19,6 +19,9 @@ \gre@declarefileversion{gregoriotex-commonx.tex}{5.2.1}% GREGORIO_VERSION +\ifnum\luatexversion<76% + \gre@error{Error: this document must be compiled with LuaTeX (lualatex) 0.76 or later}% +\fi% %%%%%%%%% %% Debugging diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index 48ce60d9e..839c2c509 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -23,16 +23,6 @@ % 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% - - - % first some macros to allow checks for version: % Tests that all gregoriotex files are of the same version. % #1 is the name of the file diff --git a/tex/gregoriotex.sty b/tex/gregoriotex.sty index 230cabe5e..87f63885d 100644 --- a/tex/gregoriotex.sty +++ b/tex/gregoriotex.sty @@ -21,13 +21,15 @@ \ProvidesPackage{gregoriotex}% [2019/04/06 v5.2.1 GregorioTeX system.]% PARSE_VERSION_DATE_LTX +\RequirePackage{iftex}% +\RequireLuaTeX + % If gregoriosyms has been loaded then there are going to be some conflicts in the definitions made in that package and this one. In order to provide for a more informative error message, we check for that conflict right away \ifcsname gregoriotex@symbols@loaded\endcsname\gre@error{Loading gregoriotex after\MessageBreak gregoriosyms is not supported. Please remove the\MessageBreak loading of gregoriosyms (its contents are loaded\MessageBreak by gregoriotex)}\fi% \RequirePackage{xcolor}% \RequirePackage{luacolor}% \RequirePackage{kvoptions}% -\RequirePackage{ifluatex}% \RequirePackage{graphicx}% for \resizebox \RequirePackage{luatexbase}% \RequirePackage{luaotfload}% diff --git a/tex/gregoriotex.tex b/tex/gregoriotex.tex index b16c3c2b2..73334efa6 100644 --- a/tex/gregoriotex.tex +++ b/tex/gregoriotex.tex @@ -23,11 +23,12 @@ % This file needs to be marked with the version number. For now I've done this with the following comment, but we should check to see if PlainTeX has something similar to the version declaration of LaTeX and use that if it does. % [2019/04/06 v5.2.1 GregorioTeX system.]% PARSE_VERSION_DATE_LTX +\input iftex.sty +\RequireLuaTeX% \edef\greoldcatcode{\the\catcode`@} \catcode`\@=11 -\input ifluatex.sty% \input luatexbase.sty% \input luamplib.sty% \input luaotfload.sty% @@ -61,32 +62,32 @@ \ifcsname gre@debug\endcsname% \else% - \def\gre@debug{}% + \def\gre@debug{}% \fi% \ifcsname f@size\endcsname% \else% - \def\f@size{\directlua{gregoriotex.font_size()}}% + \def\f@size{\directlua{gregoriotex.font_size()}}% \fi% \newif\ifgre@allowdeprecated% \gre@allowdeprecatedtrue% \long\def\gre@metapost#1{{% - \gre@localleftbox{}% - \gre@localrightbox{}% - \mplibcode - #1 - \endmplibcode% + \gre@localleftbox{}% + \gre@localrightbox{}% + \mplibcode + #1 + \endmplibcode% }}% %% This is \strip@pt from LaTeX \begingroup% - \catcode`P=12% - \catcode`T=12% - \lowercase{% - \def\x{\def\gre@rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}}% - \expandafter\endgroup\x% + \catcode`P=12% + \catcode`T=12% + \lowercase{% + \def\x{\def\gre@rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}}% + \expandafter\endgroup\x% \def\gre@strip@pt{\expandafter\gre@rem@pt\the}% \long\def\gre@iflatex#1{}% @@ -106,40 +107,40 @@ %%%%%%%%% \def\GreBold#1{% - {\bf #1}% - \relax % + {\bf #1}% + \relax % }% \def\GreItalic#1{% - {\it #1}% - %\relax + {\it #1}% + %\relax }% % Since small caps in PlainTeX requires loading another font, it is not defined by default. This command maintains compatibility by checking to see if \sc has been defined and raising a warning when it hasn’t \def\GreSmallCaps#1{% - \ifdefined\sc% - {\sc #1}% - \else% - \gre@warning{Small caps (\protect\sc) is not defined}% - {#1}% - \fi% - \relax % + \ifdefined\sc% + {\sc #1}% + \else% + \gre@warning{Small caps (\protect\sc) is not defined}% + {#1}% + \fi% + \relax % }% \def\GreTypewriter#1{% - {\tt #1}% - \relax % + {\tt #1}% + \relax % }% \def\GreColored#1{% - {% - \color{gregoriocolor}#1% - }% + {% + \color{gregoriocolor}#1% + }% }% \def\GreUnderline#1{% - $\underline{\rm #1}$ - \relax % + $\underline{\rm #1}$ + \relax % }% %%%%%%%%%%%%%%% @@ -149,7 +150,7 @@ % Colors don't work in PlainTeX, but we need these functions for interoperability with LaTeX. \def\gresetlinecolor#1{% - \gre@changestyle{normalstafflines}{\color{#1}}[\relax]% + \gre@changestyle{normalstafflines}{\color{#1}}[\relax]% } @@ -160,122 +161,122 @@ \font\gre@font@initial=pncr at 40pt\relax% \def\gre@style@initial{% - \begingroup% - \gre@font@initial% - \relax % + \begingroup% + \gre@font@initial% + \relax % }% \def\endgre@style@initial{\endgroup}% \def\gre@style@translation{% - \begingroup% - \it% + \begingroup% + \it% }% \def\endgre@style@translation{\endgroup}% \def\gre@style@abovelinestext{% - \begingroup% - \it% + \begingroup% + \it% }% \def\endgre@style@abovelinestext{\endgroup}% \def\gre@style@normalstafflines{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@normalstafflines{\endgroup}% \def\gre@style@additionalstafflines{% - \begingroup% - \gre@style@normalstafflines% + \begingroup% + \gre@style@normalstafflines% }% \def\endgre@style@additionalstafflines{% - \endgre@style@normalstafflines% - \endgroup% + \endgre@style@normalstafflines% + \endgroup% }% \def\gre@style@lowchoralsign{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@lowchoralsign{\endgroup}% \def\gre@style@highchoralsign{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@highchoralsign{\endgroup}% \def\gre@style@firstsyllableinitial{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@firstsyllableinitial{\endgroup}% \def\gre@style@firstsyllable{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@firstsyllable{\endgroup}% \def\gre@style@firstword{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@firstword{\endgroup}% \def\gre@style@modeline{% - \begingroup% - \bf% - \relax% + \begingroup% + \bf% + \relax% }% \def\endgre@style@modeline{\endgroup}% \def\gre@style@modemodifier{% - \begingroup% - \bf% - \it% - \relax% + \begingroup% + \bf% + \it% + \relax% }% \def\endgre@style@modemodifier{\endgroup}% \def\gre@style@modedifferentia{% - \begingroup% - \bf% - \relax% + \begingroup% + \bf% + \relax% }% \def\endgre@style@modedifferentia{\endgroup}% \def\gre@style@commentary{% - \begingroup% - \it% - % footnotesize in LaTeX, but nothing here since changing font size is so hard - \relax% + \begingroup% + \it% + % footnotesize in LaTeX, but nothing here since changing font size is so hard + \relax% }% \def\endgre@style@commentary{\endgroup}% \def\gre@style@elision{% - \begingroup% - \it% - % small in LaTeX, but nothing here since changing font size is so hard - \relax% + \begingroup% + \it% + % small in LaTeX, but nothing here since changing font size is so hard + \relax% }% \def\endgre@style@elision{\endgroup}% \def\gre@style@annotation{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@annotation{\endgroup}% \def\gre@style@nabc{% - \begingroup% - \color{gregoriocolor}% + \begingroup% + \color{gregoriocolor}% } \def\endgre@style@nabc{\endgroup}% \def\gre@changestyle#1#2[#3]{% - \expandafter\gdef\csname gre@style@#1\endcsname{\begingroup#2}% - \expandafter\gdef\csname endgre@style@#1\endcsname{#3\endgroup}% + \expandafter\gdef\csname gre@style@#1\endcsname{\begingroup#2}% + \expandafter\gdef\csname endgre@style@#1\endcsname{#3\endgroup}% }% %%%%%%%%%%%%%%% From 12b0017128265bdc00f96aaa3b9b61c53e7f71ca Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Wed, 3 Feb 2021 12:37:22 -0500 Subject: [PATCH 20/37] Add option for hiding translations --- tex/gregoriotex-main.tex | 60 ++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index 48ce60d9e..fd0e60662 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -1027,37 +1027,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{% From 0b8b294b61a7ae2b10d8f8a556369cd42f9cdf8c Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Wed, 3 Feb 2021 13:04:45 -0500 Subject: [PATCH 21/37] Add option for hiding above lines text --- tex/gregoriotex-main.tex | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index fd0e60662..461cd77de 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -740,14 +740,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 From e412b9f815e934075de36bbc5b740d001503431b Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 31 Jan 2021 16:08:31 -0500 Subject: [PATCH 22/37] Updates to doc_check.sh Assume use of GNU sed at all times. (cherry picked from commit 7866a11d761fdd5c2f400a31603f1e47861c8946) --- doc_check.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc_check.sh b/doc_check.sh index f304efcb4..d165d29fa 100755 --- a/doc_check.sh +++ b/doc_check.sh @@ -12,6 +12,7 @@ # The script is not perfect, and especially has trouble with classes of macros # which have only one entry in the documentation. +#set -x #echo on HERE=`pwd` @@ -36,16 +37,16 @@ sed -i.temp 's:.*OBSOLETE.*::' $CODEFILE sed -i.temp 's:.*DEPRECATED.*::' $CODEFILE #remove trailing comments -gsed -i.temp 's/%.*$//' $CODEFILE +sed -i.temp 's/%.*$//' $CODEFILE #remove whitespace -gsed -i.temp 's/^[ \t]*//;s/[ \t]*$//' $CODEFILE +sed -i.temp 's/^[ \t]*//;s/[ \t]*$//' $CODEFILE #remove new and trailing code sed -i.temp 's:.*\\new[a-z]*{*\(\\*[a-zA-Z@]*\)[\\}]*.*:\1:' $CODEFILE #get rid of work around def -sed -i.temp -E 's:\\def\\x{::' $CODEFILE +sed -i.temp '/\\def\\x/d' $CODEFILE #accept only first def on line sed -i.temp -E 's:\\[gex]?def:special:' $CODEFILE @@ -87,6 +88,7 @@ sed -i.temp 's:.*count@temp@.*::' $CODEFILE #registers for saved values sed -i.temp 's:\\gre@saved@.*::' $CODEFILE +sed -i.temp '/\\ifgre@saved@.*/d' $CODEFILE #macros used to process options sed -i.temp 's:\\gre@autocompile::' $CODEFILE @@ -120,7 +122,7 @@ sed -i.temp 's:\\macroname{\([^}]*\)}.*:\1:' $DOCFILE sed -i.temp 's:\\textbackslash :\\:' $DOCFILE #styles -sed -i.temp 's:.*\stylename{\([a-z]*\)}.*:\1:' $DOCFILE +sed -i.temp 's:.*stylename{\([a-z]*\)}.*:\1:' $DOCFILE #distances sed -i.temp 's:\\begin{gdimension}{\([a-z@]*\)}.*:\1:' $DOCFILE @@ -146,7 +148,7 @@ grep -h '\\gre@deprecated.*' *.tex | grep -v '\\def\\' >> $DOCFILE grep -h '\\gre@obsolete.*' *.tex | grep -v '\\def\\' >> $DOCFILE #remove whitespace -gsed -i.temp 's/^[ \t]*//;s/[ \t]*$//' $DOCFILE +sed -i.temp 's/^[ \t]*//;s/[ \t]*$//' $DOCFILE sed -i.temp 's:.*\\gre@deprecated{.*::' $DOCFILE sed -i.temp 's:.*\\gre@obsolete{.*::' $DOCFILE From 1e4132b41adc54c4fddd1297d51985457f5ac878 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Wed, 3 Feb 2021 13:29:08 -0500 Subject: [PATCH 23/37] Documentation for new features --- doc/Command_Index_User.tex | 16 ++++++++++++++++ doc/Command_Index_internal.tex | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/doc/Command_Index_User.tex b/doc/Command_Index_User.tex index dd00ca685..2174c17a5 100644 --- a/doc/Command_Index_User.tex +++ b/doc/Command_Index_User.tex @@ -931,6 +931,22 @@ \subsubsection{Text Elements} & \texttt{invisible} & Lyrics are not visible.\\ \end{argtable} +\macroname{\textbackslash gresettranslation}{\{\#1\}}{gregoriotex-main.tex} +Sets the visibility of the translations. + +\begin{argtable} + \#1 & \texttt{visible} & Translations are visible (default).\\ + & \texttt{invisible} & Translations are not visible.\\ +\end{argtable} + +\macroname{\textbackslash gresetabovelinestext}{\{\#1\}}{gregoriotex-main.tex} +Sets the visibility of the above lines text. + +\begin{argtable} + \#1 & \texttt{visible} & Above lines text are visible (default).\\ + & \texttt{invisible} & Above lines text are not visible.\\ +\end{argtable} + \subsubsection{Text Alignment} Gregorio\TeX\ allows you to manipulate the global alignment behavior of some text elements using the following commands. diff --git a/doc/Command_Index_internal.tex b/doc/Command_Index_internal.tex index c9cb52408..50941d61d 100644 --- a/doc/Command_Index_internal.tex +++ b/doc/Command_Index_internal.tex @@ -1949,6 +1949,12 @@ \subsection{Flags} \macroname{\textbackslash ifgre@showlyrics}{}{gregoriotex-syllable.tex} Boolean indicating whether the lyrics should be shown. +\macroname{\textbackslash ifgre@showtranslation}{}{gregoriotex-main.tex} +Boolean indicating whether the translation should be shown. + +\macroname{\textbackslash ifgre@showabovelinestext}{}{gregoriotex-main.tex} +Boolean indicating whether the above lines text should be shown. + \macroname{\textbackslash gre@initiallines}{}{gregoriotex-syllable.tex} Number of lines the initial takes up. Currently limited to 0, 1, or 2. Not currently a count, but will be changed to one in 5.0. From 5a5725c3965b1cc5e4626b317bf1d85b5c66fb37 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Wed, 3 Feb 2021 15:13:37 -0500 Subject: [PATCH 24/37] Correct a typo Fixes #1472 --- tex/gregoriotex-symbols.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tex/gregoriotex-symbols.tex b/tex/gregoriotex-symbols.tex index 11a33845d..68db0b028 100644 --- a/tex/gregoriotex-symbols.tex +++ b/tex/gregoriotex-symbols.tex @@ -77,7 +77,7 @@ \gredefsizedsymbol{greABarCaptionSC}{greextra}{ABarCaptionSC} \gredefsizedsymbol{greRBarCaptionSC}{greextra}{RBarCaptionSC} \gredefsizedsymbol{greVBarCaptionSC}{greextra}{VBarCaptionSC} -\gredefsizedsymbol{greABarAlt}{greextra}{RBar.alt} +\gredefsizedsymbol{greABarAlt}{greextra}{ABar.alt} \gredefsizedsymbol{greRBarAlt}{greextra}{RBar.alt} \gredefsizedsymbol{greVBarAlt}{greextra}{VBar.alt} From a0d1015995331a6cee517beb0087b31a24d23cbb Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Thu, 4 Feb 2021 09:51:05 -0500 Subject: [PATCH 25/37] Changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfafb57df..d99bc2e21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Staff line thickness is now set in gsp-default.tex. This corrects a problem with the staff lines changing thickness when the default spacing configuration is loaded while the staff size is something other than the default (17). See [#1461](https://github.com/gregorio-project/gregorio/issues/1461). - Corrected interaction issues between text styles and ligatures. The LaTeX commands like `\textit` insert italics correction, preventing ligatures being formed between their arguments if two occur sequentially. On the other hand the switches like `\itshape` do not. Since gregorio breaks up syllables around the vowel and then applies the formating commands to each part, this behavior showed up. We switch to using the switches to avoid this (except for underlining, for which a switch does not exist). We also fix this for color tags by loading `luacolor` which changes how the `\color` tag is implemented to allow ligatures to span groups. See [#1444](https://github.com/gregorio-project/gregorio/issues/1444). +- Fixed typo in gregoriotex-symbols.tex so that `\greABarAlt` is defined correctly. See [#1472](https://github.com/gregorio-project/gregorio/issues/1472). ### Added - GregorioTeX will now look in additional places for scores using. Users can specify paths to look in using `\gresetgregpath`. If scores are not found in the current working directory or the list of provided paths, we fall back on kpse to try and find them. See [#1395](https://github.com/gregorio-project/gregorio/issues/1395). From c4fd151bcc375e5c70985d2e497781cd9608b951 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Thu, 4 Feb 2021 09:53:25 -0500 Subject: [PATCH 26/37] Changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfafb57df..7c8321c93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Staff line thickness is now set in gsp-default.tex. This corrects a problem with the staff lines changing thickness when the default spacing configuration is loaded while the staff size is something other than the default (17). See [#1461](https://github.com/gregorio-project/gregorio/issues/1461). - Corrected interaction issues between text styles and ligatures. The LaTeX commands like `\textit` insert italics correction, preventing ligatures being formed between their arguments if two occur sequentially. On the other hand the switches like `\itshape` do not. Since gregorio breaks up syllables around the vowel and then applies the formating commands to each part, this behavior showed up. We switch to using the switches to avoid this (except for underlining, for which a switch does not exist). We also fix this for color tags by loading `luacolor` which changes how the `\color` tag is implemented to allow ligatures to span groups. See [#1444](https://github.com/gregorio-project/gregorio/issues/1444). +- Fixed an overly specific find/replace in snippets that that led to `\par` being able to slip into the snippet file under certain circumstances (and there by causing compilation to fail). See [#1497](https://github.com/gregorio-project/gregorio/issues/1497). ### Added - GregorioTeX will now look in additional places for scores using. Users can specify paths to look in using `\gresetgregpath`. If scores are not found in the current working directory or the list of provided paths, we fall back on kpse to try and find them. See [#1395](https://github.com/gregorio-project/gregorio/issues/1395). From a01a1bfcd3e7fa80b17855b3f8671e7a358655cb Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Thu, 4 Feb 2021 09:55:07 -0500 Subject: [PATCH 27/37] Changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfafb57df..998ceeadc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Staff line thickness is now set in gsp-default.tex. This corrects a problem with the staff lines changing thickness when the default spacing configuration is loaded while the staff size is something other than the default (17). See [#1461](https://github.com/gregorio-project/gregorio/issues/1461). - Corrected interaction issues between text styles and ligatures. The LaTeX commands like `\textit` insert italics correction, preventing ligatures being formed between their arguments if two occur sequentially. On the other hand the switches like `\itshape` do not. Since gregorio breaks up syllables around the vowel and then applies the formating commands to each part, this behavior showed up. We switch to using the switches to avoid this (except for underlining, for which a switch does not exist). We also fix this for color tags by loading `luacolor` which changes how the `\color` tag is implemented to allow ligatures to span groups. See [#1444](https://github.com/gregorio-project/gregorio/issues/1444). +- Updated to use iftex package (the sucessor to ifluatex). See [#1481](https://github.com/gregorio-project/gregorio/issues/1481). ### Added - GregorioTeX will now look in additional places for scores using. Users can specify paths to look in using `\gresetgregpath`. If scores are not found in the current working directory or the list of provided paths, we fall back on kpse to try and find them. See [#1395](https://github.com/gregorio-project/gregorio/issues/1395). From dbdc4f13c2803a66f02ab0ec3ff5ccd11242cf39 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Thu, 4 Feb 2021 09:55:42 -0500 Subject: [PATCH 28/37] Indentation fixes --- tex/gregoriotex.tex | 156 ++++++++++++++++++++++---------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/tex/gregoriotex.tex b/tex/gregoriotex.tex index 73334efa6..5396f9be9 100644 --- a/tex/gregoriotex.tex +++ b/tex/gregoriotex.tex @@ -62,32 +62,32 @@ \ifcsname gre@debug\endcsname% \else% - \def\gre@debug{}% + \def\gre@debug{}% \fi% \ifcsname f@size\endcsname% \else% - \def\f@size{\directlua{gregoriotex.font_size()}}% + \def\f@size{\directlua{gregoriotex.font_size()}}% \fi% \newif\ifgre@allowdeprecated% \gre@allowdeprecatedtrue% \long\def\gre@metapost#1{{% - \gre@localleftbox{}% - \gre@localrightbox{}% - \mplibcode - #1 - \endmplibcode% + \gre@localleftbox{}% + \gre@localrightbox{}% + \mplibcode + #1 + \endmplibcode% }}% %% This is \strip@pt from LaTeX \begingroup% - \catcode`P=12% - \catcode`T=12% - \lowercase{% - \def\x{\def\gre@rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}}% - \expandafter\endgroup\x% + \catcode`P=12% + \catcode`T=12% + \lowercase{% + \def\x{\def\gre@rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}}% + \expandafter\endgroup\x% \def\gre@strip@pt{\expandafter\gre@rem@pt\the}% \long\def\gre@iflatex#1{}% @@ -107,40 +107,40 @@ %%%%%%%%% \def\GreBold#1{% - {\bf #1}% - \relax % + {\bf #1}% + \relax % }% \def\GreItalic#1{% - {\it #1}% - %\relax + {\it #1}% + %\relax }% % Since small caps in PlainTeX requires loading another font, it is not defined by default. This command maintains compatibility by checking to see if \sc has been defined and raising a warning when it hasn’t \def\GreSmallCaps#1{% - \ifdefined\sc% - {\sc #1}% - \else% - \gre@warning{Small caps (\protect\sc) is not defined}% - {#1}% - \fi% - \relax % + \ifdefined\sc% + {\sc #1}% + \else% + \gre@warning{Small caps (\protect\sc) is not defined}% + {#1}% + \fi% + \relax % }% \def\GreTypewriter#1{% - {\tt #1}% - \relax % + {\tt #1}% + \relax % }% \def\GreColored#1{% - {% - \color{gregoriocolor}#1% - }% + {% + \color{gregoriocolor}#1% + }% }% \def\GreUnderline#1{% - $\underline{\rm #1}$ - \relax % + $\underline{\rm #1}$ + \relax % }% %%%%%%%%%%%%%%% @@ -150,7 +150,7 @@ % Colors don't work in PlainTeX, but we need these functions for interoperability with LaTeX. \def\gresetlinecolor#1{% - \gre@changestyle{normalstafflines}{\color{#1}}[\relax]% + \gre@changestyle{normalstafflines}{\color{#1}}[\relax]% } @@ -161,122 +161,122 @@ \font\gre@font@initial=pncr at 40pt\relax% \def\gre@style@initial{% - \begingroup% - \gre@font@initial% - \relax % + \begingroup% + \gre@font@initial% + \relax % }% \def\endgre@style@initial{\endgroup}% \def\gre@style@translation{% - \begingroup% - \it% + \begingroup% + \it% }% \def\endgre@style@translation{\endgroup}% \def\gre@style@abovelinestext{% - \begingroup% - \it% + \begingroup% + \it% }% \def\endgre@style@abovelinestext{\endgroup}% \def\gre@style@normalstafflines{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@normalstafflines{\endgroup}% \def\gre@style@additionalstafflines{% - \begingroup% - \gre@style@normalstafflines% + \begingroup% + \gre@style@normalstafflines% }% \def\endgre@style@additionalstafflines{% - \endgre@style@normalstafflines% - \endgroup% + \endgre@style@normalstafflines% + \endgroup% }% \def\gre@style@lowchoralsign{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@lowchoralsign{\endgroup}% \def\gre@style@highchoralsign{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@highchoralsign{\endgroup}% \def\gre@style@firstsyllableinitial{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@firstsyllableinitial{\endgroup}% \def\gre@style@firstsyllable{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@firstsyllable{\endgroup}% \def\gre@style@firstword{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@firstword{\endgroup}% \def\gre@style@modeline{% - \begingroup% - \bf% - \relax% + \begingroup% + \bf% + \relax% }% \def\endgre@style@modeline{\endgroup}% \def\gre@style@modemodifier{% - \begingroup% - \bf% - \it% - \relax% + \begingroup% + \bf% + \it% + \relax% }% \def\endgre@style@modemodifier{\endgroup}% \def\gre@style@modedifferentia{% - \begingroup% - \bf% - \relax% + \begingroup% + \bf% + \relax% }% \def\endgre@style@modedifferentia{\endgroup}% \def\gre@style@commentary{% - \begingroup% - \it% - % footnotesize in LaTeX, but nothing here since changing font size is so hard - \relax% + \begingroup% + \it% + % footnotesize in LaTeX, but nothing here since changing font size is so hard + \relax% }% \def\endgre@style@commentary{\endgroup}% \def\gre@style@elision{% - \begingroup% - \it% - % small in LaTeX, but nothing here since changing font size is so hard - \relax% + \begingroup% + \it% + % small in LaTeX, but nothing here since changing font size is so hard + \relax% }% \def\endgre@style@elision{\endgroup}% \def\gre@style@annotation{% - \begingroup% - \relax% + \begingroup% + \relax% }% \def\endgre@style@annotation{\endgroup}% \def\gre@style@nabc{% - \begingroup% - \color{gregoriocolor}% + \begingroup% + \color{gregoriocolor}% } \def\endgre@style@nabc{\endgroup}% \def\gre@changestyle#1#2[#3]{% - \expandafter\gdef\csname gre@style@#1\endcsname{\begingroup#2}% - \expandafter\gdef\csname endgre@style@#1\endcsname{#3\endgroup}% + \expandafter\gdef\csname gre@style@#1\endcsname{\begingroup#2}% + \expandafter\gdef\csname endgre@style@#1\endcsname{#3\endgroup}% }% %%%%%%%%%%%%%%% From a025a740933effd9bb9f09192b8da9c3ff79687a Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Thu, 4 Feb 2021 10:01:00 -0500 Subject: [PATCH 29/37] Changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfafb57df..21b4533e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Staff line thickness is now set in gsp-default.tex. This corrects a problem with the staff lines changing thickness when the default spacing configuration is loaded while the staff size is something other than the default (17). See [#1461](https://github.com/gregorio-project/gregorio/issues/1461). - Corrected interaction issues between text styles and ligatures. The LaTeX commands like `\textit` insert italics correction, preventing ligatures being formed between their arguments if two occur sequentially. On the other hand the switches like `\itshape` do not. Since gregorio breaks up syllables around the vowel and then applies the formating commands to each part, this behavior showed up. We switch to using the switches to avoid this (except for underlining, for which a switch does not exist). We also fix this for color tags by loading `luacolor` which changes how the `\color` tag is implemented to allow ligatures to span groups. See [#1444](https://github.com/gregorio-project/gregorio/issues/1444). +- A reuse of a save register led to the `\hyphenpenalty` not being restored correctly at the end of the score. All save registers are now clearly identified by when they are used so as to make it harder to accidentally use the wrong one. See [posts on mailing list](https://groups.google.com/g/gregorio-users/c/u3LmnGYnhwU). ### Added - GregorioTeX will now look in additional places for scores using. Users can specify paths to look in using `\gresetgregpath`. If scores are not found in the current working directory or the list of provided paths, we fall back on kpse to try and find them. See [#1395](https://github.com/gregorio-project/gregorio/issues/1395). From 6587eabf28ea57dd3cf98b9d032dce13aba3fba7 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Thu, 4 Feb 2021 10:02:39 -0500 Subject: [PATCH 30/37] Changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfafb57df..505e2b219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). ### Added - GregorioTeX will now look in additional places for scores using. Users can specify paths to look in using `\gresetgregpath`. If scores are not found in the current working directory or the list of provided paths, we fall back on kpse to try and find them. See [#1395](https://github.com/gregorio-project/gregorio/issues/1395). +- Added the ability to toggle the visibility of the translation and above lines text. See [user request on mailing list](https://groups.google.com/g/gregorio-users/c/J-V0dkBMevY). ## [5.2.1] - 2019-04-06 From 810d073bbcb8d752c50feb5770a3a7898b015ca3 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Thu, 4 Feb 2021 21:40:13 -0500 Subject: [PATCH 31/37] Rename unisonpunctuminclinatumshift to uprightpunctuminclinatumshift Also fills in some missing related documentation Fixes #1507 --- CHANGELOG.md | 3 +++ doc/Command_Index_internal.tex | 4 ++++ tex/gregoriotex-main.tex | 6 +++++- tex/gsp-default.tex | 4 ++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfafb57df..cb0755e4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). It follows [some conventions](http://keepachangelog.com/). ## [Unreleased][CTAN] +### Changed +- The space between a non-punctum inclinatum and the upright punctum inclinatum is renamed to uprightpunctuminclinatumshift. This helps to better distinguish it from punctuminclinatumunisonshift (the space between two consecutive ascending or descending puncta inclinata on the same line). See [#1507](https://github.com/gregorio-project/gregorio/issues/1507). + ### Fixed - Staff line thickness is now set in gsp-default.tex. This corrects a problem with the staff lines changing thickness when the default spacing configuration is loaded while the staff size is something other than the default (17). See [#1461](https://github.com/gregorio-project/gregorio/issues/1461). - Corrected interaction issues between text styles and ligatures. The LaTeX commands like `\textit` insert italics correction, preventing ligatures being formed between their arguments if two occur sequentially. On the other hand the switches like `\itshape` do not. Since gregorio breaks up syllables around the vowel and then applies the formating commands to each part, this behavior showed up. We switch to using the switches to avoid this (except for underlining, for which a switch does not exist). We also fix this for color tags by loading `luacolor` which changes how the `\color` tag is implemented to allow ligatures to span groups. See [#1444](https://github.com/gregorio-project/gregorio/issues/1444). diff --git a/doc/Command_Index_internal.tex b/doc/Command_Index_internal.tex index c9cb52408..3124a37e7 100644 --- a/doc/Command_Index_internal.tex +++ b/doc/Command_Index_internal.tex @@ -1050,6 +1050,10 @@ \section{Gregorio\TeX{} Controls} & \texttt{20} & Space between a punctum inclinatum and a ``no-bar'' glyph two pitches above. \\ & \texttt{21} & Space between a punctum inclinatum and a ``no-bar'' glyph three or four pitches above \\ & \texttt{22} & Half-space. \\ + & \texttt{23} & Space between two puncta inclinata on a unison. \\ + & \texttt{24} & Space before a right-leaning puncta inclinatum when the pitch is ascending (up to 4 pitches away). \\ + & \texttt{25} & Space before a left-leaning puncta inclinatum when the pitch is descending (up to 4 pitches away). \\ + & \texttt{26} & Space after after a non-punctum inclinatum and before the upright punctum inclinatum. \\ \end{argtable} \macroname{\textbackslash gre@nabcfontname}{}{gregoriotex-main.tex} diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index 48ce60d9e..2709e2ef7 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -1537,6 +1537,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% @@ -1592,7 +1596,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% diff --git a/tex/gsp-default.tex b/tex/gsp-default.tex index 5f741537d..ab6b682ef 100644 --- a/tex/gsp-default.tex +++ b/tex/gsp-default.tex @@ -206,8 +206,8 @@ \grecreatedim{descendingpunctuminclinatumascendingshift}{-0.07918 cm plus 0.0009 cm minus 0.0009 cm}{scalable}% % space between two ascending punctum inclinatum glyphs in an descent \grecreatedim{ascendingpunctuminclinatumdescendingshift}{-0.07918 cm plus 0.0009 cm minus 0.0009 cm}{scalable}% -% space between two unison punctum inclinatum glyphs (at the unison) -\grecreatedim{unisonpunctuminclinatumshift}{0.05286 cm plus 0.00728 cm minus 0.00455 cm}{scalable}% +% Space after after a non-punctum inclinatum and before the upright punctum inclinatum +\grecreatedim{uprightpunctuminclinatumshift}{0.05286 cm plus 0.00728 cm minus 0.00455 cm}{scalable}% % %%%%%%%% From ddec72e27230017f33bc6050fd45619f51664b19 Mon Sep 17 00:00:00 2001 From: Ben Yanke Date: Thu, 17 Dec 2020 21:54:49 -0600 Subject: [PATCH 32/37] Fix broken link (cherry picked from commit 77ff65b3ff62a73c50a0223cc8e02b59e02da63f) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 215993bde..3b5d5543b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Create a [LaTeX](http://en.wikipedia.org/wiki/LaTeX) file that will produce the Compile the LaTeX file with LuaLaTeX, you get your score in PDF! You can change the LaTeX file to include other scores, create booklets, books, etc. -You can also try it online [here](http://dev.illuminarepublications.com/gregorio/). +You can also try it online [here](http://dev.illuminarepublications.com/). ## Installation From ea2ec35c70a4fd341950912b03782d3d7d7fbf55 Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Thu, 2 Jan 2020 07:14:57 +0000 Subject: [PATCH 33/37] Simplify example file Use KOMA-Script article class to achieve the intended appearance with fewer additional packages. Improve font loading with Libertinus package. --- examples/main-lualatex.tex | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/examples/main-lualatex.tex b/examples/main-lualatex.tex index 018a0a06b..2e8bc2034 100644 --- a/examples/main-lualatex.tex +++ b/examples/main-lualatex.tex @@ -2,21 +2,23 @@ % This is a simple template for a LuaLaTeX document using gregorio scores. -\documentclass[11pt]{article} % use larger type; default would be 10pt +\documentclass[ + fontsize=11pt, + paper=a4 +]{scrartcl} % document class: manual at https://ctan.org/pkg/koma-script -% usual packages loading: -\usepackage{fontspec} -\usepackage{graphicx} % support the \includegraphics command and options -\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. -\geometry{a4paper} % or letterpaper (US) or a5paper or.... +% load packages: +\usepackage[osf,p]{libertinus} % Decent (free) font, but should be changed if you have high standards \usepackage{gregoriotex} % for gregorio score inclusion -\usepackage{fullpage} % to reduce the margins -\usepackage{libertine} % Decent (free) font for Gregorian, but should be changed if you have high standards +\usepackage[latin]{babel} % set language + +\setkomafont{section}{\normalfont\centering\huge\scshape} % section heading style +\setcounter{secnumdepth}{-\maxdimen} % remove section numbering \begin{document} % The title: -\begin{center}\begin{huge}\textsc{Populus Sion}\end{huge}\end{center} +\section{Populus Sion} % Here we set the space around the initial. % Please report to http://gregorio-project.github.io/gregoriotex/details.html for more details and options @@ -40,8 +42,7 @@ % and finally we include the scores. The file must be in the same directory as this one. \gregorioscore[a]{PopulusSion} -\bigskip -\begin{center}\begin{huge}\textsc{Factus Est}\end{huge}\end{center} +\section{Factus est} \gregorioscore[a]{FactusEst} From adf940d5e1040cc77718254a8decfbd7ccf2040a Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Sun, 2 Feb 2020 20:33:45 +0000 Subject: [PATCH 34/37] Simplify comments in sample document --- examples/main-lualatex.tex | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/examples/main-lualatex.tex b/examples/main-lualatex.tex index 2e8bc2034..e26001d92 100644 --- a/examples/main-lualatex.tex +++ b/examples/main-lualatex.tex @@ -1,15 +1,12 @@ % !TEX program = LuaLaTeX+se -% This is a simple template for a LuaLaTeX document using gregorio scores. +% Simple template for using Gregorio scores in a LuaLaTeX document. -\documentclass[ - fontsize=11pt, - paper=a4 -]{scrartcl} % document class: manual at https://ctan.org/pkg/koma-script +\documentclass{scrartcl} % set document class: manual at https://ctan.org/pkg/koma-script -% load packages: -\usepackage[osf,p]{libertinus} % Decent (free) font, but should be changed if you have high standards -\usepackage{gregoriotex} % for gregorio score inclusion +% Load packages: +\usepackage[osf,p]{libertinus} % set font +\usepackage{gregoriotex} % enable Gregorio score inclusion \usepackage[latin]{babel} % set language \setkomafont{section}{\normalfont\centering\huge\scshape} % section heading style @@ -20,26 +17,26 @@ % The title: \section{Populus Sion} -% Here we set the space around the initial. -% Please report to http://gregorio-project.github.io/gregoriotex/details.html for more details and options +% Set the space around the initial: +% See http://gregorio-project.github.io/gregoriotex/details.html for more details and options \grechangedim{beforeinitialshift}{2.2mm}{scalable} \grechangedim{afterinitialshift}{2.2mm}{scalable} -% Here we set the initial font. Change 43 if you want a bigger initial. +% Set the initial font (change 43 for a larger size): \grechangestyle{initial}{\fontsize{43}{43}\selectfont}% -% We set red lines here, comment it if you want black ones. +% Make staff lines red; remove for black: \gresetlinecolor{gregoriocolor} -% We set VII above the initial manually +% Add VII above the initial manually: \grechangestyle{annotation}{\small\bfseries} \greannotation{Intr.} \greannotation{\textsc{vii}} -% We use the "commentary" field of the score in the top right corner: +% Use the "commentary" field of the score in the top right corner: \gresetheadercapture{commentary}{grecommentary}{string} -% and finally we include the scores. The file must be in the same directory as this one. +% Include the scores; the file must be in the same directory: \gregorioscore[a]{PopulusSion} \section{Factus est} From 883447436681cf235eb9cc16131de43ff53945ea Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Sat, 5 Sep 2020 07:38:46 +0100 Subject: [PATCH 35/37] Revert to Libertine package Libertinus is slower. --- examples/main-lualatex.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/main-lualatex.tex b/examples/main-lualatex.tex index e26001d92..1a226da12 100644 --- a/examples/main-lualatex.tex +++ b/examples/main-lualatex.tex @@ -5,7 +5,7 @@ \documentclass{scrartcl} % set document class: manual at https://ctan.org/pkg/koma-script % Load packages: -\usepackage[osf,p]{libertinus} % set font +\usepackage[osf,p]{libertine} % set font \usepackage{gregoriotex} % enable Gregorio score inclusion \usepackage[latin]{babel} % set language From 05820d6d134bac7fa57ca7a010f19a9700c35e4a Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Sat, 5 Sep 2020 07:49:13 +0100 Subject: [PATCH 36/37] Separate formatting and content for clarity --- examples/main-lualatex.tex | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/main-lualatex.tex b/examples/main-lualatex.tex index 1a226da12..9bbcb8552 100644 --- a/examples/main-lualatex.tex +++ b/examples/main-lualatex.tex @@ -12,10 +12,6 @@ \setkomafont{section}{\normalfont\centering\huge\scshape} % section heading style \setcounter{secnumdepth}{-\maxdimen} % remove section numbering -\begin{document} - -% The title: -\section{Populus Sion} % Set the space around the initial: % See http://gregorio-project.github.io/gregoriotex/details.html for more details and options @@ -28,15 +24,21 @@ \section{Populus Sion} % Make staff lines red; remove for black: \gresetlinecolor{gregoriocolor} -% Add VII above the initial manually: -\grechangestyle{annotation}{\small\bfseries} -\greannotation{Intr.} -\greannotation{\textsc{vii}} - % Use the "commentary" field of the score in the top right corner: \gresetheadercapture{commentary}{grecommentary}{string} -% Include the scores; the file must be in the same directory: +% Format annotation above initial +\grechangestyle{annotation}{\small\bfseries} + +\begin{document} + +\section{Populus Sion} + +% Add VII above the initial manually: +\greannotation{Intr.} % first line +\greannotation{\textsc{vii}} % second line + +% Include the score; the file must be in the same directory: \gregorioscore[a]{PopulusSion} \section{Factus est} From 2536837a169b4e429c7a3dc9311fd55361017424 Mon Sep 17 00:00:00 2001 From: "Br. Samuel Springuel" Date: Sat, 6 Feb 2021 13:37:50 -0500 Subject: [PATCH 37/37] Revert "Correct a typo" --- CHANGELOG.md | 1 - tex/gregoriotex-symbols.tex | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16a23b047..350dbbd40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,6 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). - A reuse of a save register led to the `\hyphenpenalty` not being restored correctly at the end of the score. All save registers are now clearly identified by when they are used so as to make it harder to accidentally use the wrong one. See [posts on mailing list](https://groups.google.com/g/gregorio-users/c/u3LmnGYnhwU). - Fixed an overly specific find/replace in snippets that that led to `\par` being able to slip into the snippet file under certain circumstances (and there by causing compilation to fail). See [#1497](https://github.com/gregorio-project/gregorio/issues/1497). - Updated to use iftex package (the sucessor to ifluatex). See [#1481](https://github.com/gregorio-project/gregorio/issues/1481). -- Fixed typo in gregoriotex-symbols.tex so that `\greABarAlt` is defined correctly. See [#1472](https://github.com/gregorio-project/gregorio/issues/1472). ### Added - GregorioTeX will now look in additional places for scores using. Users can specify paths to look in using `\gresetgregpath`. If scores are not found in the current working directory or the list of provided paths, we fall back on kpse to try and find them. See [#1395](https://github.com/gregorio-project/gregorio/issues/1395). diff --git a/tex/gregoriotex-symbols.tex b/tex/gregoriotex-symbols.tex index 68db0b028..11a33845d 100644 --- a/tex/gregoriotex-symbols.tex +++ b/tex/gregoriotex-symbols.tex @@ -77,7 +77,7 @@ \gredefsizedsymbol{greABarCaptionSC}{greextra}{ABarCaptionSC} \gredefsizedsymbol{greRBarCaptionSC}{greextra}{RBarCaptionSC} \gredefsizedsymbol{greVBarCaptionSC}{greextra}{VBarCaptionSC} -\gredefsizedsymbol{greABarAlt}{greextra}{ABar.alt} +\gredefsizedsymbol{greABarAlt}{greextra}{RBar.alt} \gredefsizedsymbol{greRBarAlt}{greextra}{RBar.alt} \gredefsizedsymbol{greVBarAlt}{greextra}{VBar.alt}