diff --git a/VERSION b/VERSION index ad7e0dd67..09cf197d6 100644 --- a/VERSION +++ b/VERSION @@ -1,5 +1,5 @@ -gregoriotex_api_version = 20150220 -gregorio_version = 2.4.2 +gregoriotex_api_version = 20150311 +gregorio_version = 2.4.3 *** Do not add any lines above here. *** diff --git a/VersionUpdate.py b/VersionUpdate.py old mode 100644 new mode 100755 diff --git a/configure.ac b/configure.ac index 6ba12693a..a3197ebd8 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -AC_INIT([gregorio],[2.4.2],[gregorio-devel@gna.org]) +AC_INIT([gregorio],[2.4.3],[gregorio-devel@gna.org]) AC_PREREQ(2.59) AC_CONFIG_SRCDIR([src/gregorio-utils.c]) AC_CONFIG_AUX_DIR([build-aux]) diff --git a/fonts/greciliae.ttf b/fonts/greciliae.ttf index d7756e006..d9e2d3334 100644 Binary files a/fonts/greciliae.ttf and b/fonts/greciliae.ttf differ diff --git a/fonts/gregorio.ttf b/fonts/gregorio.ttf index de4876e00..af7a609b6 100644 Binary files a/fonts/gregorio.ttf and b/fonts/gregorio.ttf differ diff --git a/fonts/parmesan.ttf b/fonts/parmesan.ttf index dc18bc43e..431efdf0e 100644 Binary files a/fonts/parmesan.ttf and b/fonts/parmesan.ttf differ diff --git a/plugins/gregoriotex/gregoriotex.h b/plugins/gregoriotex/gregoriotex.h index 2bd269950..2b2981eb8 100644 --- a/plugins/gregoriotex/gregoriotex.h +++ b/plugins/gregoriotex/gregoriotex.h @@ -19,7 +19,7 @@ #ifndef GREGORIOTEX_H #define GREGORIOTEX_H -#define GREGORIOTEX_API_VERSION 20150220 +#define GREGORIOTEX_API_VERSION 20150311 #define NO_FUSION 0 #define FUSION 1 diff --git a/tex/gregoriotex-chars.tex b/tex/gregoriotex-chars.tex index 37bae656b..030a56f6a 100644 --- a/tex/gregoriotex-chars.tex +++ b/tex/gregoriotex-chars.tex @@ -1,153 +1,153 @@ -% bars -\xdef\gre@char@divisiomaior{172} -\xdef\gre@char@virgula{169} -\xdef\gre@char@divisiominima{170} -\xdef\gre@char@divisiominor{171} -\xdef\gre@char@divisiodominican{244} -\xdef\gre@char@divisiodominicanalt{245} +% bars% +\xdef\gre@char@divisiomaior{172}% +\xdef\gre@char@virgula{169}% +\xdef\gre@char@divisiominima{170}% +\xdef\gre@char@divisiominor{171}% +\xdef\gre@char@divisiodominican{244}% +\xdef\gre@char@divisiodominicanalt{245}% -\xdef\gre@char@punctumcavum{195} -\xdef\gre@char@lineapunctumcavum{197} -\xdef\gre@char@punctumcavumhole{238} -\xdef\gre@char@lineapunctumcavumhole{240} -\xdef\gre@char@punctumcavumalt{236} -\xdef\gre@char@lineapunctumcavumalt{237} -\xdef\gre@char@punctumcavumholealt{239} -\xdef\gre@char@lineapunctumcavumholealt{241} +\xdef\gre@char@punctumcavum{195}% +\xdef\gre@char@lineapunctumcavum{197}% +\xdef\gre@char@punctumcavumhole{238}% +\xdef\gre@char@lineapunctumcavumhole{240}% +\xdef\gre@char@punctumcavumalt{236}% +\xdef\gre@char@lineapunctumcavumalt{237}% +\xdef\gre@char@punctumcavumholealt{239}% +\xdef\gre@char@lineapunctumcavumholealt{241}% -% notes (to compute different widths) -\xdef\gre@char@smallpunctum{174} -\xdef\gre@char@punctum{178} -\xdef\gre@char@punctuminclinatum{180} -\xdef\gre@char@stropha{181} -\xdef\gre@char@strophaaucta{182} -\xdef\gre@char@quilisma{187} -\xdef\gre@char@oriscus{188} -\xdef\gre@char@oriscusauctus{189} -\xdef\gre@char@punctuminclinatumdem{193} -\xdef\gre@char@lineapunctum{196} -\xdef\gre@char@peshigh{235} -\xdef\gre@char@pesinitauctus{2147} -\xdef\gre@char@pesinitauctusone{2146} -\xdef\gre@char@flexus{2212} -\xdef\gre@char@flexusone{2210} -\xdef\gre@char@flexusdeminutus{5411} -\xdef\gre@char@flexusaltone{5794} -\xdef\gre@char@flexusalt{5795} -\xdef\gre@char@torculus{15532} -\xdef\gre@char@torculusdeminutus{16045} -\xdef\gre@char@porrectus@one{11431} -\xdef\gre@char@porrectus@two{11432} -\xdef\gre@char@porrectus@three{11433} -\xdef\gre@char@porrectus@four{11434} -\xdef\gre@char@porrectus@five{11435} +% notes (to compute different widths)% +\xdef\gre@char@smallpunctum{174}% +\xdef\gre@char@punctum{178}% +\xdef\gre@char@punctuminclinatum{180}% +\xdef\gre@char@stropha{181}% +\xdef\gre@char@strophaaucta{182}% +\xdef\gre@char@quilisma{187}% +\xdef\gre@char@oriscus{188}% +\xdef\gre@char@oriscusauctus{189}% +\xdef\gre@char@punctuminclinatumdem{193}% +\xdef\gre@char@lineapunctum{196}% +\xdef\gre@char@peshigh{235}% +\xdef\gre@char@pesinitauctus{2147}% +\xdef\gre@char@pesinitauctusone{2146}% +\xdef\gre@char@flexus{2212}% +\xdef\gre@char@flexusone{2210}% +\xdef\gre@char@flexusdeminutus{5411}% +\xdef\gre@char@flexusaltone{5794}% +\xdef\gre@char@flexusalt{5795}% +\xdef\gre@char@torculus{15532}% +\xdef\gre@char@torculusdeminutus{16045}% +\xdef\gre@char@porrectus@one{11431}% +\xdef\gre@char@porrectus@two{11432}% +\xdef\gre@char@porrectus@three{11433}% +\xdef\gre@char@porrectus@four{11434}% +\xdef\gre@char@porrectus@five{11435}% -% signs -\xdef\gre@char@curlybrace{250} -\xdef\gre@char@barbrace{251} -\xdef\gre@char@brace{249} -\xdef\gre@char@linea{248} -\xdef\gre@char@vepisemus{194} -\xdef\gre@char@accentus{200} -\xdef\gre@char@semicirculus{199} -\xdef\gre@char@circulus{198} -\xdef\gre@char@reversedaccentus{230} -\xdef\gre@char@reversedsemicirculus{231} +% signs% +\xdef\gre@char@curlybrace{250}% +\xdef\gre@char@barbrace{251}% +\xdef\gre@char@brace{249}% +\xdef\gre@char@linea{248}% +\xdef\gre@char@vepisemus{194}% +\xdef\gre@char@accentus{200}% +\xdef\gre@char@semicirculus{199}% +\xdef\gre@char@circulus{198}% +\xdef\gre@char@reversedaccentus{230}% +\xdef\gre@char@reversedsemicirculus{231}% -% horizontal episemus -\xdef\gre@char@he@punctum{201} -\xdef\gre@char@he@flexus{202} -\xdef\gre@char@he@initio{203} -\xdef\gre@char@he@inclinatum{204} -\xdef\gre@char@he@inclinatumdem{205} -\xdef\gre@char@he@stropha{206} -\xdef\gre@char@he@porrectus@one{207} -\xdef\gre@char@he@porrectus@two{208} -\xdef\gre@char@he@porrectus@three{209} -\xdef\gre@char@he@porrectus@four{210} -\xdef\gre@char@he@porrectus@five{211} -\xdef\gre@char@he@porrectusfl@one{212} -\xdef\gre@char@he@porrectusfl@two{213} -\xdef\gre@char@he@porrectusfl@three{214} -\xdef\gre@char@he@porrectusfl@four{215} -\xdef\gre@char@he@porrectusfl@five{216} -\xdef\gre@char@he@quilisma{217} -\xdef\gre@char@he@oriscus{218} -\xdef\gre@char@he@smallpunctum{219} +% horizontal episemus% +\xdef\gre@char@he@punctum{201}% +\xdef\gre@char@he@flexus{202}% +\xdef\gre@char@he@initio{203}% +\xdef\gre@char@he@inclinatum{204}% +\xdef\gre@char@he@inclinatumdem{205}% +\xdef\gre@char@he@stropha{206}% +\xdef\gre@char@he@porrectus@one{207}% +\xdef\gre@char@he@porrectus@two{208}% +\xdef\gre@char@he@porrectus@three{209}% +\xdef\gre@char@he@porrectus@four{210}% +\xdef\gre@char@he@porrectus@five{211}% +\xdef\gre@char@he@porrectusfl@one{212}% +\xdef\gre@char@he@porrectusfl@two{213}% +\xdef\gre@char@he@porrectusfl@three{214}% +\xdef\gre@char@he@porrectusfl@four{215}% +\xdef\gre@char@he@porrectusfl@five{216}% +\xdef\gre@char@he@quilisma{217}% +\xdef\gre@char@he@oriscus{218}% +\xdef\gre@char@he@smallpunctum{219}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% macros for the different styles +%% macros for the different styles% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\greusedefaultstyle{% -\gdef\greflatchar{\gregoriofont\char 167}% -\gdef\greflatholechar{\gregoriofont\char 242}% -\gdef\grenaturalchar{\gregoriofont\char 168}% -\gdef\grenaturalholechar{\gregoriofont\char 243}% -\gdef\gresharpchar{\gregoriofont\char 246}% -\gdef\gresharpholechar{\gregoriofont\char 247}% -\gdef\grecclefchar{\gregoriofont\char 162}% -\gdef\grefclefchar{\gregoriofont\char 163}% -\gdef\greincclefchar{\gregoriofont\char 164}% -\gdef\greinfclefchar{\gregoriofont\char 165}% -\gdef\grepunctummorachar{\gregoriofont\char 175}% -\gdef\greverticalepisemuschar{\gregoriofont\char 194}% -\gdef\grecustotoplongchar{\gregoriofont\char 221}% -\gdef\grecustotopshortchar{\gregoriofont\char 222}% -\gdef\grecustotopmiddlechar{\gregoriofont\char 223}% -\gdef\grecustobottomlongchar{\gregoriofont\char 224}% -\gdef\grecustobottomshortchar{\gregoriofont\char 225}% -\gdef\grecustobottommiddlechar{\gregoriofont\char 226}% -\gdef\greabovebarbracechar{\gregoriofont\char 251}% -\gdef\grepunctumchar{\gregoriofont\char 178}% -\relax % -} +\def\greusedefaultstyle{%% +\gdef\greflatchar{\gregoriofont\char 167}%% +\gdef\greflatholechar{\gregoriofont\char 242}%% +\gdef\grenaturalchar{\gregoriofont\char 168}%% +\gdef\grenaturalholechar{\gregoriofont\char 243}%% +\gdef\gresharpchar{\gregoriofont\char 246}%% +\gdef\gresharpholechar{\gregoriofont\char 247}%% +\gdef\grecclefchar{\gregoriofont\char 162}%% +\gdef\grefclefchar{\gregoriofont\char 163}%% +\gdef\greincclefchar{\gregoriofont\char 164}%% +\gdef\greinfclefchar{\gregoriofont\char 165}%% +\gdef\grepunctummorachar{\gregoriofont\char 175}%% +\gdef\greverticalepisemuschar{\gregoriofont\char 194}%% +\gdef\grecustotoplongchar{\gregoriofont\char 221}%% +\gdef\grecustotopshortchar{\gregoriofont\char 222}%% +\gdef\grecustotopmiddlechar{\gregoriofont\char 223}%% +\gdef\grecustobottomlongchar{\gregoriofont\char 224}%% +\gdef\grecustobottomshortchar{\gregoriofont\char 225}%% +\gdef\grecustobottommiddlechar{\gregoriofont\char 226}%% +\gdef\greabovebarbracechar{\gregoriofont\char 251}%% +\gdef\grepunctumchar{\gregoriofont\char 178}%% +\relax %% +}% -\def\greusemedicaeastyle{% -\greusestylecommon % -\gdef\grecustotoplongchar{\gregoriostylefont\char 169}% -\gdef\grecustotopshortchar{\gregoriostylefont\char 168}% -\gdef\grecustotopmiddlechar{\gregoriostylefont\char 170}% -\gdef\grecustobottomlongchar{\gregoriostylefont\char 172}% -\gdef\grecustobottomshortchar{\gregoriostylefont\char 171}% -\gdef\grecustobottommiddlechar{\gregoriostylefont\char 173}% -\gdef\grecclefchar{\gregoriostylefont\char 182}% -\gdef\grefclefchar{\gregoriostylefont\char 184}% -\gdef\greincclefchar{\gregoriostylefont\char 183}% -\gdef\greinfclefchar{\gregoriostylefont\char 185}% -\gdef\greflatchar{\gregoriostylefont\char 161}% -\gdef\greflatholechar{\gregoriostylefont\char 194}% -\relax % -} +\def\greusemedicaeastyle{%% +\greusestylecommon %% +\gdef\grecustotoplongchar{\gregoriostylefont\char 169}%% +\gdef\grecustotopshortchar{\gregoriostylefont\char 168}%% +\gdef\grecustotopmiddlechar{\gregoriostylefont\char 170}%% +\gdef\grecustobottomlongchar{\gregoriostylefont\char 172}%% +\gdef\grecustobottomshortchar{\gregoriostylefont\char 171}%% +\gdef\grecustobottommiddlechar{\gregoriostylefont\char 173}%% +\gdef\grecclefchar{\gregoriostylefont\char 182}%% +\gdef\grefclefchar{\gregoriostylefont\char 184}%% +\gdef\greincclefchar{\gregoriostylefont\char 183}%% +\gdef\greinfclefchar{\gregoriostylefont\char 185}%% +\gdef\greflatchar{\gregoriostylefont\char 161}%% +\gdef\greflatholechar{\gregoriostylefont\char 194}%% +\relax %% +}% -\def\greusehufnagelstyle{% -\greusestylecommon % -\gdef\grecustotoplongchar{\gregoriostylefont\char 163}% -\gdef\grecustotopshortchar{\gregoriostylefont\char 162}% -\gdef\grecustotopmiddlechar{\gregoriostylefont\char 164}% -\gdef\grecustobottomlongchar{\gregoriostylefont\char 166}% -\gdef\grecustobottomshortchar{\gregoriostylefont\char 165}% -\gdef\grecustobottommiddlechar{\gregoriostylefont\char 167}% -\gdef\grecclefchar{\gregoriostylefont\char 186}% -\gdef\grefclefchar{\gregoriostylefont\char 187}% -\gdef\greincclefchar{\gregoriostylefont\char 188}% -\gdef\greinfclefchar{\gregoriostylefont\char 189}% -\gdef\greflatchar{\gregoriostylefont\char 181}% -\gdef\greflatholechar{\gregoriostylefont\char 193}% -\relax % -} +\def\greusehufnagelstyle{%% +\greusestylecommon %% +\gdef\grecustotoplongchar{\gregoriostylefont\char 163}%% +\gdef\grecustotopshortchar{\gregoriostylefont\char 162}%% +\gdef\grecustotopmiddlechar{\gregoriostylefont\char 164}%% +\gdef\grecustobottomlongchar{\gregoriostylefont\char 166}%% +\gdef\grecustobottomshortchar{\gregoriostylefont\char 165}%% +\gdef\grecustobottommiddlechar{\gregoriostylefont\char 167}%% +\gdef\grecclefchar{\gregoriostylefont\char 186}%% +\gdef\grefclefchar{\gregoriostylefont\char 187}%% +\gdef\greincclefchar{\gregoriostylefont\char 188}%% +\gdef\greinfclefchar{\gregoriostylefont\char 189}%% +\gdef\greflatchar{\gregoriostylefont\char 181}%% +\gdef\greflatholechar{\gregoriostylefont\char 193}%% +\relax %% +}% -\def\greusemensuralstyle{% -\greusestylecommon % -\gdef\grecustotoplongchar{\gregoriostylefont\char 175}% -\gdef\grecustotopshortchar{\gregoriostylefont\char 174}% -\gdef\grecustotopmiddlechar{\gregoriostylefont\char 176}% -\gdef\grecustobottomlongchar{\gregoriostylefont\char 178}% -\gdef\grecustobottomshortchar{\gregoriostylefont\char 177}% -\gdef\grecustobottommiddlechar{\gregoriostylefont\char 179}% -\gdef\greflatchar{\gregoriostylefont\char 180}% -\gdef\greflatholechar{\gregoriostylefont\char 192}% -\relax % -} +\def\greusemensuralstyle{%% +\greusestylecommon %% +\gdef\grecustotoplongchar{\gregoriostylefont\char 175}%% +\gdef\grecustotopshortchar{\gregoriostylefont\char 174}%% +\gdef\grecustotopmiddlechar{\gregoriostylefont\char 176}%% +\gdef\grecustobottomlongchar{\gregoriostylefont\char 178}%% +\gdef\grecustobottomshortchar{\gregoriostylefont\char 177}%% +\gdef\grecustobottommiddlechar{\gregoriostylefont\char 179}%% +\gdef\greflatchar{\gregoriostylefont\char 180}%% +\gdef\greflatholechar{\gregoriostylefont\char 192}%% +\relax %% +}% diff --git a/tex/gregoriotex-signs.tex b/tex/gregoriotex-signs.tex index b224968f8..0ac093f7b 100644 --- a/tex/gregoriotex-signs.tex +++ b/tex/gregoriotex-signs.tex @@ -18,16 +18,16 @@ % this file contains definitions of signs (bar, episemus, punctum, alterations) \gredeclarefileversion{gregoriotex-signs.tex}% - {\directlua{tex.write(gregoriotex.get_greapiversion())}} + {\directlua{tex.write(gregoriotex.get_greapiversion())}}% \def\greusestylecommon{% \ifnum\greusestylefont=0\relax % \xdef\greusestylefont{1}% \gresetstylefont % \relax % -} +}% -\greusedefaultstyle +\greusedefaultstyle% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for discretionaries @@ -42,12 +42,12 @@ % To remedy that, we define \grehskip to be \hskip outside a discretionary, and % \kern inside a discretionary. This is what these macros do: -\def\grefalsepenalty#1{} -\def\gretruepenalty#1{\penalty#1} +\def\grefalsepenalty#1{}% +\def\gretruepenalty#1{\penalty#1}% -\let\grehskip\hskip -\let\grepenalty\gretruepenalty -\xdef\greinsidediscretionary{\number 0} +\let\grehskip\hskip% +\let\grepenalty\gretruepenalty% +\xdef\greinsidediscretionary{\number 0}% \def\grediscretionary#1#2{% \global\let\grehskip\kern % @@ -56,7 +56,8 @@ \discretionary{% \global\grelastoflinecount=1\relax % (a good magic trick) #1% - \kern\grekernbeforeeol\relax % + \gre@temp = \grekernbeforeeol\relax% + \kern\gre@temp % }{% \global\grelastoflinecount=2\relax % (a good magic trick) }{% @@ -66,25 +67,25 @@ \global\let\grehskip\hskip % \global\let\grepenalty\gretruepenalty % \relax % -} +}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of the clefs of the beginning of lines and custos %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % if this macro is set to 1, it simply removes the key -\xdef\greremoveclefcount{0} +\xdef\greremoveclefcount{0}% \def\greremoveclef{% \xdef\greremoveclefcount{1}% -} +}% \def\grenormalclef{% \xdef\greremoveclefcount{0}% -} +}% % a count describing the clef line and pitch : 1 for c on the first (bottom) line, 2 for c on the second line, 5 for f on the first, etc. -\newcount\greclefnum +\newcount\greclefnum% %% marcro to define the clef that will appear at the beginning of the lines % the first argument is the type : f or c, and the second is the height @@ -92,18 +93,21 @@ % if the fourth argument is a, it means that we must not put a flat after the key, otherwise it's the height of the flat \def\gresetlinesclef#1#2#3#4{% \grelocalleftbox{% - \kern\gre@additionalleftspace % + \gre@temp = \gre@additionalleftspace% + \kern\gre@temp % \copy\GreLines% draws the lines \unkern % \ifnum\greremoveclefcount=0\relax % - \hbox{\gretypekey{#1}{#2}{0}{#3}{#4}\hskip\gre@afterclefnospace}% + \gre@temp = \gre@afterclefnospace% + \hbox{\gretypekey{#1}{#2}{0}{#3}{#4}\hskip\gre@temp}% \else % - \hbox{\kern\gre@noclefspace}% + \gre@temp = \gre@noclefspace% + \hbox{\kern\gre@temp}% \fi % }% \xdef\greclefflat{#4}% \relax% -} +}% %% macro calculating the \greclefnum from the letter and number % #1 is the letter, and #2 the line number, #3 is a if not flated @@ -114,12 +118,11 @@ \global\advance\greclefnum by 4\relax % \fi % \relax % -} +}% %% macro redrawing a key from clefnum, useful for vertical space changes \def\greupdatelinesclef{% \ifnum\greclefnum > 5\relax% - \newcount\gretempdimcount \gretempdimcount=\greclefnum % \advance\gretempdimcount by -4\relax % \gresetlinesclef{f}{\gretempdimcount}{1}{\greclefflat}% @@ -127,7 +130,7 @@ \gresetlinesclef{c}{\greclefnum}{1}{\greclefflat}% \fi % \relax % -} +}% % macro that typesets the key % arguments are : @@ -147,38 +150,37 @@ \or% \gre@calculate@glyphraisevalue{i}{0}% \fi% - \newskip\gre@tempdimskip \gre@tempdimskip=\gre@spaceafterlineclef % \ifnum#4=0\relax % - \newskip\gre@tempdimskip \gre@tempdimskip=\gre@afterclefnospace % \fi % \ifx c#1% we check if it is a c key \ifcase#3% - \raise\gre@glyphraisevalue\hbox{\grecclefchar}%\hskip\gre@tempdimskip}% + \raise\gre@glyphraisevalue\hbox{\grecclefchar}%\hskip\gre@tempdimskip} \setbox\GreTempwidth=\hbox{\grecclefchar}% \global\gre@clefwidth=\wd\GreTempwidth % \or% - \raise\gre@glyphraisevalue\hbox{\greincclefchar}%\hskip\gre@tempdimskip}% + \raise\gre@glyphraisevalue\hbox{\greincclefchar}%\hskip\gre@tempdimskip} \fi% \else % we consider that it is a f key \ifcase#3% - \raise\gre@glyphraisevalue\hbox{\grefclefchar}%\hskip\gre@tempdimskip}% + \raise\gre@glyphraisevalue\hbox{\grefclefchar}%\hskip\gre@tempdimskip} \setbox\GreTempwidth=\hbox{\grefclefchar}% \global\gre@clefwidth=\wd\GreTempwidth % \or% - \raise\gre@glyphraisevalue\hbox{\greinfclefchar}%\hskip\gre@tempdimskip}% + \raise\gre@glyphraisevalue\hbox{\greinfclefchar}%\hskip\gre@tempdimskip} \fi% \fi% \if a#5% \grehskip\gre@tempdimskip % \else % - \grehskip\gre@clefflatspace % + \gre@temp = \gre@clefflatspace% + \grehskip\gre@temp % \greflat{#5}{1}% \grehskip\gre@tempdimskip % \fi % \relax % -} +}% % macro that writes the initial key, and sets the next keys to the same value % if #3 is a, it means that we must not put a flat after the key, otherwise it's the height @@ -199,7 +201,7 @@ \greadjustsecondline % \fi % \relax% -} +}% % macro called when the key changes % #1 and #2 are the type and line of the clef @@ -214,15 +216,18 @@ \gresetlinesclef{#1}{#2}{1}{#4}% \fi % \ifnum#3=1\relax % - \grehskip\gre@clefchangespace % + \gre@temp = \gre@clefchangespace% + \grehskip\gre@temp % \else % % here it means that there is a bar before the clef, so we skip the difference between the normal space and the space around bars with clef changes - \grehskip -\gre@spacearoundclefbars % + \gre@temp = -\gre@spacearoundclefbars% + \grehskip\gre@temp % \fi % \gretypekey{#1}{#2}{1}{0}{#4}% - \grehskip\gre@clefchangespace % + \gre@temp = \gre@clefchangespace% + \grehskip\gre@temp % \relax% -} +}% % macro called when the key changes inside a syllable @@ -235,18 +240,18 @@ \ifnum\greinsidediscretionary=0\relax % \gresetlinesclef{#1}{#2}{0}{#3}% \fi % - \hskip\gre@clefchangespace % + \gre@temp = \gre@clefchangespace% + \hskip\gre@temp % \gretypekey{#1}{#2}{1}{0}{#3}% - \hskip\gre@clefchangespace % + \hskip\gre@temp % \relax% -} +}% % custo just typesets a custo, useful for before the key changes for example \def\grecusto#1{% \gre@calculate@glyphraisevalue{#1}{0}% %here we need some tricks to draw the line before the custo (for the color) \setbox\GreTempwidth=\hbox{\grecustochar#1}% - \newskip\gre@tempwidth \gre@tempwidth=\wd\GreTempwidth % \ifnum\greremovelinescount=0\relax % \ifx l#1% @@ -267,10 +272,11 @@ % for now we consider we always have a bar after the custo % we don't want to end the line here \grenobreak % - \grehskip -\gre@spacearoundclefbars % + \gre@temp = -\gre@spacearoundclefbars% + \grehskip\gre@temp % \grenobreak % \relax % -} +}% % the argument is the height \def\gresetcusto#1{% @@ -280,10 +286,10 @@ %here we need some tricks to draw the line before the custo (for the color) \setbox\GreTempwidth=\hbox{% % we type a hskip and the we type the custo - \hskip\gre@spacebeforecusto % + \gre@temp = \gre@spacebeforecusto% + \hskip\gre@temp % \grecustochar#1\relax % }% - \newskip\gre@tempwidth \gre@tempwidth=\wd\GreTempwidth % % we make \wd\GreTempsign contain the width of a custo \setbox\GreTempsign=\hbox{% @@ -310,16 +316,16 @@ \fi % \fi % \relax% -} +}% \def\gremanualcusto#1{% - \kern\gre@spacebeforecusto\grecusto{#1}% -} + \gre@temp = \gre@spacebeforecusto% + \kern\gre@temp\grecusto{#1}% +}% % macro that typesets an additional line at the top for custos at end of line \def\greadditionaltopcustolineend{% - \newskip\gre@tempdim \gre@tempdim=\gre@staffheight % \advance\gre@tempdim by \gre@spacebeneathtext % \advance\gre@tempdim by \gre@spacelinestext % @@ -330,18 +336,16 @@ \hbox to 0pt{% \greadditionalstafflinesformat % \kern\gre@tempwidth % - \newskip\gre@tempdim \gre@tempdim=\wd\GreTempsign % \advance\gre@tempdim by \gre@additionalcustoslineswidth % - \kern -\gre@tempdim % + \kern-\gre@tempdim % \vrule width \gre@tempdim height \gre@stafflineheight% \hss % }% \relax % -} +}% \def\greadditionalbottomcustolineend{% - \newskip\gre@tempdim \gre@tempdim=\gre@spacebeneathtext % \advance\gre@tempdim by \gre@spacelinestext % \advance\gre@tempdim by \gre@additionalbottomspace % @@ -352,20 +356,18 @@ \hbox to 0pt{% \greadditionalstafflinesformat % \kern\gre@tempwidth % - \newskip\gre@tempdim \gre@tempdim=\wd\GreTempsign % \advance\gre@tempdim by \gre@additionalcustoslineswidth % - \kern -\gre@tempdim % + \kern-\gre@tempdim % \vrule width \gre@tempdim height \gre@stafflineheight% \hss % }% \relax % -} +}% % same macros, but for a custo in the middle \def\greadditionaltopcustolinemiddle{% - \newskip\gre@tempdim \gre@tempdim=\gre@staffheight % \advance\gre@tempdim by \gre@spacebeneathtext % \advance\gre@tempdim by \gre@spacelinestext % @@ -377,7 +379,6 @@ \greadditionalstafflinesformat % \hss % \kern\gre@tempwidth % - \newskip\gre@tempdim \gre@tempdim=\gre@additionalcustoslineswidth % \multiply\gre@tempdim by 2% \advance\gre@tempdim by \wd\GreTempsign % @@ -385,10 +386,9 @@ \hss % }% \relax % -} +}% \def\greadditionalbottomcustolinemiddle{% - \newskip\gre@tempdim \gre@tempdim=\gre@spacebeneathtext % \advance\gre@tempdim by \gre@spacelinestext % \advance\gre@tempdim by \gre@additionalbottomspace % @@ -400,7 +400,6 @@ \greadditionalstafflinesformat % \hss % \kern\gre@tempwidth % - \newskip\gre@tempdim \gre@tempdim=\gre@additionalcustoslineswidth % \multiply\gre@tempdim by 2% \advance\gre@tempdim by \wd\GreTempsign % @@ -408,7 +407,7 @@ \hss % }% \relax % -} +}% \def\grecustochar#1{% \ifx a#1% @@ -450,22 +449,22 @@ \ifx m#1% \grecustobottommiddlechar % \fi% -} +}% \def\removecusto{% \grelocalrightbox{}% \relax% -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of braces and other things above the score -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\gdef\grecurlybracechar{\gregoriofont\char \gre@char@curlybrace} -\gdef\grebracechar{\gregoriofont\char \gre@char@brace} +\gdef\grecurlybracechar{\gregoriofont\char \gre@char@curlybrace}% +\gdef\grebracechar{\gregoriofont\char \gre@char@brace}% % the command to resize a box, \resizebox is provided by graphicx -\global\let\greresizebox\resizebox +\global\let\greresizebox\resizebox % % #1: the width % #2: 1 if we put an accentus above or not @@ -475,15 +474,15 @@ \def\greovercurlybrace#1#2#3#4#5{% \ifnum#5=1\relax % \setbox\GreTempsign=\hbox{\grepunctumchar}% - \newskip\gre@tempdim \gre@tempdim=\wd\GreTempsign % - \kern -\gre@tempdim % + \kern-\gre@tempdim % \fi % \gre@calculate@glyphraisevalue{g}{13}% \advance\gre@glyphraisevalue by #3\relax % \setbox\GreTempsign=\hbox{\grecurlybracechar}% \hbox to 0pt{% - \kern #4\relax % + \gre@temp = #4\relax% + \kern\gre@temp % \raise\gre@glyphraisevalue\hbox{% \greresizebox{#1}{\ht\GreTempsign}{\grecurlybracechar}% }% @@ -498,10 +497,10 @@ \fi % }% \ifnum#5=1\relax % - \kern \gre@tempdim % + \kern\gre@tempdim % \fi % \relax % -} +}% % #1: the width % #2: a vertical shift @@ -510,27 +509,27 @@ \def\greoverbrace#1#2#3#4{% \ifnum#4=1\relax % \setbox\GreTempsign=\hbox{\grepunctumchar}% - \newskip\gre@tempdim \gre@tempdim=\wd\GreTempsign % - \kern -\gre@tempdim % + \kern-\gre@tempdim % \fi % \gre@calculate@glyphraisevalue{g}{13}% \setbox\GreTempsign=\hbox{\grebracechar}% \advance\gre@glyphraisevalue by #2\relax % \raise\gre@glyphraisevalue\hbox to 0pt{% - \kern #3\relax % + \gre@temp = #3\relax% + \kern \gre@temp % \greresizebox{#1}{\ht\GreTempsign}{\grebracechar}% \hss % }% \ifnum#4=1\relax % - \kern \gre@tempdim % + \kern\gre@tempdim % \fi % \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of punctum mora, auctum duplex and choral signs -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % a function to typeset a punctum mora, the first argument is the letter of the height of the punctum mora % if the second argument is one, we the go back to the end of the punctum @@ -541,24 +540,26 @@ \def\grepunctummora#1#2#3#4{% \grenobreak % \ifcase#2\relax % - \hskip\gre@spacebeforesigns% + \gre@temp = \gre@spacebeforesigns% + \hskip\gre@temp% \or % - \kern\gre@spacebeforesigns % + \gre@temp = \gre@spacebeforesigns% + \kern\gre@temp % \or % % to get the widht of a punctum minus a line, we calculate the width of a flexus (with ambitus of two) minus the width of a punctum \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@flexus}% - \newskip\gre@tempdim \gre@tempdim=\wd\GreTempwidth % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@punctum}% \advance\gre@tempdim by -\wd\GreTempwidth % - \kern -\gre@tempdim % - \kern \gre@spacebeforesigns % + \kern-\gre@tempdim % + \gre@temp = \gre@spacebeforesigns% + \kern\gre@temp % \or % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@punctum}% - \newskip\gre@tempdim \gre@tempdim=\wd\GreTempwidth % - \kern -\gre@tempdim % - \kern \gre@spacebeforesigns % + \kern-\gre@tempdim % + \gre@temp = \gre@spacebeforesigns% + \kern\gre@temp % \fi % \ifnum#2=1\else % \xdef\grelastispunctum{1}% @@ -571,16 +572,13 @@ % here we shift a bit left in the case where we have a punctum inclinatum on a line \ifnum#4=1\relax % \ifnum\greisonaline=1\relax % - \newskip\gre@tempwidth \gre@tempwidth=3700sp% \multiply\gre@tempwidth by \the\grefactor % - \kern -\gre@tempwidth % - \newskip\gre@tempwidth + \kern-\gre@tempwidth % \gre@tempwidth =4500sp% \multiply\gre@tempwidth by \the\grefactor % \advance\gre@glyphraisevalue by -\gre@tempwidth % \else % - \newskip\gre@tempwidth \gre@tempwidth =2500sp% \multiply\gre@tempwidth by \the\grefactor % \advance\gre@glyphraisevalue by -\gre@tempwidth % @@ -591,38 +589,45 @@ \grenobreak % \ifcase#2\relax\or % \setbox\GreTempwidth=\hbox{\grepunctummorachar}% - \kern -\wd\GreTempwidth % - \kern -\gre@spacebeforesigns % + \gre@temp = -\wd\GreTempwidth % + \kern\gre@temp% + \gre@temp = -\gre@spacebeforesigns% + \kern\gre@temp % \or % \setbox\GreTempwidth=\hbox{\grepunctummorachar}% - \kern -\wd\GreTempwidth % - \kern -\gre@spacebeforesigns % - \kern \gre@tempdim % + \gre@temp = -\wd\GreTempwidth % + \kern\gre@temp% + \gre@temp = -\gre@spacebeforesigns% + \kern\gre@temp % + \kern\gre@tempdim % \or % \setbox\GreTempwidth=\hbox{\grepunctummorachar}% - \kern -\wd\GreTempwidth % - \kern -\gre@spacebeforesigns % - \kern \gre@tempdim % + \gre@temp = -\wd\GreTempwidth % + \kern\gre@temp% + \gre@temp = -\gre@spacebeforesigns% + \kern\gre@temp % + \kern\gre@tempdim % \fi % \grenobreak % \relax% -} +}% % a function to typeset an augmentum duplex, easy enough to be understood... \def\greaugmentumduplex#1#2#3{% \grepunctummora{#1}{1}{#3}{0}% \grepunctummora{#2}{0}{0}{0}% \relax % -} +}% -\gdef\grelowchoralsignstyle#1{#1} -\gdef\grehighchoralsignstyle#1{#1} +\gdef\grelowchoralsignstyle#1{#1}% +\gdef\grehighchoralsignstyle#1{#1}% % quite simple function: #1 is the height, #2 is the string, #3 is #2 of punctum mora, #4 is #3 of punctum mora % #3 is 1 if it must be a bit higher \def\grelowchoralsign#1#2#3{% \grenobreak % - \hskip\gre@beforechoralsignspace % + \gre@temp = \gre@beforechoralsignspace% + \hskip\gre@temp % \grenobreak % \ifnum#3=1\relax % \gre@calculate@glyphraisevalue{#1}{12}% @@ -631,29 +636,29 @@ \fi % \raise\gre@glyphraisevalue\hbox{\grelowchoralsignstyle{#2}}% \relax % -} +}% \def\grehighchoralsign#1#2#3{% \grenobreak % \grevepisemusorrare{#1}{#3}{4}{3}{\grehighchoralsignstyle{#2}}% - %\grehepisorline{#1}{#3}{0}{4}{\grehighchoralsignstyle{#2}}% + %\grehepisorline{#1}{#3}{0}{4}{\grehighchoralsignstyle{#2}} \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of linea -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\grelinea#1#2#3{% \greglyph{\char \gre@char@linea}{#1}{#2}{#3}{}{}% \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of vertical episemus -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newbox\GreTempsign +\newbox\GreTempsign% % a macro to help typesetting vertical episemus. The third argument is 0 when we go back to the beginning of the glyph. If it is 2, it means that we must go back first of width #1, and then forward of #2. If it is 1, it means that we only need to go back of #2. if it is 3, we go to the beginning of the glyph, then forward of #1 then back of #2 % #4 is a shift that we want to get applied, useful for punctum inclinatum for example @@ -662,21 +667,17 @@ % #7 is the choral sign if relevant \def\grevepisemusorrareaux#1#2#3#4#5#6#7{% % first we set \gre@tempwidth to the width of the last glyph - \newskip\gre@tempwidth \gre@tempwidth=\gre@lastglyphwidth % \setbox\GreTempsign=\hbox{\gregoriofont #2}% - \newskip\gre@tempdimsignwidth \gre@tempdimsignwidth=\wd\GreTempsign % \divide\gre@tempdimsignwidth by 2\relax % \ifcase#3% % tempwidth is the width of the last glyph \advance\gre@tempwidth by -\gre@tempdimsignwidth % \or% - \newskip\gre@tempwidth \gre@tempwidth=\gre@tempdimsignwidth % \or% \setbox\GreTempsign=\hbox{\gregoriofont #1}% - \newskip\gre@tempwidth \gre@tempwidth=\wd\GreTempsign % \advance\gre@tempwidth by -\gre@tempdimsignwidth % \or % @@ -701,20 +702,20 @@ \setbox\GreTempsign=\hbox{\greabovebarbracechar}% \fi % % we set tempwidth to half a punctum malus half the sign width, so that the centers are aligned - \newskip\gre@tempdimsignwidth \gre@tempdimsignwidth=\wd\GreTempsign % \divide\gre@tempdimsignwidth by 2 % \advance\gre@tempwidth by \gre@tempdimsignwidth % - \kern -\gre@tempdimsignwidth% - \kern #4sp% + \kern-\gre@tempdimsignwidth% + \gre@temp = #4sp% + \kern \gre@temp% \raise \gre@glyphraisevalue \copy\GreTempsign % - \kern -#4sp% + \kern -\gre@temp% % and finally we go back to the end of the glyph, where we were first \advance\gre@tempwidth by -2\gre@tempdimsignwidth % \fi % - \kern \gre@tempwidth% + \kern\gre@tempwidth% \relax% -} +}% % here are the common values for both hepisemus (and consequently also for additional lines) and vepisemus % this indicates the note @@ -727,7 +728,7 @@ %% 6: the first note, if it is a standard punctum %% 7: the first note, if it is an initio debilis %% 8: the first note, if it is a porrectus -%%% the three next arguments make no sense for a vepisemus +%%%%%% the three next arguments make no sense for a vepisemus %% 9: the two first notes, if it is a porrectus %% 10: the two first notes, if it is a porrectus flexus %% 11: the notes two and three of a torculus resupinus @@ -850,7 +851,7 @@ % 5634 is a flexus without bar with ambitus of 2 \grevepisemusorrareaux{\char \gre@char@flexusalt}{\char \gre@char@punctum}{3}{0}{#3}{#4}{#5}% \or% - %case 22 % + %case 22 % 5633 is a flexus without bar with ambitus of 1 \grevepisemusorrareaux{\char \gre@char@flexusaltone}{\char \gre@char@punctum}{3}{0}{#3}{#4}{#5}% \or% @@ -870,82 +871,82 @@ \grevepisemusorrareaux{0}{\gredivisiofinalissymbol}{1}{0}{#3}{#4}{#5}% \fi% \relax% -} +}% \def\grevepisemus#1#2{% \grevepisemusorrare{#1}{#2}{\gre@char@vepisemus}{1}{}% \relax % -} +}% \def\grebarbrace#1{% \grevepisemusorrare{g}{#1}{\gre@char@barbrace}{4}{}% \relax % -} +}% \def\grebarvepisemus#1{% \grevepisemusorrare{c}{#1}{\gre@char@vepisemus}{1}{}% \relax % -} +}% \def\greictusa#1{% \grevepisemusorrare{a}{#1}{1}{2}{}% \relax % -} +}% \def\greictust#1{% \grevepisemusorrare{a}{#1}{2}{2}{}% \relax % -} +}% % maybe these four should be optimized \def\grevepisemusictusa#1#2{% \grevepisemusorrare{#1}{#2}{\gre@char@vepisemus}{1}{}% \greictusa{#2}% \relax % -} +}% \def\grebarvepisemusictusa#1{% \grevepisemusorrare{c}{#1}{\gre@char@vepisemus}{1}{}% \greictusa{#1}% \relax % -} +}% \def\grevepisemusictust#1#2{% \grevepisemusorrare{#1}{#2}{\gre@char@vepisemus}{1}{}% \greictust{#2}% \relax % -} +}% \def\grebarvepisemusictust#1{% \grevepisemusorrare{c}{#1}{\gre@char@vepisemus}{1}{}% \greictust{#1}% \relax % -} +}% \def\greaccentus#1#2{% \grevepisemusorrare{#1}{#2}{\gre@char@accentus}{2}{}% \relax % -} +}% \def\gresemicirculus#1#2{% \grevepisemusorrare{#1}{#2}{\gre@char@semicirculus}{2}{}% \relax % -} +}% \def\grecirculus#1#2{% \grevepisemusorrare{#1}{#2}{\gre@char@circulus}{2}{}% \relax % -} +}% \def\grereversedaccentus#1#2{% \grevepisemusorrare{#1}{#2}{\gre@char@reversedaccentus}{2}{}% \relax % -} +}% \def\grereversedsemicirculus#1#2{% \grevepisemusorrare{#1}{#2}{\gre@char@reversedsemicirculus}{2}{}% \relax % -} +}% %% the macros to save the absolute positions of ictus a and t in the aux file @@ -962,11 +963,11 @@ \hbox to 0pt{}% \gregorioattr=0\relax % \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting horizontal episemus -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % a macro that will help in the typesetting of a horizontal episemus and additional lines, the first argument is a glyph that have the same width as the width between the end of the glyph and the beginning of the episemus, and the second argument is the character of the episemus. If the third argument is 0, we go directly to the beginning of the glyph, else we don't change anything @@ -975,24 +976,20 @@ \def\grehepisorlineaux#1#2#3#4{% \ifnum#3=0% % first we set \gre@tempwidth to the width of the last glyph - \newskip\gre@tempwidth \gre@tempwidth=\gre@lastglyphwidth % \else% \setbox\GreTempsign=\hbox{\gregoriofont #1}% - \newskip\gre@tempwidth \gre@tempwidth=\wd\GreTempsign% \fi% - \kern -\gre@tempwidth % + \kern-\gre@tempwidth % % then we draw the sign, and go back to the beginning of the sign \setbox\GreTempsign=\hbox{\gregoriofont\char #2}% % we set tempwidth to half a punctum malus half the sign width, so that the centers are aligned - \newskip\gre@tempdimsignwidth \gre@tempdimsignwidth=\wd\GreTempsign % \ifnum#4<2\relax % case of the lines \else % - \newskip\gre@tempdim \gre@tempdim=\gre@additionallineswidth % - \kern -\gre@tempdim % + \kern-\gre@tempdim % \advance\gre@tempdimsignwidth by 2\gre@tempdim % \fi % \ifcase#4% @@ -1009,7 +1006,7 @@ \advance\gre@glyphraisevalue by 4\gre@interstafflinespace % \advance\gre@glyphraisevalue by 4\gre@stafflineheight % \raise\gre@glyphraisevalue\hbox{\vrule height \gre@stafflineheight width \gre@tempdimsignwidth}% - \kern \gre@tempdim % + \kern\gre@tempdim % \or % case of a line at the bottom \gre@glyphraisevalue=\gre@additionalbottomspace % \advance\gre@glyphraisevalue by \gre@spacebeneathtext % @@ -1018,7 +1015,7 @@ \advance\gre@glyphraisevalue by -\gre@interstafflinespace % \advance\gre@glyphraisevalue by -\gre@stafflineheight % \raise\gre@glyphraisevalue\hbox{\vrule height \gre@stafflineheight width \gre@tempdimsignwidth}% - \kern \gre@tempdim % + \kern\gre@tempdim % \or % %case of choral sign \raise \gre@glyphraisevalue \copy\GreTempsign % @@ -1026,9 +1023,9 @@ \fi % % and finally we go back to the end of the glyph, where we were first \advance\gre@tempwidth by -\gre@tempdimsignwidth % - \kern \gre@tempwidth % + \kern\gre@tempwidth % \relax% -} +}% % a function to typeset a horizontal line (additional line or episemus). The firts argument is the letter of the height of the episemus (not the height of the note it corresponds to. This function must be called after a call to \greglyph. %The second argument is the type of glyph it was, more precisely the kind of space there is between the end (or in special cases the beginning) of the glyph and the place where we will typeset the episemus. The possible values are the common ones @@ -1195,7 +1192,7 @@ \grehepisorlineaux{\char \gre@char@pesinitauctusone}{\gre@char@he@punctum}{1}{#4}%the episemus is not quite long enough so I assumed a different width for now... \fi% \relax% -} +}% % dumb top function % #4 is a trick for bridges: if we must use a different height because of a bridge, it's #4, otherwise #4=#1 @@ -1206,25 +1203,25 @@ \grehepisorline{#1}{#2}{#3}{0}% \fi % \relax % -} +}% % same but for episema at the bottom of a note \def\grehepisemusbottom#1#2#3{% \grehepisorline{#1}{#2}{#3}{1}% \relax % -} +}% \def\AddHEpisemusBridges{% \xdef\greaddhepisemusbridges{1}% \relax % -} +}% \def\RemoveHEpisemusBridges{% \xdef\greaddhepisemusbridges{0}% \relax % -} +}% -\AddHEpisemusBridges +\AddHEpisemusBridges% % same but for a "bridge episemus" after the last note of a glyph (element, syllable) if the next episemus is at the same height \def\grehepisemusbridge#1#2#3{% @@ -1233,7 +1230,7 @@ \raise\gre@glyphraisevalue\hbox to 0pt{\gregoriofont\char \gre@char@he@punctum\hss}% \fi % \relax % -} +}% % another dumb top function \def\greadditionalline#1#2#3{% @@ -1245,54 +1242,54 @@ \gre@glyphraisevalue=\gresavedglyphraise % \fi % \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of bars -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % we define two types of macro for each four bar : when it is inside a syllable, and when it is not \def\greinvirgula#1{% \grewritebar{0}{1}{#1}% \relax% -} +}% \def\grevirgula#1{% \grewritebar{0}{0}{#1}% \relax% -} +}% \def\greindivisiominima#1{% \grewritebar{1}{1}{#1}% \relax% -} +}% \def\gredivisiominima#1{% \grewritebar{1}{0}{#1}% \relax% -} +}% \def\greindivisiominor#1{% \grewritebar{2}{1}{#1}% \relax% -} +}% \def\gredivisiominor#1{% \grewritebar{2}{0}{#1}% \relax% -} +}% \def\greindivisiomaior#1{% \grewritebar{3}{1}{#1}% \relax% -} +}% \def\gredivisiomaior#1{% \grewritebar{3}{0}{#1}% \relax% -} +}% \def\gredominica#1#2{% \ifcase#1\or % @@ -1309,7 +1306,7 @@ \grewritebar{11}{0}{#2}% \fi % \relax% -} +}% \def\greindominica#1#2{% \ifcase#1\or % @@ -1326,7 +1323,7 @@ \grewritebar{11}{1}{#2}% \fi % \relax% -} +}% \def\greindivisiofinalis#1{% @@ -1336,7 +1333,7 @@ \grewritebar{5}{1}{#1}% \fi % \relax% -} +}% \def\gredivisiofinalis#1{% \ifcase\greendofscore % @@ -1345,120 +1342,139 @@ \grewritebar{5}{0}{#1}% \fi % \relax% -} +}% %a macro to write a bar %% 1: the type of the bar : 0 for virgula, 1 for minima 2 for minor, 3 for major, 4 for finalis and 5 for the last finalis %% 2: is % for now we don't use it -%%% 0 if it is outside a syllable -%%% 1 if it is in a syllable +%%%%%% 0 if it is outside a syllable +%%%%%% 1 if it is in a syllable %% 3: macros that may happen before the skip after the bar (typically grevepisemus) \def\grewritebar#1#2#3{% % first, for the bar to be really centered, if the last glyph has a punctum mora, we kern of the corresponding space (we could also have done it in the gregorio core) \ifnum\grelastispunctum=1\relax % \setbox\GreTempwidth=\hbox{\gregoriofont\grepunctummorachar}% - \kern -\wd\GreTempwidth % - \kern -\gre@spacebeforesigns % + \gre@temp = -\wd\GreTempwidth % + \kern\gre@temp% + \gre@temp = -\gre@spacebeforesigns% + \kern\gre@temp % \fi % \grenewglyphcommon % \gre@calculate@glyphraisevalue{g}{0}% bar glyphs are made to be at this height \grenobreak % \ifcase#1 % 0 : virgula \ifnum#2=1\relax % - \grehskip\gre@spacearoundsmallbar % + \gre@temp = \gre@spacearoundsmallbar% + \grehskip\gre@temp % \grenobreak % \fi % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@virgula}% \raise\gre@glyphraisevalue\hbox{\gregoriofont \char \gre@char@virgula}% #3\relax % \ifnum#2=1\relax % - \grehskip\gre@spacearoundsmallbar % + \gre@temp = \gre@spacearoundsmallbar% + \grehskip\gre@temp % \fi % \or % 1 : minima \ifnum#2=1\relax % - \grehskip\gre@spacearoundsmallbar % + \gre@temp = \gre@spacearoundsmallbar% + \grehskip\gre@temp % \grenobreak % \fi % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@divisiominima}% \raise\gre@glyphraisevalue\hbox{\gregoriofont \char \gre@char@divisiominima}% #3\relax % \ifnum#2=1\relax % - \grehskip\gre@spacearoundsmallbar % + \gre@temp = \gre@spacearoundsmallbar% + \grehskip\gre@temp % \fi % \or % 2 : minor \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \grenobreak % \fi % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@divisiominor}% \raise\gre@glyphraisevalue\hbox{\gregoriofont \char \gre@char@divisiominor}% #3\relax % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \fi % \or % 3 : maior \ifnum#2=1\relax % - \grehskip\gre@spacearoundmaior % + \gre@temp = \gre@spacearoundmaior% + \grehskip\gre@temp % \grenobreak % \fi % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@divisiomaior}% \gredivisiomaiorsymbol % #3\relax % \ifnum#2=1\relax % - \grehskip\gre@spacearoundmaior % + \gre@temp = \gre@spacearoundmaior% + \grehskip\gre@temp % \fi % \or % 4 : finalis \ifnum#2=1\relax % - \grehskip\gre@spacearoundfinalis % + \gre@temp = \gre@spacearoundfinalis% + \grehskip\gre@temp % \grenobreak % \fi % \setbox\GreTempwidth=\hbox{\gredivisiofinalissymbol}% #3\relax % \gredivisiofinalissymbol% \ifnum#2=1\relax % - \grehskip\gre@spacearoundfinalis % + \gre@temp = \gre@spacearoundfinalis% + \grehskip\gre@temp % \fi % \or % 5 : finalis \ifnum#2=1\relax % - \grehskip\gre@spacebeforefinalfinalis % + \gre@temp = \gre@spacebeforefinalfinalis% + \grehskip\gre@temp % \grenobreak % \fi % \setbox\GreTempwidth=\hbox{\gredivisiofinalissymbol}% #3\relax % \gredivisiofinalissymbol% \ifnum#2=1\relax % - \grehskip\gre@spacearoundfinalis % + \gre@temp = \gre@spacearoundfinalis% + \grehskip\gre@temp % \fi % \or % 6 : dominican bar 1 \gre@calculate@glyphraisevalue{e}{0}% % we need to adjust the height of the bar a little so that it is perfectly aligned with the bottom (or the top for some bars) of the staff line, which is not the case by default if \gre@stafflinefactor is not 10. \advance\gre@glyphraisevalue by -\gre@stafflinediff % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \grenobreak % \fi % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@divisiodominican}% \raise\gre@glyphraisevalue\hbox{\gregoriofont \char \gre@char@divisiodominican}% #3\relax % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \fi % \or % 7 : dominican bar 2 \gre@calculate@glyphraisevalue{e}{0}% \advance\gre@glyphraisevalue by \gre@stafflinediff % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \grenobreak % \fi % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@divisiodominicanalt}% \raise\gre@glyphraisevalue\hbox{\gregoriofont \char \gre@char@divisiodominicanalt}% #3\relax % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \fi % \or % 8 : dominican bar 3 \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \grenobreak % \fi % \advance\gre@glyphraisevalue by -\gre@stafflinediff % @@ -1466,11 +1482,13 @@ \raise\gre@glyphraisevalue\hbox{\gregoriofont \char \gre@char@divisiodominican}% #3\relax % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \fi % \or % 9 : dominican bar 4 \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \grenobreak % \fi % \advance\gre@glyphraisevalue by \gre@stafflinediff % @@ -1478,38 +1496,43 @@ \raise\gre@glyphraisevalue\hbox{\gregoriofont \char \gre@char@divisiodominicanalt}% #3\relax % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \fi % \or % 10 : dominican bar 5 \gre@calculate@glyphraisevalue{i}{0}% \advance\gre@glyphraisevalue by -\gre@stafflinediff % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \grenobreak % \fi % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@divisiodominican}% \raise\gre@glyphraisevalue\hbox{\gregoriofont \char \gre@char@divisiodominican}% #3\relax % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \fi % \or % 11 : dominican bar 6 \gre@calculate@glyphraisevalue{i}{0}% \advance\gre@glyphraisevalue by \gre@stafflinediff % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \grenobreak % \fi % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@divisiodominicanalt}% \raise\gre@glyphraisevalue\hbox{\gregoriofont \char \gre@char@divisiodominicanalt}% #3\relax % \ifnum#2=1\relax % - \grehskip\gre@spacearoundminor % + \gre@temp = \gre@spacearoundminor% + \grehskip\gre@temp % \fi % \fi % \global\gre@lastglyphwidth=\wd\GreTempwidth % \relax% -} +}% \def\gredivisiomaiorsymbol{% \ifnum\gre@stafflinefactor=17\relax % @@ -1518,41 +1541,37 @@ \else % \setbox\GreTempwidth=\hbox{\gregoriofont \char \gre@char@divisiomaior}% % we calculate the raise of the bar - \newskip\gre@tempdim \gre@tempdim=\gre@additionalbottomspace % \advance\gre@tempdim by \gre@spacebeneathtext % \advance\gre@tempdim by \gre@spacelinestext % \advance\gre@tempdim by \gre@currenttranslationheight % % we calculate the height of the bar - \newskip\gre@tempwidth - \gre@tempwidth=4\gre@stafflineheight % - \advance\gre@tempwidth by 3\gre@interstafflinespace % - \raise\gre@tempdim\hbox{\vrule height \gre@tempwidth width \wd\GreTempwidth}% + \raise\gre@tempdim\hbox{\vrule height \gre@staffheight width \wd\GreTempwidth}% \fi % \relax % -} +}% \def\gredivisiofinalissymbol{% \gre@calculate@glyphraisevalue{g}{0}% bar glyphs are made to be at this height \gredivisiomaiorsymbol % - \newskip\gre@tempdimtwo \gre@tempdimtwo = 12000 sp% \multiply\gre@tempdimtwo by \the\grefactor% - \kern \gre@tempdimtwo% + \kern\gre@tempdimtwo% \grenobreak % \gredivisiomaiorsymbol % -} +}% %a count to tell if we have to keep the localrightbox until the end -\newcount\keeprightbox +\newcount\keeprightbox% %macro to end a line with a divisio finalis \def\grefinaldivisiofinalis#1{% \ifcase#1% case 0 \grelocalrightbox{}% -% \grelocalleftbox{}% +% \grelocalleftbox{} \grenobreak % - \grehskip\gre@spacebeforefinalfinalis % + \gre@temp = \gre@spacebeforefinalfinalis% + \grehskip\gre@temp % \grenobreak % \grebarsyllable{}{}{}{1}{}{}{0}{\grelastofline}{% \gredivisiofinalis{}% @@ -1561,13 +1580,14 @@ \global\keeprightbox=1 % \grelocalrightbox{% \hbox{% - \hskip\gre@spacebeforefinalfinalis % + \gre@temp = \gre@spacebeforefinalfinalis% + \hskip\gre@temp % }% \gredivisiofinalissymbol % }% \fi % \relax% -} +}% %macro to end a line with a divisio maior \def\grefinaldivisiomaior#1{% @@ -1578,7 +1598,8 @@ \gredivisiomaior{}% }% \or % case 1 - \grehskip\gre@spacebeforefinalfinalis % + \gre@temp = \gre@spacebeforefinalfinalis% + \grehskip\gre@temp % \global\keeprightbox=1 % \grelocalrightbox{% \gre@calculate@glyphraisevalue{g}{0}% bar glyphs are made to be at this height @@ -1586,30 +1607,30 @@ }% \fi % \relax% -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for filling holes of empty notes -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\GreHidePCLines{% \xdef\grehidepclines{1}% -} +}% \def\GreDontHidePCLines{% \xdef\grehidepclines{0}% -} +}% \def\GreHideAltLines{% \xdef\grehidealtlines{1}% -} +}% \def\GreDontHideAltLines{% \xdef\grehidealtlines{0}% -} +}% -\GreDontHideAltLines -\GreHidePCLines +\GreDontHideAltLines% +\GreHidePCLines% % the argument is the character with which we fill the hole, and we suppose that @@ -1627,14 +1648,14 @@ }% \grenobreak % \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for typesetting alterations -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % a count saying if the first glyph is an alteration -\newcount\grefirstisalteration +\newcount\grefirstisalteration% % the top level macro: % #1 is the height @@ -1654,57 +1675,58 @@ \grefillhole{#3}% \fi % \setbox\GreTempwidth=\hbox{#2}% - \newskip\gre@tempwidth - \gre@tempwidth=\wd\GreTempwidth % - %\kern\gre@tempwidth % - %#3\relax % - %\kern-\gre@tempwidth % + %\newskip\gre@tempwidth + %\gre@tempwidth=\wd\GreTempwidth + %\kern\gre@tempwidth + %#3\relax + %\kern-\gre@tempwidth \raise \gre@glyphraisevalue% \copy\GreTempwidth% \ifnum#4=0\relax % % we try to avoid line breaking after a flat or a natural \grenobreak % \ifnum\the\grefirstglyph=1\relax % - \newskip\gre@tempdim \gre@tempdim=\wd\GreTempwidth % \advance\gre@tempdim by \gre@alterationspace % \global\advance\gre@notesaligncenter by \gre@tempdim % - \kern\gre@alterationspace % + \gre@temp = \gre@alterationspace% + \kern\gre@temp % \else % - \grehskip\gre@alterationspace % + \gre@temp = \gre@alterationspace% + \grehskip\gre@temp % \fi % \grenobreak % \fi % - %#4\relax % - %\grenobreak % + %#4\relax + %\grenobreak \relax % -} - +}% + % % This macro typesets a flat on the height provided by #1. #2 is not used yet, but it % will determine if the flat has zero width or not. #3 and #4 should be the same as greglyph's #5 and #6, but it's not really done nor useful... \def\greflat#1#2{% \grealteration{#1}{\greflatchar}{\greflatholechar}{#2}% \relax% -} +}% % Same as the one before, but for naturals. \def\grenatural#1#2{% \grealteration{#1}{\grenaturalchar}{\grenaturalholechar}{#2}% \relax% -} +}% % Same as the one before, but for sharps. \def\gresharp#1#2{% \grealteration{#1}{\gresharpchar}{\gresharpholechar}{#2}% \relax% -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for typesetting punctum cavum -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\UseAlternatePunctumCavum{% \gdef\grepunctumcavumchar{\gregoriofont\char \gre@char@punctumcavumalt}% @@ -1712,7 +1734,7 @@ \gdef\grepunctumcavumholechar{\gregoriofont\char \gre@char@punctumcavumholealt}% \gdef\grelineapunctumcavumholechar{\gregoriofont\char \gre@char@lineapunctumcavumholealt}% \relax % -} +}% \def\UseNormalPunctumCavum{% \gdef\grepunctumcavumchar{\gregoriofont\char \gre@char@punctumcavum}% @@ -1720,34 +1742,36 @@ \gdef\grepunctumcavumholechar{\gregoriofont\char \gre@char@punctumcavumhole}% \gdef\grelineapunctumcavumholechar{\gregoriofont\char \gre@char@lineapunctumcavumhole}% \relax % -} +}% -\UseNormalPunctumCavum +\UseNormalPunctumCavum% \def\grepunctumcavum#1#2#3#4#5{% \setbox\GreTempwidth=\hbox{\gregoriofont\grepunctumcavumchar}% \global\gre@lastglyphwidth=\wd\GreTempwidth % - \kern\gre@lastglyphwidth % + \gre@temp = \gre@lastglyphwidth% + \kern\gre@temp % #4\relax % - \kern-\gre@lastglyphwidth % + \kern-\gre@temp % \gre@calculate@glyphraisevalue{#1}{0}% \ifnum\grehidepclines=1\relax % \grefillhole{\grepunctumcavumholechar}% \fi % \greglyph{\grepunctumcavumchar}{#1}{#2}{#3}{}{#5}% \relax % -} +}% \def\grelineapunctumcavum#1#2#3#4#5{% \setbox\GreTempwidth=\hbox{\gregoriofont\grelineapunctumcavumchar}% \global\gre@lastglyphwidth=\wd\GreTempwidth % - \kern\gre@lastglyphwidth % + \gre@temp = \gre@lastglyphwidth% + \kern\gre@temp % #4\relax % - \kern-\gre@lastglyphwidth % + \kern-\gre@temp % \gre@calculate@glyphraisevalue{#1}{0}% \ifnum\grehidepclines=1\relax % \grefillhole{\grelineapunctumcavumholechar}% \fi % \greglyph{\grelineapunctumcavumchar}{#1}{#2}{#3}{}{#5}% \relax % -} +}% diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index e6f18522b..f097c5403 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -17,50 +17,50 @@ % this file contains definitions of spaces \gredeclarefileversion{gregoriotex-spaces.tex}% - {\directlua{tex.write(gregoriotex.get_greapiversion())}} + {\directlua{tex.write(gregoriotex.get_greapiversion())}}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for tuning penalties -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% The following macros enable users to tune penalties used in Gregorio % penalty to force a break on a new line -\xdef\grenewlinepenalty{-10001} -\def\greforcebreak{\grepenalty{\grenewlinepenalty}} +\xdef\grenewlinepenalty{-10001}% +\def\greforcebreak{\grepenalty{\grenewlinepenalty}}% % penalty to prevent a line break -\xdef\grenobreakpenalty{10001} -\def\grenobreak{\grepenalty{\grenobreakpenalty}} +\xdef\grenobreakpenalty{10001}% +\def\grenobreak{\grepenalty{\grenobreakpenalty}}% % called in \grenolastline (seems deprecated...) -\xdef\grenolastlinepenalty{100} +\xdef\grenolastlinepenalty{100}% % penalty at the end of a syllable which is the end of a word -\xdef\greendofwordpenalty{-100} +\xdef\greendofwordpenalty{-100}% % penalty at the end of a syllable which is not the end of a word -\xdef\greendofsyllablepenalty{-50} +\xdef\greendofsyllablepenalty{-50}% % penalty at the end of a syllable which is just a bar, with something printed % under it -\xdef\greendafterbarpenalty{-200} +\xdef\greendafterbarpenalty{-200}% % penalty right after a bar with nothing printed -\xdef\greendafterbaraltpenalty{-200} +\xdef\greendafterbaraltpenalty{-200}% % penalty at the end of a breakable neumatic element (typically at a space % between elements) -\xdef\greendofelementpenalty{-50} +\xdef\greendofelementpenalty{-50}% % hyphenpenalty will be used in discretionaries, in Gregorio this is used for % a bar with clef change for example. It also set \exhyphenpenalty. It should % be close to \greendafterbarpenalty -\xdef\grehyphenpenalty{-200} +\xdef\grehyphenpenalty{-200}% % broken penalty is the vertical penalty inserted after a break on a clef change % I'm not sure it should be set, but it might be useful... -\xdef\grebrokenpenalty{0} +\xdef\grebrokenpenalty{0}% %% The following macros cancel some useless penalties, and reinstances them %% at the end of a score @@ -76,7 +76,7 @@ \doublehyphendemerits=0\relax % \finalhyphendemerits=0\relax % \brokenpenalty=\grebrokenpenalty\relax % -} +}% \def\grerestorepenalties{% \hyphenpenalty=\grehyphenpenaltysave % @@ -84,24 +84,24 @@ \doublehyphendemerits=\gredoublehyphendemeritssave % \finalhyphendemerits=\grefinalhyphendemeritssave % \brokenpenalty=\grebrokenpenaltysave % -} +}% %% These macro enable the tuning of linepenalty, tolerance, pretolerance %% and emergencystretch % the macros to be modified by the users, -\def\grelooseness{\looseness} -\def\gretolerance{\tolerance} +\def\grelooseness{\looseness}% +\def\gretolerance{\tolerance}% % Workaround for bug 842 (http://tracker.luatex.org/view.php?id=842) % see http://tug.org/pipermail/luatex/2013-July/004516.html \ifnum\the\luatexversion < 78\relax % - \global\def\grepretolerance{-1} + \global\def\grepretolerance{-1}% \else % - \global\def\grepretolerance{\pretolerance} + \global\def\grepretolerance{\pretolerance}% \fi % -\def\greemergencystretch{\emergencystretch} -\def\grewidowpenalty{\widowpenalty} -\def\greclubpenalty{\clubpenalty} +\def\greemergencystretch{\emergencystretch}% +\def\grewidowpenalty{\widowpenalty}% +\def\greclubpenalty{\clubpenalty}% % macro called at ea \def\gredofinetuning{% @@ -117,7 +117,7 @@ \emergencystretch=\greemergencystretch % \widowpenalty=\grewidowpenalty % \clubpenalty=\greclubpenalty % -} +}% \def\greendfinetuning{% \looseness=\greloosenesssave % @@ -126,292 +126,93 @@ \emergencystretch=\greemergencystretchsave % \widowpenalty=\grewidowpenaltysave % \clubpenalty=\greclubpenaltysave % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of spaces -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Independent default distances are defined in gsp-default.tex. The distances defined here are calculated from those distances. -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%% -%% old code which will eventually be deleted -%%%%%%%%%%%%%%% - -%%%%%%%%%%%%%%%%%%%% -%% horizontal spaces -%%%%%%%%%%%%%%%%%%%% - -% additional lines width -\newskip\gre@additionallineswidth - -% null space -\newskip\gre@zerowidthspace - -% space between glyphs in the same element -\newskip\gre@interglyphspace - -% space between an alteration (flat or natural) and the next glyph -\newskip\gre@alterationspace - -% space before a choral sign -\newskip\gre@beforechoralsignspace - -% space between a clef and a flat (for clefs with flat) -\newskip\gre@clefflatspace - -% negative space, difference between the normal space between two notes and the space between a note and a flat -\newskip\gre@beforealterationspace - -% space between elements -\newskip\gre@interelementspace - -% larger space between elements -\newskip\gre@largerspace - -% space between elements which has the size of a note -\newskip\gre@glyphspace - -% minimum space between two notes of different syllables -\newskip\gre@intersyllablespace - -% space before custo -\newskip\gre@spacebeforecusto - -% space before punctum mora and augmentum duplex -\newskip\gre@spacebeforesigns - -% space after punctum mora and augmentum duplex -\newskip\gre@spaceaftersigns - -% space after a clef at the beginning of a line -\newskip\gre@spaceafterlineclef - -% space after at the end of a word when the last written symbol is a note and the first is a note -\newskip\gre@interwordspacenotes - -% space after at the end of a word when the last written symbol is a note and the first is text -\newskip\gre@interwordspacenotestext - -% space after at the end of a word when the last written symbol is text and the first is a note -\newskip\gre@interwordspacetextnotes - -% space after at the end of a word when the last written symbol is text and the first is text -\newskip\gre@interwordspacetext - -% space between notes of a bivirga or trivirga -\newskip\gre@bitrivirspace - -% space between notes of a bistropha or tristropha -\newskip\gre@bitristrospace - -% space between two punctum inclinatum -\newskip\gre@punctuminclinatumshift - -% space before puncta inclinata -\newskip\gre@beforepunctainclinatashift - -% space between a punctum inclinatum and a punctum inclinatum deminutus -\newskip\gre@punctuminclinatumanddebilisshift - -% space between two punctum inclinatum deminutus -\newskip\gre@punctuminclinatumdebilisshift - -% space between puncta inclinata, larger ambitus (range=3rd) -\newskip\gre@punctuminclinatumbigshift % - -% space between puncta inclinata, larger ambitus (range=4th -or more?-) -\newskip\gre@punctuminclinatummaxshift % - -% space for the bars (inside syllables) -%first for virgula and divisio minima -\newskip\gre@spacearoundsmallbar - -%then divisio minor -\newskip\gre@spacearoundminor - -%divisio major -\newskip\gre@spacearoundmaior - -%divisio finalis -\newskip\gre@spacearoundfinalis - -%a special space for finalis, for when it is the last glyph -\newskip\gre@spacebeforefinalfinalis - -% the space that will appear around bars that are preceded by a custo and followed by a key. -% well... actually it's the difference between the normal space around bars and the space described previously. -\newskip\gre@spacearoundclefbars - -% space between the text and the text of the bar -\newskip\gre@textbartextspace - -% minimal space between a note and a bar -\newskip\gre@notebarspace - -% maximal space between two syllables for which we consider a dash is not needed -\newdimen\gre@maximumspacewithoutdash - -% an extensible space for the beginning of lines -\newskip\gre@afterclefnospace - -% width of the additional lines, used only for the custos (the width of the custo is added to it) -% the width is the one for the custos at end of lines, the line for custos in the middle of a score is the same -% multiplied by 2. -\newdimen\gre@additionalcustoslineswidth - -% space between the initial and the beginning of the score -\newskip\gre@afterinitialshift - -% space before the initial and the beginning of the score -\newskip\gre@beforeinitialshift - -% forced size of the box for the initial. Initial is centered in box. Ignored if 0. -\newskip\gre@manualinitialwidth - -% space before the initial and the beginning of the score -\newdimen\gre@minimalspaceatlinebeginning - -% this space is the one between the bottom of the first anotation line and the top -% of the second anotation line (above the initial) -\newdimen\gre@aboveinitialseparation - -\newdimen\gre@clivisalignmentmin - -%%%%%%%%%%%%%%%%%% -%% vertical spaces -%%%%%%%%%%%%%%%%%% -\newdimen\gre@abovesignsspace -\newdimen\gre@belowsignsspace - -% the shift for the low choral sign -\newdimen\gre@lowchoralsignshift - -% the shift for the high choral sign -\newdimen\gre@highchoralsignshift - -% the space for the translation -\newdimen\gre@translationheight - -%the space above the lines -\newskip\gre@spaceabovelines - -% shift of the text above the note line -\newdimen\gre@abovelinestextraise - -% additional space in case of text above the lines -\newdimen\gre@abovelinestextheight - -%the space between the lines and the bottom of the text -\newskip\gre@spacelinestext - -%the space beneath the text -\newskip\gre@spacebeneathtext - -%%% the following values are computed from the others, after some calculus - -% staffheight is the total height of the staff : that is to say the four written lines -\newdimen\gre@staffheight - -% space for the clef changes -\newskip\gre@clefchangespace - -% space at the beginning of the lines when there is no clef -\newdimen\gre@noclefspace - -% an additional shift you can give to the brace above the bars if you don't like it -\newskip\gre@braceshift - -% a shift you can give to the accentus above the curly brace -\newskip\gre@curlybraceaccentusshift - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%% %% Global distances -%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%% % textlower is the height of the separation between the bottom line (which is invisible : for the notes which are very low) and the bottom of the text -\newdimen\gre@textlower +\newdimen\gre@textlower% \def\gre@calculate@textlower{% - \gre@textlower=\gre@spacebeneathtext + \gre@textlower=\gre@spacebeneathtext% %\advance\gre@textlower by \translationheight -} +}% % stafflinewidth is the width of a line of staff, this can vary, for example at the first line -\newdimen\gre@stafflinewidth +\newdimen\gre@stafflinewidth% \def\gre@calculate@stafflinewidth{% - \gre@stafflinewidth=\gre@linewidth -} + \gre@stafflinewidth=\gre@linewidth % +}% % linewidth is the width of a line of a score (including the initial) -\newdimen\gre@linewidth +\newdimen\gre@linewidth% \def\gre@calculate@linewidth{% - \gre@linewidth=\hsize -} + \gre@linewidth=\hsize % +}% % Messing with the staff line thickness directly is messy, so we provide the following interface to make life easier on the user: % stafflineheight is the height of a staff line (in arbitrary units) % = 1500 * stafflinefactor -\newdimen\gre@stafflineheight +\newdimen\gre@stafflineheight% \def\gre@calculate@stafflineheight{% - \global\gre@stafflineheight=1500 sp + \global\gre@stafflineheight=1500 sp% \global\multiply\gre@stafflineheight by \gre@stafflinefactor\relax % -} +}% % interstafflinespace is the space between two lines of staff % = (30000 - (stafflineheight/grefactor - 1500)) * grefactor = 31500 * grefactor - stafflineheight -\newdimen\gre@interstafflinespace -\def\gre@calculate@interstafflinespace{ +\newdimen\gre@interstafflinespace% +\def\gre@calculate@interstafflinespace{% \global\gre@interstafflinespace=31500sp% - \global\multiply\gre@interstafflinespace by \grefactor + \global\multiply\gre@interstafflinespace by \grefactor% \global\advance\gre@interstafflinespace by -\gre@stafflineheight % -} +}% % a distance to help place glyphs when the lines are not their default thickness % = (stafflineheight/grefactor - 1500sp)/2 * grefactor -\newdimen\gre@stafflinediff +\newdimen\gre@stafflinediff% \def\gre@calculate@stafflinediff{% \global\gre@stafflinediff = \gre@stafflineheight % - \global\divide\gre@stafflinediff by \grefactor\relax + \global\divide\gre@stafflinediff by \grefactor\relax% \global\advance\gre@stafflinediff by -1500sp% \global\divide\gre@stafflinediff by 2\relax % \global\multiply\gre@stafflinediff by \the\grefactor % -} +}% % the default factor % the stafflinefactor follows the same scale as the grefactor, i.e. a stafflinefactor corresponds to the default staff line thickness for grefactor 17, stafflinefactor 34 corresponds to the default staff line thickness for grefactor 34, etc. \xdef\gre@stafflinefactor{17}% % flag for whether the stafflinefactor should scale with changes of the grefactor -\xdef\gre@scale@stafflinefactor{1} +\xdef\gre@scale@stafflinefactor{1}% % a macro for setting the thickness of the staff lines. This changes the stafflinefactor and then adjusts the spaces that are affected by the thicker staff lines. \ifdefined\setstafflinethickness% - \greerror{\protect\setstafflinethickness\space is already defined. Check for package conflicts.} -\else + \greerror{\protect\setstafflinethickness\space is already defined. Check for package conflicts.}% +\else% \def\setstafflinethickness#1{% \xdef\gre@stafflinefactor{#1}% \gre@computespaces % %% TODO: make smarter \relax % - } -\fi + }% +\fi% -\def\gresetstafflinefactor#1{ - \gre@warning{\protect\gresetstafflinefactor\space is deprecated.\MessageBreak Use \protect\setstafflinethickness\space instead.} - \setstafflinethickness{#1} -} +\def\gresetstafflinefactor#1{% + \gre@warning{\protect\gresetstafflinefactor\space is deprecated.\MessageBreak Use \protect\setstafflinethickness\space instead.}% + \setstafflinethickness{#1} % +}% %constantglyphraise is the space between the 0 of the gragorian fonts and the effective 0 of the TeX score -\newdimen\gre@constantglyphraise +\newdimen\gre@constantglyphraise % % to calculate that, we take the bottom of the third line : it is at 200 in the fonts, and it must be at grespacelinestext + grespacebeneathtext + 2*greinterstafflinespace + 2*grestafflineheight + translationheight \def\gre@calculate@constantglyphraise{% \global\gre@constantglyphraise = -22000 sp% @@ -427,17 +228,17 @@ % an adjustment in the case of big lines \global\advance\gre@constantglyphraise by \gre@stafflinediff % \relax % -} +}% %% Here is the function to compute some more vertical spaces from the basic values -\newdimen\gre@staffheight +\newdimen\gre@staffheight% \def\gre@calculate@staffheight{% \global\gre@staffheight = 4\gre@stafflineheight % \global\advance\gre@staffheight by 3\gre@interstafflinespace % - %\global\multiply\gre@spacebeneathtext by \grefactor % uncomment it if you want + %\global\multiply{\gre@spacebeneathtext} by \grefactor % uncomment it if you want % something else than 0 \relax % -} +}% % A routine that simply aggregates the above global space calculating routines so we can easily update all when needed. %% Note: It used to be that some distance calculating functions called others. Since this can create problems with circularity if one is not careful, this is no longer the case. Now all distance calculating functions simply calculate their respective distance. This means that dependent distances are not necessarily recalculated when an individual distance is recalculated. This function updates all global calculated distances and in the order needed for the dependencies. @@ -450,27 +251,27 @@ %% stafflinediff: stafflineheight & grefactor %% staffheight: stafflineheight & interstafflinespace %% constantglyphraise: grefactor, additionalbottomspace, spacebeneathtext, spacelinestext, interstafflinespace, stafflineheight, currenttranslationheight, stafflinediff -\def\gre@computespaces{ - \gre@calculate@textlower - \gre@calculate@linewidth - \gre@calculate@stafflinewidth - \gre@calculate@stafflineheight - \gre@calculate@interstafflinespace - \gre@calculate@stafflinediff - \gre@calculate@staffheight - \gre@calculate@constantglyphraise -} - - -%%%%%%%%%%%%%%%%%% +\def\gre@computespaces{% + \gre@calculate@textlower% + \gre@calculate@linewidth% + \gre@calculate@stafflinewidth% + \gre@calculate@stafflineheight% + \gre@calculate@interstafflinespace% + \gre@calculate@stafflinediff% + \gre@calculate@staffheight% + \gre@calculate@constantglyphraise% +}% + + +%%%%%%%%%%%%%%%%%%% %% Local Distances (computed as needed) -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% % glyphraisevalue is the value of which we must raise one glyph (that will vary with every glyph) -\newdimen\gre@glyphraisevalue +\newdimen\gre@glyphraisevalue % % addedraisevalue is for the vertical episema and the puncta -\newdimen\gre@addedraisevalue +\newdimen\gre@addedraisevalue% % a very useful macro : it determines the good height of a glyph : the argument is the "number" where the glyph should be : 4 for the first line, 6 for the second, etc. % the second argument is for the cases of signs: for example if the note is on a line, the punctummora will be above, and the auctus duplex beneath. the possible values are: @@ -489,15 +290,12 @@ \global\greisonaline=\number 0% % z is the very special case of vertical episemus on the lowest note \if z\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 0% \fi% \if a\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 1% \fi% \if b\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 2% \ifnum#2=3\relax % \else % @@ -505,57 +303,45 @@ \fi % \fi% \if c\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 3% \fi% \if d\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 4% \global\greisonaline=1 % \fi% \if e\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 5% \fi% \if f\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 6% \global\greisonaline=1 % \fi% \if g\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 7% \fi% \if h\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 8 % \global\greisonaline=1 % \fi% \if i\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 9% \fi% \if j\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 10% \global\greisonaline=1 % \fi% \if k\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 11% \fi% \if l\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 12% \global\greisonaline=1 % \fi% \if m\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 13% \fi% % n is only useful for horizontal episemus and rare signs (signs below k have m as first argument, and above have n) \if n\grefirstcar#1\endgrefirstchar % - \newcount\gretempdimcount \gretempdimcount=\number 14% \fi% % if there is not line... we don't consider notes are on lines @@ -642,28 +428,28 @@ \multiply\gre@addedraisevalue by \the\grefactor % \global\advance\gre@glyphraisevalue by \the\gre@addedraisevalue % \or% 10: if it is a low choral sign, we shift it a bit lower, of a user-defined value - \global\advance\gre@glyphraisevalue by -\the\gre@lowchoralsignshift % + \grelowchoralsignstyle{\global\advance\gre@glyphraisevalue by -\gre@lowchoralsignshift} % \or% 11: if it is a high choral sign, we shift it a bit lower, of a user-defined value \ifnum\greisonaline=1% - \global\advance\gre@glyphraisevalue by -\the\gre@highchoralsignshift % + \grehighchoralsignstyle{\global\advance\gre@glyphraisevalue by -\gre@highchoralsignshift} % \else % - \global\advance\gre@glyphraisevalue by -\the\gre@lowchoralsignshift % + \grelowchoralsignstyle{\global\advance\gre@glyphraisevalue by -\gre@lowchoralsignshift} % \fi % \or% 12: if it is a low choral sign that is lower than the note, we shift it a bit higher \ifnum\greisonaline=1% - \global\advance\gre@glyphraisevalue by -\the\gre@highchoralsignshift % + \grehighchoralsignstyle{\global\advance\gre@glyphraisevalue by -\gre@highchoralsignshift} % \else % - \global\advance\gre@glyphraisevalue by -\the\gre@lowchoralsignshift % + \grelowchoralsignstyle{\global\advance\gre@glyphraisevalue by -\gre@lowchoralsignshift} % \fi % \or% 12: if it is the brace above the bars, we shift it to a user-defined value - \global\advance\gre@glyphraisevalue by -\the\gre@braceshift % + \global\advance\gre@glyphraisevalue by -\gre@braceshift % \fi% \global\advance\gre@glyphraisevalue by \the\gre@constantglyphraise % -} +}% % two dimensions for the additionalspaces -\newdimen\gre@additionalbottomspace -\newdimen\gre@additionaltopspace +\newdimen\gre@additionalbottomspace% +\newdimen\gre@additionaltopspace% % same arguments as grenewlinewithspace \def\gre@calculate@additionalspaces#1#2{% @@ -697,7 +483,7 @@ \gregeneratelines % \gre@calculate@constantglyphraise % \relax % -} +}% %% macros for additional bottom space for the first line @@ -723,14 +509,14 @@ \gregeneratelines % \gre@calculate@constantglyphraise % \relax % -} +}% %% macro that typesets the text of the syllable, and sets textaligncenter to the middle of the middle letters, it is needed because we align the note (often the middle of the note) with the middle of the middle letters %% third argument is 0 if it's the current syllable, 1 if it's the alignment of the following one %% warning: gretextaligncenter is the width from the beginning of the letters to the middle of the middle letters %% warning: value is approximative when a ligature appears -\newdimen\gre@textaligncenter +\newdimen\gre@textaligncenter% \def\gre@calculate@textaligncenter#1#2#3{% \ifnum#3=0\relax% @@ -747,13 +533,13 @@ \divide\gre@tempwidth by 2 % \global\advance\gre@textaligncenter by -\the\gre@tempwidth% \relax% -} +}% % a dimen that will contain the difference between the end of the text and the end of the notes for the previous syllable (if we are in the same word) : positive if notes go further than text. We will use it for space adjustment between syllables of the same word -\newdimen\gre@enddifference +\newdimen\gre@enddifference% % a dimen that will contain the enddifference of the previous glyph -\newdimen\gre@previousenddifference +\newdimen\gre@previousenddifference% % macro to set enddifference (defined above) to \wd\GreSyllablenotes - (\wd\GreSyllabletext - textaligncenter) - notesaligncenter % enddifference will be positive if text go further than the notes, and negative in the other case @@ -772,20 +558,22 @@ \global\advance\gre@enddifference by #3% \global\advance\gre@enddifference by -#4% \relax% -} +}% % temporary value for space for the translation, beneath the text -\newdimen\gre@currenttranslationheight +\newdimen\gre@currenttranslationheight% % macro to tell gregorio to set space for the translation \def\greaddtranslationspace{% - \global\gre@currenttranslationheight=\gre@translationheight % - \global\gre@textlower=\gre@spacebeneathtext % - \global\advance\gre@textlower by \gre@translationheight % - \gregeneratelines % - \gre@calculate@constantglyphraise % - \relax % -} + \gretranslationformat{% + \global\gre@currenttranslationheight=\gre@translationheight % + \global\gre@textlower=\gre@spacebeneathtext % + \global\advance\gre@textlower by \gre@translationheight % + \gregeneratelines % + \gre@calculate@constantglyphraise % + }% + \relax % +}% \def\greremovetranslationspace{% \global\gre@currenttranslationheight=0 sp% @@ -793,10 +581,10 @@ \gregeneratelines % \gre@calculate@constantglyphraise % \relax % -} +}% %nextbegindifference is the begindifference of the next syllable -\newskip\gre@nextbegindifference +\newskip\gre@nextbegindifference% % macro to set nextbegindifference %% 1 : the first letters of the next syllable @@ -805,22 +593,20 @@ %% 4 : the type of notes alignment \def\gre@calculate@nextbegindifference#1#2#3#4{% %to prevent the pollution of the normal values, we stock them into a temp value - \newskip\gre@tempdimskip \gre@tempdimskip=\gre@textaligncenter % \gre@calculate@textaligncenter{#1}{#2}{1}% \global\gre@nextbegindifference=-\gre@textaligncenter % \global\gre@textaligncenter=\gre@tempdimskip % - \newskip\gre@tempdimskip \gre@tempdimskip=\gre@notesaligncenter % \grefindnextnotesaligncenter{#4}% idem \global\advance\gre@nextbegindifference by \the\gre@notesaligncenter % \global\gre@notesaligncenter=\gre@tempdimskip % \relax % -} +}% %The distance from the baseline of the line to the baseline of the annotations -\newdimen\gre@aboveinitialfirstraise -\newdimen\gre@aboveinitialsecondraise +\newdimen\gre@aboveinitialfirstraise% +\newdimen\gre@aboveinitialsecondraise% % When text is placed in the annotation boxes these dimensions are initialized with values based on the contents and the user parameters %This function sets the true raises of the two lines above the inital (it has to be called just as the boxes are placed in order to make sure that the values are all correct) \def\gre@calculate@aboveinitialraise{% @@ -831,214 +617,402 @@ \global\advance\gre@aboveinitialfirstraise by \gre@additionalbottomspace % \global\advance\gre@aboveinitialsecondraise by \gre@aboveinitialfirstraise % \relax % -} +}% -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% %% other spaces calculated elsewhere -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% % These distances don't have independent functions which calculate their value, generally because their calculation is distributed over multiple events. % begindifference is the difference between the begginning of the text and the beginning of the notes. Warning : it can be negative. -\newdimen\gre@begindifference +\newdimen\gre@begindifference% % the width of the clef -\newdimen\gre@clefwidth +\newdimen\gre@clefwidth% % the width of the last glyph -\newdimen\gre@lastglyphwidth +\newdimen\gre@lastglyphwidth% % notes align center is the point of alignment for the notes -\newdimen\gre@notesaligncenter +\newdimen\gre@notesaligncenter% %this dimention is the additional space that we have to add to the localleftbox sometimes. For now it is used only for the initials on two lines -\newdimen\gre@additionalleftspace +\newdimen\gre@additionalleftspace% % the calculated width of the initial (may be actual width of letter or be forced wider under certain conditions) -\newdimen\gre@initialwidth -\gre@initialwidth= 0 pt - -\newdimen\gre@currentabovelinestextheight -\gre@currentabovelinestextheight = 0pt - -%% TODO: try localizing all temporary variables -% temporary spaces used in calculations -%\newdimen\gre@tempwidth -%\newdimen\gre@tempdimsignwidth -%\newdimen\gre@tempdimtwo -%\newdimen\gre@tempdim -%\newskip\gre@tempdimskip % couldn't we use another existing temp* ? maybe not -%\newskip\gre@skipone - -%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newdimen\gre@initialwidth% +\gre@initialwidth= 0 pt% + +\newdimen\gre@currentabovelinestextheight% +\gre@currentabovelinestextheight = 0pt% + +%% TODO: perhaps create a pair of functions which “reserve” and “release” the temporary registers in order to keep track of which ones are in use when. There would also need to be a list of the registers currently in use. The reserve function would then check the list to make sure the requested register isn’t already in use, throwing an error if it is and adding its name to the list if it isn’t. It might also provide for an alias (via \let). The release function would simply remove the register from the list of those in use. +% temporary spaces used in calculations (unrevised) +\newdimen\gre@tempwidth% +\newdimen\gre@tempdimsignwidth% +\newdimen\gre@tempdimtwo% +\newdimen\gre@tempdim% +\newskip\gre@tempdimskip % couldn't we use another existing temp* ? maybe not +\newskip\gre@skipone% +\newskip\gre@temp% +\newcount\gretempdimcount% +% Register allocation is an inherently global process in TeX. Below are the registers used within calculations on a temporary basis. +\newdimen\gre@temp@dimen@one% +\newdimen\gre@temp@skip@one% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% dimension changing macros -%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% This macro changes one dim (#1) to the value #2, with the current factor. -%% or use the next macro. -\def\grechangedim#1#2{% - \grechangedimatfactor{#1}{#2}{\grefactor}% - \relax % -} - -%% This macro changes one dimen (#1) to the value #2, at the factor specified -%% in #3. -\def\grechangedimatfactor#1#2#3{% - #1=#2% - \ifnum #3=\grefactor\else % - \divide #1 by \number #3% - \multiply #1 by \grefactor % - \fi % - \gre@computespaces % - \relax % -} +%% This macro sets one dim (#1) to the value #2 and sets whether it should scale when the \grefactor changes (#3, 1 if yes, 0 if no). While it does check that #1 can accept the kind of distance given in #2, it does not propagate the changes through the calculated distances. +\newif\ifchecklength% +\newif\ifbadlength% +\def\gresetdim#1#2#3{% + \checklengthfalse% + \badlengthfalse% + %check if #2 is a rubber length (contains plus and/or minus) + \IfSubStr{#2}{plus}{\checklengthtrue}{\relax}% + \IfSubStr{#2}{minus}{\checklengthtrue}{\relax}% + %if #1 is one of the distances which cannot be rubber. + \ifchecklength% + \IfStrEq{#1}{additionallineswidth}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{maximumspacewithoutdash}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{additionalcustoslineswidth}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{minimalspaceatlinebeginning}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{manualinitialwidth}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{aboveinitialseparation}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{noclefspace}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{abovesignsspace}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{belowsignsspace}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{lowchoralsignsshift}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{highchoralsignsshift}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{translationheight}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{abovelinestextraise}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{abovelinestextheight}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{braceshift}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{curlybraceaccentusshift}{\badlengthtrue}{\relax}% + \IfStrEq{#1}{clivisalignmentmin}{\badlengthtrue}{\relax}% + \fi% + % did both of the above conditions hold true? + \ifbadlength% + \greerror{#1 cannot be a rubber length.}% + \else% + \expandafter\xdef\csname gre@scale@#1\endcsname{#3}% + \expandafter\xdef\csname gre@#1\endcsname{#2}% + \fi% + \relax % +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% a macro for changing a dimension and making sure that the change cascades through. +% TODO: make smarter so that it knows the dependency tree and only recalculates distances affected by the change +\def\grechangedim#1#2#3{% + \gresetdim{#1}{#2}{#3}% + \gre@computespaces% +}% + +%a macro to use if all you want to do is turn off the scaling for a particular distance +\def\grenoscaledim#1{% + \expandafter\gdef\csname gre@scale@#1\endcsname{0}% +}% + +%a macro to use if all you want to do is turn on the scaling for a particular distance +\def\grescaledim#1{% + \expandafter\gdef\csname gre@scale@#1\endcsname{1}% +}% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % space configuration loading -%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\GreLoadSpaceConf#1{% - \input gsp-#1.tex\relax % - \gre@changedimenfactor{\greconffactor}{\grefactor} % - \gre@computespaces % - \relax % -} + \input gsp-#1.tex\relax % + \ifnum\the\grefactor=\greconffactor\else %If the space configuration file is designed for a \grefactor other than the current one, then we need to rescale the distances. + \gre@changedimenfactor{\greconffactor}{\grefactor} % + \fi% + \gre@computespaces % + \relax % +}% % We input the default config, for everything to work fine it has to be done after the gregoriotex package is completely loaded (so that all functions are well defined). As a result we delay the loading to the beginning of the document. -\AtBeginDocument{\GreLoadSpaceConf{default}} +\AtBeginDocument{\GreLoadSpaceConf{default}}% -%%%%%%%%%%%%% +%%%%%%%%%%%%%% %% Rescaling dimensions (for when \grefactor changes) -%%%%%%%%%%%%% +%%%%%%%%%%%%%% %% an aux function adapting the value #1 from the factor #2 to the factor #3 +%% Note: This function is assumed to touch only dimensions which are meant to scale with the \grefactor (i.e. if it acts on distance x, \gre@scale@x is 1) +\newif\ifrubber% \def\gre@changeonedimenfactor#1#2#3{% - \global\divide #1 by \number #2% - \global\multiply #1 by \number #3% - \relax % -} + \rubbertrue% + % is length one that cannot be rubber? + \IfStrEq{#1}{additionallineswidth}{\rubberfalse}{\relax}% + \IfStrEq{#1}{maximumspacewithoutdash}{\rubberfalse}{\relax}% + \IfStrEq{#1}{additionalcustoslineswidth}{\rubberfalse}{\relax}% + \IfStrEq{#1}{minimalspaceatlinebeginning}{\rubberfalse}{\relax}% + \IfStrEq{#1}{manualinitialwidth}{\rubberfalse}{\relax}% + \IfStrEq{#1}{aboveinitialseparation}{\rubberfalse}{\relax}% + \IfStrEq{#1}{noclefspace}{\rubberfalse}{\relax}% + \IfStrEq{#1}{abovesignsspace}{\rubberfalse}{\relax}% + \IfStrEq{#1}{belowsignsspace}{\rubberfalse}{\relax}% + \IfStrEq{#1}{lowchoralsignsshift}{\rubberfalse}{\relax}% + \IfStrEq{#1}{highchoralsignsshift}{\rubberfalse}{\relax}% + \IfStrEq{#1}{translationheight}{\rubberfalse}{\relax}% + \IfStrEq{#1}{abovelinestextraise}{\rubberfalse}{\relax}% + \IfStrEq{#1}{abovelinestextheight}{\rubberfalse}{\relax}% + \IfStrEq{#1}{braceshift}{\rubberfalse}{\relax}% + \IfStrEq{#1}{curlybraceaccentusshift}{\rubberfalse}{\relax}% + \IfStrEq{#1}{clivisalignmentmin}{\rubberfalse}{\relax}% + \ifrubber% if we have a rubber allowed length we create a temporary skip + \let\gre@scaledist\gre@temp@skip@one% + \else% otherwise we create a temporary dimen + \let\gre@scaledist\gre@temp@dimen@one% + \fi% + % Math + \edef\gre@convert{\csname gre@#1\endcsname}% + \gre@scaledist=\gre@convert% + \multiply \gre@scaledist by \number #3% + \divide \gre@scaledist by \number #2% + \gre@consistentunits{\gre@convert}{\gre@scaledist}% + \gresetdim{#1}{\gre@stringdist}{1}% + \relax % +}% + + +% These functions are used for stripping out the units and decimal portion of a distance to make it more amenable to being used in the conversion function below +{\catcode`p=12 \catcode`t=12 \gdef\gre@makein#1.#2pt{#1}}% +{\catcode`p=12 \catcode`t=12 \gdef\gre@makenum#1pt{#1}}% + +% This function converts a distance to the units indicated in #1 and returns it as a string. +\newdimen\gre@unit% +\newdimen\gre@base% +\newdimen\gre@maxlen% +\newcount\gre@unitfactor% +\newcount\gre@basefactor% +\newcount\gre@temp@count@one% +\def\gre@convertto#1#2{% + \ifdim#2=0pt\relax% + \edef\gre@converted{0 #1}% + \else% + \gre@unit = 1 #1% + \gre@base = #2% + % Code to increase precision + \gre@maxlen = 16383.99999pt% + \gre@unitfactor = \number\gre@maxlen% + \divide\gre@unitfactor by \number\gre@unit% + \gre@basefactor = \number\gre@maxlen% + \divide\gre@basefactor by \number\gre@base% + \ifnum\gre@basefactor<\gre@unitfactor% + \multiply\gre@unit by \gre@basefactor% + \multiply\gre@base by \gre@basefactor% + \else% + \multiply\gre@unit by \gre@unitfactor% + \multiply\gre@base by \gre@unitfactor% + \fi% + \gre@temp@count@one = \expandafter\gre@makein\the\gre@unit% + \divide\gre@base by \gre@temp@count@one% + \edef\gre@converted{% + \expandafter\gre@makenum\the\gre@base #1% + }% + \fi% +}% + +% This function takes a distance (#2) and formats it as a string so that its units conform to the pattern set by a string representation of a distance (#1) +\newif\ifstretch% +\newif\ifshrink% +\def\gre@consistentunits#1#2{% + \stretchfalse% + \shrinkfalse% + \IfSubStr{#1}{plus}{\stretchtrue}{\relax}% + \IfSubStr{#1}{minus}{\shrinktrue}{\relax}% + \ifstretch% + \ifshrink% + %rubber with both stretch and shrink + \StrBefore{#1}{plus}[\gre@baseunit]% + \StrBetween{#1}{plus}{minus}[\gre@stretchunit]% + \StrBehind{#1}{minus}[\gre@shrinkunit]% + \else% + %rubber with stretch only + \StrBefore{#1}{plus}[\gre@baseunit]% + \StrBehind{#1}{plus}[\gre@stretchunit]% + \def\gre@shrinkunit{\relax}% + \fi% + \else% + \ifshrink% + %rubber with shrink only + \StrBefore{#1}{minus}[\gre@baseunit]% + \def\gre@stretchunit{\relax}% + \StrBehind{#1}{minus}[\gre@shrinkunit]% + \else% + %non-rubber + \def\gre@baseunit{#1}% + \def\gre@stretchunit{\relax}% + \def\gre@shrinkunit{\relax}% + \fi% + \fi% + \StrDel{\gre@baseunit}{ }[\gre@baseunit]% + \StrRight{\gre@baseunit}{2}[\gre@baseunit]% + \StrDel{\gre@stretchunit}{ }[\gre@stretchunit]% + \StrRight{\gre@stretchunit}{2}[\gre@stretchunit]% + \StrDel{\gre@shrinkunit}{ }[\gre@shrinkunit]% + \StrRight{\gre@shrinkunit}{2}[\gre@shrinkunit]% + \gre@convertto{\gre@baseunit}{\dimexpr#2\relax}% + \edef\gre@stringdist{\gre@converted}% + \if\relax\gre@stretchunit\else% + \gre@convertto{\gre@stretchunit}{\gluestretch#2}% + \edef\gre@stringdist{\gre@stringdist plus \gre@converted}% + \fi% + \if\relax\gre@shrinkunit\else% + \gre@convertto{\gre@shrinkunit}{\glueshrink#2}% + \edef\gre@stringdist{\gre@stringdist minus \gre@converted}% + \fi% +}% + + %% this function changes all the values of the spaces (vertical and horizontal) from one factor to another %% simply by dividing them by the old factor, and multiplying them by the new one. % #1 is the old grefactor, #2 is the new one +\newcount\gre@temp@count@two% \def\gre@changedimenfactor#1#2{% - \gre@changeonedimenfactor{\gre@additionallineswidth}{#1}{#2}% - \gre@changeonedimenfactor{\gre@additionalcustoslineswidth}{#1}{#2}% - \gre@changeonedimenfactor{\gre@zerowidthspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@interglyphspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@alterationspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@clefflatspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@beforechoralsignspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@beforealterationspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@interelementspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@largerspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@glyphspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@intersyllablespace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spacebeforecusto}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spacebeforesigns}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spaceaftersigns}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spaceafterlineclef}{#1}{#2}% - \gre@changeonedimenfactor{\gre@interwordspacenotes}{#1}{#2}% - \gre@changeonedimenfactor{\gre@interwordspacenotestext}{#1}{#2}% - \gre@changeonedimenfactor{\gre@interwordspacetextnotes}{#1}{#2}% - \gre@changeonedimenfactor{\gre@interwordspacetext}{#1}{#2}% - \gre@changeonedimenfactor{\gre@bitrivirspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@bitristrospace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@punctuminclinatumshift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@beforepunctainclinatashift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@punctuminclinatumanddebilisshift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@punctuminclinatumdebilisshift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@punctuminclinatumbigshift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@punctuminclinatummaxshift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spacearoundsmallbar}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spacearoundminor}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spacearoundmaior}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spacearoundfinalis}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spacebeforefinalfinalis}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spacearoundclefbars}{#1}{#2}% - \gre@changeonedimenfactor{\gre@textbartextspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@notebarspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@maximumspacewithoutdash}{#1}{#2}% - \gre@changeonedimenfactor{\gre@afterclefnospace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@afterinitialshift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@beforeinitialshift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@minimalspaceatlinebeginning}{#1}{#2}% - \gre@changeonedimenfactor{\gre@manualinitialwidth}{#1}{#2}% - \gre@changeonedimenfactor{\gre@aboveinitialseparation}{#1}{#2}% - \gre@changeonedimenfactor{\gre@noclefspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@clefchangespace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@clivisalignmentmin}{#1}{#2}% - \gre@changeonedimenfactor{\gre@abovesignsspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@belowsignsspace}{#1}{#2}% - \gre@changeonedimenfactor{\gre@lowchoralsignshift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@highchoralsignshift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@translationheight}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spaceabovelines}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spacelinestext}{#1}{#2}% - \gre@changeonedimenfactor{\gre@spacebeneathtext}{#1}{#2}% - \gre@changeonedimenfactor{\gre@abovelinestextraise}{#1}{#2}% - \gre@changeonedimenfactor{\gre@abovelinestextheight}{#1}{#2}% - \gre@changeonedimenfactor{\gre@braceshift}{#1}{#2}% - \gre@changeonedimenfactor{\gre@curlybraceaccentusshift}{#1}{#2}% + \gre@changeonedimenfactor{additionallineswidth}{#1}{#2}% + \gre@changeonedimenfactor{additionalcustoslineswidth}{#1}{#2}% + \gre@changeonedimenfactor{zerowidthspace}{#1}{#2}% + \gre@changeonedimenfactor{interglyphspace}{#1}{#2}% + \gre@changeonedimenfactor{alterationspace}{#1}{#2}% + \gre@changeonedimenfactor{clefflatspace}{#1}{#2}% + \gre@changeonedimenfactor{beforechoralsignspace}{#1}{#2}% + \gre@changeonedimenfactor{beforealterationspace}{#1}{#2}% + \gre@changeonedimenfactor{interelementspace}{#1}{#2}% + \gre@changeonedimenfactor{largerspace}{#1}{#2}% + \gre@changeonedimenfactor{glyphspace}{#1}{#2}% + \gre@changeonedimenfactor{intersyllablespace}{#1}{#2}% + \gre@changeonedimenfactor{spacebeforecusto}{#1}{#2}% + \gre@changeonedimenfactor{spacebeforesigns}{#1}{#2}% + \gre@changeonedimenfactor{spaceaftersigns}{#1}{#2}% + \gre@changeonedimenfactor{spaceafterlineclef}{#1}{#2}% + \gre@changeonedimenfactor{interwordspacenotes}{#1}{#2}% + \gre@changeonedimenfactor{interwordspacenotestext}{#1}{#2}% + \gre@changeonedimenfactor{interwordspacetextnotes}{#1}{#2}% + \gre@changeonedimenfactor{interwordspacetext}{#1}{#2}% + \gre@changeonedimenfactor{bitrivirspace}{#1}{#2}% + \gre@changeonedimenfactor{bitristrospace}{#1}{#2}% + \gre@changeonedimenfactor{punctuminclinatumshift}{#1}{#2}% + \gre@changeonedimenfactor{beforepunctainclinatashift}{#1}{#2}% + \gre@changeonedimenfactor{punctuminclinatumanddebilisshift}{#1}{#2}% + \gre@changeonedimenfactor{punctuminclinatumdebilisshift}{#1}{#2}% + \gre@changeonedimenfactor{punctuminclinatumbigshift}{#1}{#2}% + \gre@changeonedimenfactor{punctuminclinatummaxshift}{#1}{#2}% + \gre@changeonedimenfactor{spacearoundsmallbar}{#1}{#2}% + \gre@changeonedimenfactor{spacearoundminor}{#1}{#2}% + \gre@changeonedimenfactor{spacearoundmaior}{#1}{#2}% + \gre@changeonedimenfactor{spacearoundfinalis}{#1}{#2}% + \gre@changeonedimenfactor{spacebeforefinalfinalis}{#1}{#2}% + \gre@changeonedimenfactor{spacearoundclefbars}{#1}{#2}% + \gre@changeonedimenfactor{textbartextspace}{#1}{#2}% + \gre@changeonedimenfactor{notebarspace}{#1}{#2}% + \gre@changeonedimenfactor{maximumspacewithoutdash}{#1}{#2}% + \gre@changeonedimenfactor{afterclefnospace}{#1}{#2}% + \gre@changeonedimenfactor{afterinitialshift}{#1}{#2}% + \gre@changeonedimenfactor{beforeinitialshift}{#1}{#2}% + \gre@changeonedimenfactor{minimalspaceatlinebeginning}{#1}{#2}% + \gre@changeonedimenfactor{manualinitialwidth}{#1}{#2}% + \gre@changeonedimenfactor{aboveinitialseparation}{#1}{#2}% + \gre@changeonedimenfactor{noclefspace}{#1}{#2}% + \gre@changeonedimenfactor{clefchangespace}{#1}{#2}% + \gre@changeonedimenfactor{clivisalignmentmin}{#1}{#2}% + \gre@changeonedimenfactor{abovesignsspace}{#1}{#2}% + \gre@changeonedimenfactor{belowsignsspace}{#1}{#2}% + \gre@changeonedimenfactor{lowchoralsignshift}{#1}{#2}% + \gre@changeonedimenfactor{highchoralsignshift}{#1}{#2}% + \gre@changeonedimenfactor{translationheight}{#1}{#2}% + \gre@changeonedimenfactor{spaceabovelines}{#1}{#2}% + \gre@changeonedimenfactor{spacelinestext}{#1}{#2}% + \gre@changeonedimenfactor{spacebeneathtext}{#1}{#2}% + \gre@changeonedimenfactor{abovelinestextraise}{#1}{#2}% + \gre@changeonedimenfactor{abovelinestextheight}{#1}{#2}% + \gre@changeonedimenfactor{braceshift}{#1}{#2}% + \gre@changeonedimenfactor{curlybraceaccentusshift}{#1}{#2}% \ifnum\gre@scale@stafflinefactor=1\relax% - \newcount\tempcount - \tempcount = \gre@stafflinefactor - \multiply\tempcount by #2\relax% - \divide\tempcount by #1\relax - \xdef\gre@stafflinefactor{\the\tempcount} - \fi - \gre@computespaces + \gre@temp@count@two = \gre@stafflinefactor% + \multiply\gre@temp@count@two by #2\relax% + \divide\gre@temp@count@two by #1\relax% + \xdef\gre@stafflinefactor{\the\gre@temp@count@two}% + \fi% + \gre@computespaces% \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Some Macros for changing the spacing around the initial -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Seeing as these are the distances that people will want to change the most often, %we give them their own set of macros to make that easier. - -\def\GreSetAboveInitialSeparation#1{ - \grechangedim{\gre@aboveinitialseparation}{#1}% - \relax % -} - -\let\setaboveinitialseparation\GreSetAboveInitialSeparation +% To change the spacing between annotations. +%First argument is distance, second is whether it should scale when \grefactor changes. +\ifdefined\setaboveinitialseparation% + \greerror{\protect\setaboveinitialseparation\space is already defined. Check for package conflicts.}% +\else% + \def\setaboveinitialseparation#1#2{% + \grechangedim{aboveinitialseparation}{#1}{#2}% + \relax % + }% +\fi% + +\def\GreSetAboveInitialSeparation#1{% + \gre@warning{\protect\GreSetAboveInitialSeparation\space is deprecated.\MessageBreak Use \protect\setaboveiniitalseparation\space instead.}% + \setaboveinitialseparation#1{1}% +}% + +%To change the space after the initial +%First argument is distance, second is whether it should scale when \grefactor changes. +\ifdefined\setspaceafterinitial% + \greerror{\protect\setspaceafterinitial\space is already defined. Check for package conflicts.}% +\else% + \def\setspaceafterinitial#1#2{% + \grechangedim{afterinitialshift}{#1}{#2}% + \relax % + }% +\fi% \def\GreSetSpaceAfterInitial#1{% - \ifnum\grebiginitial=0\relax% - \greinitialformat{\global\grechangedim{\gre@afterinitialshift}{#1}}% - \else% - \grebiginitialformat{\global\grechangedim{\gre@afterinitialshift}{#1}}% - \fi% - \relax % -} - -\let\setspaceafterinitial\GreSetSpaceAfterInitial + \gre@warning{\protect\GreSetSpaceAfterInitial\space is deprecated.\MessageBreak Use \protect\setspaceafteriniital\space instead.}% + \setspaceafterinitial#1{1} % +}% + +%To change the space before the initial +%First argument is distance, second is whether it should scale when \grefactor changes. +\ifdefined\setspacebeforeinitial% + \greerror{\protect\setspacebeforeinitial\space is already defined. Check for package conflicts.}% +\else% + \def\setspacebeforeinitial#1#2{% + \grechangedim{beforeinitialshift}{#1}{#2}% + \relax % + }% +\fi% \def\GreSetSpaceBeforeInitial#1{% - \ifnum\grebiginitial=0\relax% - \greinitialformat{\global\grechangedim{\gre@beforeinitialshift}{#1}}% - \else% - \grebiginitialformat{\global\grechangedim{\gre@beforeinitialshift}{#1}}% - \fi% - \relax % -} - -\let\setspacebeforeinitial\GreSetSpaceBeforeInitial - -\def\setinitialspacing#1#2#3{ - \grechangedim{\gre@beforeinitialshift}{#1}% - \ifnum\grebiginitial=0\relax % - \greinitialformat{\global\grechangedim{\gre@manualinitialwidth}{#2}}% - \else% - \grebiginitialformat{\global\grechangedim{\gre@manualinitialwidth}{#2}}% - \fi% - \grechangedim{\gre@afterinitialshift}{#3}% - \relax% -} + \gre@warning{\protect\GreSetSpaceBeforeInitial\space is deprecated.\MessageBreak Use \protect\setspacebeforeiniital\space instead.}% + \setspacebeforeinitial#1{1} % +}% + + +%To change all the distances associated with the initial. +%First three arguments are distances, last is whether they should scale when \grefactor changes. +\ifdefined\setinitialspacing% + \greerror{\protect\setinitialspacing\space is already defined. Check for package conflicts.}% +\else% + \def\setinitialspacing#1#2#3#4{% + \grechangedim{beforeinitialshift}{#1}{#4}% + \grechangedim{manualinitialwidth}{#2}{#4}% + \grechangedim{afterinitialshift}{#3}{#4}% + \relax% + }% +\fi% diff --git a/tex/gregoriotex-syllable.tex b/tex/gregoriotex-syllable.tex index 783a68cc6..132b27ffc 100644 --- a/tex/gregoriotex-syllable.tex +++ b/tex/gregoriotex-syllable.tex @@ -17,20 +17,20 @@ % this file contains definitions of the glyphs and the syllables \gredeclarefileversion{gregoriotex-syllable.tex}% - {\directlua{tex.write(gregoriotex.get_greapiversion())}} + {\directlua{tex.write(gregoriotex.get_greapiversion())}}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of the different glyphs -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % a boolean : 0 if the note is not a line, else 1 -\newcount\greisonaline +\newcount\greisonaline% % a little hack for the case where we do something like \gre@calculate@glyphraisevalue{\greclefflat} -\gdef\grefirstcar#1#2\endgrefirstchar{#1} +\gdef\grefirstcar#1#2\endgrefirstchar{#1}% % a macro to tell if the last seen glyph has a punctum mora -\xdef\grelastispunctum{0} +\xdef\grelastispunctum{0}% % a macro called each time we start something looking like a glyph, but not mandatorily called through the \greglyph macro, for example bars, flats, etc. @@ -43,38 +43,38 @@ \ifnum\grelastispunctum=1\relax % \xdef\grelastispunctum{0}% \fi % -} +}% % count that tells us if the current glyph is the first glyph or not. It it is the case, we determine -\newcount\grefirstglyph +\newcount\grefirstglyph% % macro to typeset the glyph. attributes are : % #1: character : the character that it must call % #2: height : the height it must be raised : can be negative (must be calculated by a preprocessor) % #3: height of the next note : we define the custo with that % #4: type : the type of glyph, to determine the aligncenter; can be : -%%%%% 0 : one-note glyph or more than two notes glyph except porrectus : here we must put the aligncenter in the middle of the first note -%%%%% 1 : two notes glyph (podatus is considered as a one-note glyph) : here we put the aligncenter in the middle of the glyph -%%%%% 2 : porrectus : has a special align center -%%%%% 3 : initio-debilis : same as 1 but the first note is much smaller -%%%%% 4 : case of a glyph starting with a quilisma -%%%%% 5 : case of a glyph starting with an oriscus -%%%%% 6 : case of a punctum inclinatum -%%%%% 7 : case of a stropha -%%%%% 8 : flexus with an ambitus of one -%%%%% 9 : flexus deminutus +%%%%%%%% 0 : one-note glyph or more than two notes glyph except porrectus : here we must put the aligncenter in the middle of the first note +%%%%%%%% 1 : two notes glyph (podatus is considered as a one-note glyph) : here we put the aligncenter in the middle of the glyph +%%%%%%%% 2 : porrectus : has a special align center +%%%%%%%% 3 : initio-debilis : same as 1 but the first note is much smaller +%%%%%%%% 4 : case of a glyph starting with a quilisma +%%%%%%%% 5 : case of a glyph starting with an oriscus +%%%%%%%% 6 : case of a punctum inclinatum +%%%%%%%% 7 : case of a stropha +%%%%%%%% 8 : flexus with an ambitus of one +%%%%%%%% 9 : flexus deminutus % #5 are the signs to typeset before the glyph (typically additional bars, as they must be "behind" the glyph) % #6 are the signs to typeset after the glyph (almost all signs) \def\greglyph#1#2#3#4#5#6{% \grenewglyphcommon % \setbox\GreTempwidth=\hbox{\gregoriofont #1}% - \newskip\gre@tempwidth \gre@tempwidth=\wd\GreTempwidth % \global\gre@lastglyphwidth=\gre@tempwidth % % the three next lines are a trick to get the additional lines below the glyphs - \kern\gre@lastglyphwidth % + \gre@temp@skip@one = \gre@lastglyphwidth% + \kern\gre@temp@skip@one % #5\relax % - \kern-\gre@lastglyphwidth % + \kern-\gre@temp@skip@one % \gre@calculate@glyphraisevalue{#2}{0}% \raise\gre@glyphraisevalue % \copy\GreTempwidth% @@ -85,28 +85,28 @@ \grefindnotesaligncenter{#4}% \global\grefirstglyph=0% \fi% - %\gre@lastglyphwidth=\gre@tempwidth% - %#5\relax % + %\gre@lastglyphwidth=\gre@tempwidth + %#5\relax #6\relax % \relax% -} +}% % this function is quite simple, it just sets \GreTempwidth with a box of the good width, watch the next function for the complete thing % we define the different alignments possible, of course they depend on the font % the first 10 (0-9) possible values are the same as in glyph -%%%%% 0 : one-note glyph or more than two notes glyph except porrectus : here we must put the aligncenter in the middle of the first note -%%%%% 1 : two notes glyph (podatus is considered as a one-note glyph) : here we put the aligncenter in the middle of the glyph -%%%%% 2 : porrectus : has a special align center -%%%%% 3 : initio-debilis : same as 1 but the first note is much smaller -%%%%% 4 : case of a glyph starting with a quilisma -%%%%% 5 : case of a glyph starting with an oriscus -%%%%% 6 : case of a punctum inclinatum -%%%%% 7 : case of a stropha -%%%%% 8 : flexus with an ambitus of one -%%%%% 9 : flexus deminutus -%%%%% 10 : virgula -%%%%% 11 : divisio minima, minor and maior -%%%%% 12 : divisio finalis +%%%%%%%% 0 : one-note glyph or more than two notes glyph except porrectus : here we must put the aligncenter in the middle of the first note +%%%%%%%% 1 : two notes glyph (podatus is considered as a one-note glyph) : here we put the aligncenter in the middle of the glyph +%%%%%%%% 2 : porrectus : has a special align center +%%%%%%%% 3 : initio-debilis : same as 1 but the first note is much smaller +%%%%%%%% 4 : case of a glyph starting with a quilisma +%%%%%%%% 5 : case of a glyph starting with an oriscus +%%%%%%%% 6 : case of a punctum inclinatum +%%%%%%%% 7 : case of a stropha +%%%%%%%% 8 : flexus with an ambitus of one +%%%%%%%% 9 : flexus deminutus +%%%%%%%% 10 : virgula +%%%%%%%% 11 : divisio minima, minor and maior +%%%%%%%% 12 : divisio finalis % there is a tricky here : if notesaligncenter is not 0, it means that there is a flat before, so we simply add notes aligncenter % #2 is 0 if we are in the context of current syllable, 1 if we are in the context of next syllable \def\grefindsimplenotesaligncenter#1#2{% @@ -151,7 +151,7 @@ \global\setbox\GreTempwidth=\hbox{\gredivisiofinalissymbol}% \fi% \relax% -} +}% % aux function to previous one: sets \GreTempwidth to \hbox{#1} or \hbox{#2} % according to special clivis alignemt scheme. See comments of @@ -198,41 +198,36 @@ \fi% \fi% \fi% -} +}% % the "hat" function, that calls the simple function with the good argument, according to the fact that it's a flat, natural, etc. % warning: the behaviour of all this is quite difficult to understand: this function is called with simple arguments (between 0 and 20) by the glyph function. In this case we add the align center of the argument to notesaligncenter ; and notesaligncenter can be already set to something by flat and natural. \def\grefindnotesaligncenter#1{% \grefindsimplenotesaligncenter{#1}{0}% - \newdimen\gre@tempdim \gre@tempdim=\wd\GreTempwidth % \divide\gre@tempdim by 2\relax % \global\advance\gre@notesaligncenter by \gre@tempdim % \relax % -} +}% % this is the function that we call when we try to determine the next aligncenter of the notes. In this case we call this function with normal arguments if there is no flat nor natural ; we call it with argument + 20 if there is a flat and argument + 40 if there is a natural... I know this is dirty... but... this is TeX... \def\grefindnextnotesaligncenter#1{% \ifnum#1<20\relax % \grefindsimplenotesaligncenter{#1}{1}% - \newdimen\gre@tempdim \gre@tempdim=\wd\GreTempwidth % \divide\gre@tempdim by 2\relax % \global\gre@notesaligncenter=\gre@tempdim % \else %\ifnum#1<20 - \newcount\gretempdimcount \gretempdimcount=#1 % \ifnum#1<40\relax% \advance\gretempdimcount by -20\relax % \grefindsimplenotesaligncenter{\gretempdimcount}{1}% - \newdimen\gre@tempdim \gre@tempdim=\wd\GreTempwidth % \divide\gre@tempdim by 2\relax % \setbox\GreTempwidth=\hbox{\gregoriofont \char 6}% \else%\ifnum#1<40 \advance\gretempdimcount by -40\relax % \grefindsimplenotesaligncenter{\gretempdimcount}{1}% - \newdimen\gre@tempdim \gre@tempdim=\wd\GreTempwidth % \divide\gre@tempdim by 2\relax % \setbox\GreTempwidth=\hbox{\gregoriofont \char 7}% @@ -241,31 +236,31 @@ \global\gre@notesaligncenter=\gre@tempdim % \fi % \relax % -} +}% % box that we will use to determine the width of the notes, to determine wether we typeset a - or not after the letters -\newbox\GreSyllablenotes +\newbox\GreSyllablenotes% \def\gresyllablenotes#1{% \setbox\GreSyllablenotes=\hbox{#1}% \relax% -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of glyphs and notes together -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % box that will contain the text of the syllable -\newbox\GreSyllabletext +\newbox\GreSyllabletext% % count that will be 0 if in the last text there was no dash (or if it is the beginning of a word, and 1 if there was %\newcount\previousdash -\newcount\grefirstsyllableofword -\grefirstsyllableofword=1 +\newcount\grefirstsyllableofword% +\grefirstsyllableofword=1% % we specify if it is the last syllable of the score with that value -\newcount\greendofscore +\newcount\greendofscore% % a helper macro (see details in \gresyllable) \xdef\greboxing{0}% @@ -277,9 +272,9 @@ % the macro we call with all normal text \def\gretextformat#1{% #1\relax % -} +}% -\let\gretextnormal\gretextformat +\let\gretextnormal\gretextformat% % macro to specify a text which is different from #1#2#3 (of \gresyllable). It is useful for % styles, for instance with @@ -303,7 +298,7 @@ % 4: tt % 5: ul \def\gresetfixedtextformat#1{% - \ifcase#1\relax + \ifcase#1\relax% \global\let\grefixedtextformat\gretextnormal % \or % \global\let\grefixedtextformat\greitalic % @@ -318,19 +313,19 @@ \or % \global\let\grefixedtextformat\grecolored % \fi % -} +}% % a function to cancel the previous one \def\greunsetfixedtextformat{% \global\let\grefixedtextformat\gretextnormal % -} +}% \let\grefixedtextformat\gretextnormal % % The same but for the next syllable \def\gresetfixednexttextformat#1{% - \ifcase#1\relax + \ifcase#1\relax% \global\let\grefixednexttextformat\gretextnormal % \or % \global\let\grefixednexttextformat\greitalic % @@ -345,12 +340,12 @@ \or % \global\let\grefixednexttextformat\grecolored % \fi % -} +}% % a function to cancel the previous one \def\greunsetfixednexttextformat{% \global\let\grefixednexttextformat\gretextnormal % -} +}% \let\grefixednexttextformat\gretextnormal % @@ -358,19 +353,19 @@ \gdef\gre@nextfirstsyllablepart{#1}% \gdef\gre@nextmiddlesyllablepart{#2}% \gdef\gre@nextendsyllablepart{#3}% -} +}% -\newcount\gre@englishcentering +\newcount\gre@englishcentering% \def\englishcentering{% \global\gre@englishcentering=1\relax % -} +}% \def\defaultcentering{% \global\gre@englishcentering=0\relax % -} +}% -\defaultcentering +\defaultcentering% %% options about clivis centering scheme. Clivis are usually aligned by their %% center, which is different from most neumes. Gregorio has three modes: @@ -379,22 +374,22 @@ %% 3. align clivis this way, except if: %% - notes would go left of text %% - consonants after vowels are larger than \gre@clivisalignmentmin -\newcount\gre@clivisalignment +\newcount\gre@clivisalignment% \def\clivisalignmentalways{% \global\gre@clivisalignment=0\relax % -} +}% \def\clivisalignmentnever{% \global\gre@clivisalignment=1\relax % -} +}% \def\clivisalignmentspecial{% \global\gre@clivisalignment=2\relax % -} +}% %% by default we use the 3rd mode, it seems closest to Solesmes books -\clivisalignmentspecial +\clivisalignmentspecial% %% general macro : it will typeset the syllable : arguments are : % #1 : the first letters of the syllable, that don't count for the alignment @@ -437,20 +432,17 @@ % there must be at least a certain space between the key and the first note. The first letter can be beneath the key, but not to the left \ifnum\grelastoflinecount=2\relax % \ifnum\gredisableeolshifts=0\relax% - \newdimen\gre@tempdim \gre@tempdim=\gre@intersyllablespace % \advance\gre@tempdim by \gre@begindifference % % a little trick... we don't want to kern more than clefwidth minus minimalspaceatlinebeginning \advance\gre@clefwidth by -\gre@minimalspaceatlinebeginning % \ifdim\gre@tempdim <-\gre@clefwidth % - \newdimen\gre@tempdim \gre@tempdim=-\gre@clefwidth % \fi % \advance\gre@clefwidth by \gre@minimalspaceatlinebeginning % \hbox{}% \advance\gre@tempdim by -\gre@spaceafterlineclef % - \ifdim\the\gre@tempdim < \the\gre@begindifference % - \newdimen\gre@tempdim + \ifdim\gre@tempdim < \gre@begindifference % \gre@tempdim=\the\gre@begindifference % \fi % % Don't allow kern past the beginning of the first line with no initial @@ -459,10 +451,10 @@ \advance\gre@tempdim by \gre@clefwidth % \fi % \fi % - \ifdim\the\gre@tempdim < 0pt% - \kern\the\gre@tempdim % + \ifdim\gre@tempdim < 0pt% + \kern\gre@tempdim % \fi % - %\hskip\gre@afterclefnospace % + %\hskip\gre@afterclefnospace \fi % \else %\ifnum\grelastoflinecount=2 % then we do a kind of trick to separate more the notes of two different syllables : we put a space if we are in the same word (enddifference!=0) if necessary @@ -470,7 +462,6 @@ % and we do it only if it is not the first syllable of a word % but we must not do it when there is a bar before... so when there is a bar enddifference = 0 \ifnum\grefirstsyllableofword=0 % - \newdimen\gre@tempdim \gre@tempdim=\gre@intersyllablespace % \advance\gre@tempdim by \gre@begindifference % \ifdim\gre@enddifference<0pt% @@ -495,7 +486,6 @@ \ifcase#4 % % we enter here if the end of word is 0, so we must determine if we need to type a dash here % we set gretempdim to the actual space between the text of the two syllables. The algorithm is quite complex, but quite similar to the one computing the space between the two syllables several lines above. - \newdimen\gre@tempdim \gre@tempdim=\gre@intersyllablespace % \advance\gre@tempdim by \gre@nextbegindifference % \ifdim\gre@enddifference<0pt% @@ -504,7 +494,6 @@ % there is a small """feature""" here: if the first glyph is an alteration, the algorithm will be quite pessimistic % about the space, so an hyphen may be added when it's not really necessary. \ifdim\gre@tempdim<0pt% - \newdimen\gre@tempdim \gre@tempdim=0pt% \fi % \ifdim\gre@enddifference >0pt% @@ -532,7 +521,8 @@ \fi% ficase#4 % then we reuse temp, we assign to it the \gre@begindifference, but only if it is positive, else it is 0 \ifdim\gre@begindifference > 0 pt% - \kern \gre@begindifference % + \gre@temp@skip@one = \gre@begindifference% + \kern\gre@temp@skip@one % \fi% #8\relax % \raise\gre@textlower \copy\GreSyllabletext % @@ -541,21 +531,21 @@ \gredotranslationcenterend % \xdef\gremustdotranslationcenterend{0}% \fi % - \kern -\wd\GreSyllabletext % - \kern -\gre@begindifference % + \gre@temp@skip@one = -\wd\GreSyllabletext % + \kern\gre@temp@skip@one% + \gre@temp@skip@one = -\gre@begindifference% + \kern\gre@temp@skip@one % % here we need to unset \gregorioattr for the typesetting of notes \gregorioattr=0\relax % % trick: we want to kern -enddifference if necessary before any change of line, which we can achieve only with this trick if the end of line is the last thing of the notes (it's the case of \grelastoflinecount is 1). % For the kern in this case, the base is to kern -\gre@enddifference if it's negative, but we can kern a bit more for the text to get a bit more to the right, but not after the end of the scores minus \gre@minimalspaceatlinebeginning \ifnum\grelastoflinecount=1\relax % \ifdim\the\gre@enddifference <0pt% - \newdimen\gre@tempdim \gre@tempdim=-\gre@enddifference % % we don't do it if it's the last syllable of a score or if the user disabled it \ifnum\gredisableeolshifts=0\relax % \ifnum\greblockcusto=1\else % \setbox\GreTempwidth=\hbox{\grecustochar{g}}% - \newskip\gre@tempwidth \gre@tempwidth=\wd\GreTempwidth % \advance\gre@tempdim by -\gre@tempwidth % \advance\gre@tempdim by -\gre@spacebeforecusto % @@ -563,7 +553,6 @@ \advance\gre@tempdim by \gre@minimalspaceatlinebeginning % \fi % \ifdim\the\gre@tempdim <-\the\gre@enddifference % - \newdimen\gre@tempdim \gre@tempdim=-\the\gre@enddifference % \fi % \xdef\grekernbeforeeol{\the\gre@tempdim\relax}% @@ -575,9 +564,11 @@ %% important, else we are not really at the end of the syllable \grenobreak % \ifnum\grelastoflinecount=1\relax % - \kern\grekernbeforeeol % + \gre@temp@skip@one = \grekernbeforeeol% + \kern\gre@temp@skip@one % \else % - \kern -\gre@enddifference % + \gre@temp@skip@one = -\gre@enddifference% + \kern\gre@temp@skip@one % \fi % \grenobreak % \fi% @@ -611,7 +602,7 @@ \grelocalrightbox{}% \fi\fi % \relax % -} +}% % The only reason of this function is that TeX can't have and in if % #1 is the #4 of syllable @@ -624,7 +615,7 @@ \greendofword{0}% \global\grefirstsyllableofword=1\relax % \fi% - \else %\ifnum\grelastoflinecount=1 % + \else %\ifnum\grelastoflinecount=1 \ifcase#1 % \greendofsyllable% \global\grefirstsyllableofword=0\relax % @@ -633,7 +624,7 @@ \global\grefirstsyllableofword=1\relax % \fi% \fi% -} +}% %a macro to typeset a syllable with only a bar inside \def\grebarsyllable#1#2#3#4#5#6#7#8#9{% @@ -669,16 +660,13 @@ % first we need to determine the real space that there will be between the notes. Here again it is not so simple... let's consider these two kinds of spaces : %% 1/ the minimal space between a note and the bar + the width of the bar + the minimal space between the bar and the note (that's the global idea, in fact there are nuances) : we assign skipone to it %% 2/ enddifference + begindifference + space between notes and word : we assign temp to it - \newskip\gre@skipone \gre@skipone=\gre@notebarspace % \advance\gre@skipone by \gre@notebarspace % \advance\gre@skipone by \wd\GreSyllablenotes % % now let's get temp \ifdim\gre@nextbegindifference < 0 pt% - \newdimen\gre@tempdim \gre@tempdim=-\gre@nextbegindifference % \else % - \newdimen\gre@tempdim \gre@tempdim=0 pt% \fi % \ifdim\gre@previousenddifference < 0 pt% @@ -689,16 +677,13 @@ \fi% % we take the max of it, then we divide it by two and we substract half of the width of the bar \ifdim\gre@skipone <\gre@tempdim % - \newskip\gre@skipone \gre@skipone=\gre@tempdim % \fi % \divide\gre@skipone by 2\relax % - \newdimen\gre@tempdim \gre@tempdim=\wd\GreSyllablenotes % \divide\gre@tempdim by 2\relax % \advance\gre@skipone by -\gre@tempdim % % now we have our skipone - \newdimen\gre@tempdim \gre@tempdim=\gre@skipone % \ifdim\gre@previousenddifference < 0 pt% \advance\gre@tempdim by \gre@previousenddifference % @@ -707,7 +692,8 @@ \ifdim\gre@tempdim > -\wd\GreSyllablenotes % \kern\gre@tempdim % \else % - \kern -\wd\GreSyllablenotes % + \gre@temp@skip@one = -\wd\GreSyllablenotes % + \kern\gre@temp@skip@one% \fi % \grenobreak % #8\relax % @@ -720,37 +706,37 @@ \grepenalty{\greendafterbaraltpenalty }% TODO: isn't it a bit buggy? \ifdim\gre@tempdim < -\wd\GreSyllablenotes % \ifdim\gre@nextbegindifference > 0 pt% - \hskip\gre@interwordspacetextnotes % + \gre@temp@skip@one = \gre@interwordspacetextnotes% + \hskip\gre@temp@skip@one % \else % \ifdim\gre@nextbegindifference > 0 pt - \hskip\gre@interwordspacetext % + \gre@temp@skip@one = \gre@interwordspacetext% + \hskip\gre@temp@skip@one % \fi % \else % \ifdim\gre@tempdim < -\wd\GreSyllablenotes - %\gre@tempdim=\wd\GreSyllablenotes % - %\divide\gre@tempdim by 2\relax % - %\kern -\gre@tempdim % - \newdimen\gre@tempdim + %\gre@tempdim=\wd\GreSyllablenotes + %\divide\gre@tempdim by 2\relax + %\kern -\gre@tempdim \gre@tempdim=\gre@skipone % \ifdim\gre@nextbegindifference < 0 pt% \advance\gre@tempdim by \gre@nextbegindifference % \fi % \ifdim\gre@tempdim > -\wd\GreSyllablenotes % \kern\gre@tempdim % - \else % \ifdim\gre@tempdim > -\wd\GreSyllablenotes % - \grehskip -\wd\GreSyllablenotes % + \else % \ifdim\gre@tempdim > -\wd\GreSyllablenotes + \gre@temp@skip@one = -\wd\GreSyllablenotes % + \grehskip\gre@temp@skip@one% \fi % \fi % % then the most simple : the case where there is something to write under the bar. We just need to adjust the spaces. - \else %ifdim\wd\GreSyllabletext = 0 pt % + \else %ifdim\wd\GreSyllabletext = 0 pt % I'm a little lazy for now, I won't make the usual mountain of ifs... TODO: use different spaces - \newskip\gre@skipone \gre@skipone=\gre@textbartextspace % % same code as in syllable - \newdimen\gre@tempdim \gre@tempdim=\gre@begindifference % \ifdim\gre@tempdim > 0 pt% \advance\gre@skipone by \gre@tempdim % \fi% - %\kern\gre@skipone % + %\kern\gre@skipone #8\relax % \raise\gre@textlower \copy\GreSyllabletext % \ifnum\gremustdotranslationcenterend=1\relax % @@ -758,19 +744,22 @@ \gredotranslationcenterend % \xdef\gremustdotranslationcenterend{0}% \fi % - \kern -\wd\GreSyllabletext % - \kern -\gre@begindifference % + \gre@temp@skip@one = -\wd\GreSyllabletext % + \kern\gre@temp@skip@one% + \gre@temp@skip@one = -\gre@begindifference% + \kern\gre@temp@skip@one % #9% we do that instead of \unhbox\Syllablnotes, because it would not set the \localrightbox \ifdim\the\gre@enddifference <0pt% %% important, else we are not really at the end of the syllable - \kern -\gre@enddifference % + \gre@temp@skip@one = -\gre@enddifference% + \kern\gre@temp@skip@one % \fi% % end of same code as syllable \ifnum\grelastoflinecount=1\relax % \global\grelastoflinecount=2\relax % \greendafterbar{0}% \else % - %\global\grelastoflinecount=0\relax % + %\global\grelastoflinecount=0\relax \greendafterbar{1}% \fi % %and that's it !! @@ -782,35 +771,35 @@ \grelocalrightbox{}% \fi\fi % \relax% -} +}% %% Finally we don't use it, because syllables never cross, I keep it, just in case... % macro that will calculate the shift that we apply at the beginning, to combine two syllables of the same note % arguments are : % #1: \begindifferrence, defined above % but the macro also uses \gre@previousenddifference, \previousdash (not yet) -%\def\setsyllableshift#1{% -%\the\gre@previousenddifference % -%\ifdim\gre@previousenddifference >0pt % -%\hskip\intersyllablenotesspace % -%\ifdim-#1<\gre@previousenddifference % -%\kern #1% -%test1 % -%\else% -%\kern -\gre@previousenddifference % -%test2% -%\fi% -%\else% +%\def\setsyllableshift#1{ +%\the\gre@previousenddifference +%\ifdim\gre@previousenddifference >0pt +%\hskip\intersyllablenotesspace +%\ifdim-#1<\gre@previousenddifference +%\kern #1 +%test1 +%\else +%\kern -\gre@previousenddifference +%test2 +%\fi +%\else % we test if begin > end - intersyllablespace -%\gre@tempdim=\gre@previousenddifference % -%\advance\gre@tempdim by \intersyllablenotesspace % -%\ifdim#1 >\gre@tempdim % -%\kern #1 % -%test3% -%\else% -%\kern\gre@tempdim% -%test4% -%\fi% -%\fi% +%\gre@tempdim=\gre@previousenddifference +%\advance\gre@tempdim by \intersyllablenotesspace +%\ifdim#1 >\gre@tempdim +%\kern #1 +%test3 +%\else +%\kern\gre@tempdim +%test4 +%\fi +%\fi %} diff --git a/tex/gregoriotex-symbols.tex b/tex/gregoriotex-symbols.tex index dbf94a7f9..b43cd115a 100644 --- a/tex/gregoriotex-symbols.tex +++ b/tex/gregoriotex-symbols.tex @@ -1,149 +1,149 @@ -%GregorioTeX file. -%Copyright (C) 2008-2009 Elie Roux +%GregorioTeX file.% +%Copyright (C) 2008-2009 Elie Roux % % -%This program is free software: you can redistribute it and/or modify -%it under the terms of the GNU General Public License as published by -%the Free Software Foundation, either version 3 of the License, or -%(at your option) any later version. +%This program is free software: you can redistribute it and/or modify% +%it under the terms of the GNU General Public License as published by% +%the Free Software Foundation, either version 3 of the License, or% +%(at your option) any later version.% % -%This program is distributed in the hope that it will be useful, -%but WITHOUT ANY WARRANTY; without even the implied warranty of -%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%GNU General Public License for more details. +%This program is distributed in the hope that it will be useful,% +%but WITHOUT ANY WARRANTY; without even the implied warranty of% +%MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% +%GNU General Public License for more details.% % -%You should have received a copy of the GNU General Public License -%along with this program. If not, see . +%You should have received a copy of the GNU General Public License% +%along with this program. If not, see .% -% this file contains definitions of the symbols +% this file contains definitions of the symbols% -\gredeclarefileversion{gregoriotex-symbols.tex}% - {\directlua{tex.write(gregoriotex.get_greapiversion())}} +\gredeclarefileversion{gregoriotex-symbols.tex}%% + {\directlua{tex.write(gregoriotex.get_greapiversion())}}% -% a temp counter -\newcount\gretempfactor % +% a temp counter% +\newcount\gretempfactor %% -% First we load the font at the current font size and remember the size it's been loaded at -\font\gregoriosymbolfont="name:gresym" at \f@size pt -\let\current\f@size +% First we load the font at the current font size and remember the size it's been loaded at% +\font\gregoriosymbolfont="name:gresym" at \f@size pt% +\let\current\f@size% -% This macro checks to see if the symbol font is loaded at the current font size and reloads it if it is not. We'll run it at the beginning of each symbol command. -\def\gre@reloadgresym{ - \ifx\f@size\current\relax% - \relax - \else - \font\gregoriosymbolfont="name:gresym" at \f@size pt - \let\current\f@size - \fi -} +% This macro checks to see if the symbol font is loaded at the current font size and reloads it if it is not. We'll run it at the beginning of each symbol command.% +\def\gre@reloadgresym{% + \ifx\f@size\current\relax%% + \relax% + \else% + \font\gregoriosymbolfont="name:gresym" at \f@size pt% + \let\current\f@size% + \fi% +}% %%%%%%%%%% -%% symbols +%% symbols% %%%%%%%%%% -% the macros to typeset the A, R and V with bar -\def\Abar{% - \gre@reloadgresym - {\gregoriosymbolfont \char 64}% - \relax% -} - -\def\Rbar{% - \gre@reloadgresym - {\gregoriosymbolfont \char 65}% - \relax% -} - -\def\Vbar{% - \gre@reloadgresym - {\gregoriosymbolfont \char 66}% - \relax% -} - -% a V with bar more adapted to small text -\def\Vbarsmall{% - \gre@reloadgresym - {\gregoriosymbolfont \char 72}% - \relax% -} - -% bars for the letters - -\def\greletterbar{% - \gre@reloadgresym - {\gregoriosymbolfont \char 73}% - \relax% -} - -\def\greletteraltbar{% - \gre@reloadgresym - {\gregoriosymbolfont \char 74}% - \relax% -} - -% the gothic R and V -\def\gothRbar{% - \gre@reloadgresym - {\gregoriosymbolfont \char 77}% - \relax% -} - -\def\gothVbar{% - \gre@reloadgresym - {\gregoriosymbolfont \char 78}% - \relax% -} - -% the macro to typeset a dagger -\def\gredagger{% - \gre@reloadgresym - {\gregoriosymbolfont \char 43}% - \relax% -} - -% macro to typeset a (malt) cross -\def\grecross{% - \gre@reloadgresym - {\gregoriosymbolfont \char 70}% - \relax% -} - -\def\grealtcross{% - \gre@reloadgresym - {\gregoriosymbolfont \char 84}% - \relax% -} - -%stars -\def\greheightstar{% - \gre@reloadgresym - {\gregoriosymbolfont \char 69}% - \relax % -} - -\def\gresixstar{% - \gre@reloadgresym - {\gregoriosymbolfont \char 42}% - \relax % -} - -\def\grestar{% - \gre@reloadgresym - \gresixstar % - \relax% -} +% the macros to typeset the A, R and V with bar% +\def\Abar{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 64}%% + \relax%% +}% + +\def\Rbar{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 65}%% + \relax%% +}% + +\def\Vbar{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 66}%% + \relax%% +}% + +% a V with bar more adapted to small text% +\def\Vbarsmall{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 72}%% + \relax%% +}% + +% bars for the letters% + +\def\greletterbar{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 73}%% + \relax%% +}% + +\def\greletteraltbar{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 74}%% + \relax%% +}% + +% the gothic R and V% +\def\gothRbar{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 77}%% + \relax%% +}% + +\def\gothVbar{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 78}%% + \relax%% +}% + +% the macro to typeset a dagger% +\def\gredagger{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 43}%% + \relax%% +}% + +% macro to typeset a (malt) cross% +\def\grecross{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 70}%% + \relax%% +}% + +\def\grealtcross{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 84}%% + \relax%% +}% + +%stars% +\def\greheightstar{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 69}%% + \relax %% +}% + +\def\gresixstar{%% + \gre@reloadgresym% + {\gregoriosymbolfont \char 42}%% + \relax %% +}% + +\def\grestar{%% + \gre@reloadgresym% + \gresixstar %% + \relax%% +}% %%%%%%%%% -% Lines % +% Lines %% %%%%%%%%% -%Unlike the character symbols above, we require that the font size be specified when using the lines. - -%lines -%#1 is the type of line (1-5) -%#2 is the number of pt of the font it will use -\def\gresep#1#2{% - \gretempfactor=#1% we're reusing tempfactor - \advance \gretempfactor by 78\relax % - {\font\grelinefont="name:gresym" at #2pt\grelinefont \char \gretempfactor}% - \relax% -} +%Unlike the character symbols above, we require that the font size be specified when using the lines.% + +%lines% +%#1 is the type of line (1-5)% +%#2 is the number of pt of the font it will use% +\def\gresep#1#2{%% + \gretempfactor=#1% we're reusing tempfactor% + \advance \gretempfactor by 78\relax %% + {\font\grelinefont="name:gresym" at #2pt\grelinefont \char \gretempfactor}%% + \relax%% +}% diff --git a/tex/gregoriotex.lua b/tex/gregoriotex.lua index c694460a7..84efde32e 100644 --- a/tex/gregoriotex.lua +++ b/tex/gregoriotex.lua @@ -21,7 +21,7 @@ local hpack, traverse_id, has_attribute, count, remove, insert_after, copy = nod gregoriotex = gregoriotex or {} local gregoriotex = gregoriotex -local internalversion = 20150220 +local internalversion = 20150311 local err, warn, info, log = luatexbase.provides_module({ name = "gregoriotex", diff --git a/tex/gregoriotex.tex b/tex/gregoriotex.tex index 274d49cfe..b01cb1c64 100644 --- a/tex/gregoriotex.tex +++ b/tex/gregoriotex.tex @@ -16,124 +16,124 @@ % this file contains definitions for lines, initial, fonts, etc. -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% %% engine checking -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% -\expandafter\ifx\csname RequirePackage\endcsname\relax - \input ifluatex.sty - \input luatexbase.sty - \input luaotfload.sty +\expandafter\ifx\csname RequirePackage\endcsname\relax% + \input ifluatex.sty% + \input luatexbase.sty% + \input luaotfload.sty% \input graphicx.sty % for \resizebox - \input xstring.sty - \def\greerror#1{\errmessage{GregorioTeX error: #1}} - \def\gre@warning#1{\message{GregorioTeX warning: #1}} -\else - \RequirePackage{ifluatex} + \input xstring.sty% + \def\greerror#1{\errmessage{GregorioTeX error: #1}}% + \def\gre@warning#1{\message{GregorioTeX warning: #1}}% +\else% + \RequirePackage{ifluatex}% \RequirePackage{graphicx}% for \resizebox - \RequirePackage{luatexbase} - \RequirePackage{luaotfload} - \RequirePackage{xstring} - \def\greerror#1{\PackageError{GregorioTeX}{#1}{}} - \def\gre@warning#1{\PackageWarning{GregorioTeX}{#1}} -\fi + \RequirePackage{luatexbase}% + \RequirePackage{luaotfload}% + \RequirePackage{xstring}% + \def\greerror#1{\PackageError{GregorioTeX}{#1}{}}% + \def\gre@warning#1{\PackageWarning{GregorioTeX}{#1}}% +\fi% -\ifluatex\else - \greerror{Error: this document must be compiled with LuaTeX (lualatex)} -\fi +\ifluatex\else% + \greerror{Error: this document must be compiled with LuaTeX (lualatex)}% +\fi% % Since TeXLive 2009, the extra primitives of LuaTeX have a luatex prefix, and are not % available without prefix. We mostly rely on \directlua that is still available % without prefix, but we also rely on the Omega primitives, that have a luatex % prefix in TeXLive 2009. -\let\grelocalleftbox\luatexlocalleftbox -\let\grelocalrightbox\luatexlocalrightbox +\let\grelocalleftbox\luatexlocalleftbox% +\let\grelocalrightbox\luatexlocalrightbox% % an attribute we put on the text nodes. % if it is 1, it means that there may be a dash here if this syllable is at the end of a line % if it is 2, it means that it's never useful to typeset a dash % if it is 0, it just means that we are in a score... -\newluatexattribute\gregorioattr -\def\greunsetattribute{\unsetluatexattribute{\gregorioattr}} +\newluatexattribute\gregorioattr% +\def\greunsetattribute{\unsetluatexattribute{\gregorioattr}}% % an attribute used for translation centering -\newluatexattribute\gregoriocenterattr +\newluatexattribute\gregoriocenterattr% -\RequireLuaModule{gregoriotex} +\RequireLuaModule{gregoriotex}% % The general version of GregorioTeX (we mean by that the "API", the way % Gregorio will write things) -\xdef\gregoriotexversion{\directlua{tex.write(gregoriotex.get_greapiversion())}} +\xdef\gregoriotexversion{\directlua{tex.write(gregoriotex.get_greapiversion())}}% % the version of the internal files (all must have the same) \xdef\greinternalversion{\directlua{tex.write(gregoriotex.get_greapiversion())}} % date format -\directlua{gregoriotex.check_version(\number\greinternalversion)} +\directlua{gregoriotex.check_version(\number\greinternalversion)}% % first some macros to allow checks for version: % #1 is the name of the file % #2 is the version \def\gredeclarefileversion#1#2{% \ifnum\number#2=\number\greinternalversion\else % - \greerror{uncoherent file versions: gregoriotex.tex is in version \number\greinternalversion \space\space while #1 is in version \number#2} + \greerror{uncoherent file versions: gregoriotex.tex is in version \number\greinternalversion \space\space while #1 is in version \number#2}% \fi % -} +}% % macro called by scores % #1 is the version of GregorioTeX the score is made for. \def\gregoriotexapiversion#1{% \ifnum\number#1=\number\gregoriotexversion\else % - \greerror{GregorioTeX is in version \number\gregoriotexversion \space\space while a score you included requires version \number#1. Please recompile your scores} + \greerror{GregorioTeX is in version \number\gregoriotexversion \space\space while a score you included requires version \number#1. Please recompile your scores}% \fi % -} +}% -%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%% %% aux file definitions -%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%% % for now, we only use an aux file with LuaTeX -\ifluatex - \newwrite\Greaux -\fi +\ifluatex% + \newwrite\Greaux% +\fi% \def\grewriteaux#1{% \write\Greaux{#1}% \relax % -} +}% \def\opengreaux{% \openout\Greaux \jobname .gaux\relax% -} +}% \def\closegreaux{% \closeout\Greaux % -} +}% -%%%%%%%%%%%%%% +%%%%%%%%%%%%%%% %% basic start -%%%%%%%%%%%%%% +%%%%%%%%%%%%%%% % factor is the factor with which you open you font (the number after the at). It will decide almost everything (spaces, etc.), so it is particularly important. % at the beginning it is set to 0, but if it is still 0 when begingregorianscore is called, it is set to the default value : 17 (the value that makes it look like a standard graduale) -\newcount\grefactor -\grefactor=17 +\newcount\grefactor% +\grefactor=17% -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% %% vertical spaces -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% -\input gregoriotex-spaces.tex +\input gregoriotex-spaces.tex% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for additionnal vertical spaces -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %macro to call if you want to go to the next line simply \def\grenewline{% \grenewlinecommon{0}{0}{0}{0}{0}% \relax% -} +}% % macro called to go to the next line but when there are additional vertical spaces to add %% 1: can be 0, 1 or 2 or 3. 1 is when there is a note above the 4th line, 2 when there is a note on the 5th line, and 3 when there is a note above the 5th line @@ -143,7 +143,7 @@ \def\grenewlinewithspace#1#2#3#4{% \grenewlinecommon{#1}{#2}{#3}{0}{#4}% \relax% -} +}% % basically same macros as above, but these one do a \hfill, the lines are not justified @@ -151,14 +151,14 @@ \def\grenewparline{% \grenewlinecommon{0}{0}{0}{1}{0}% \relax% -} +}% \def\grenewparlinewithspace#1#2#3#4{% \grenewlinecommon{#1}{#2}{#3}{1}{#4}% -} +}% % a macro describing a kern to make before ending the line, which we sometimes want (see \syllable) -\xdef\grekernbeforeeol{0pt\relax} +\xdef\grekernbeforeeol{0pt\relax}% % the macro we call each time we force a changing of line, it automatically sets \greknownline, and adjusts left spaces \def\grenewlinecommon#1#2#3#4#5{% @@ -166,7 +166,8 @@ \grelocalrightbox{}% \fi\fi % % sometimes we need to add a space before ending the line: - \kern\grekernbeforeeol\relax % + \gre@temp = \grekernbeforeeol\relax% + \kern\gre@temp % \ifnum\greboxing=0\relax % \ifnum\grebiginitial=1\relax % \ifcase\greknownline % @@ -199,85 +200,82 @@ \grepenalty{-10001}% \fi % \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of text -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macro that sets \gre@tempwidth to the width of its argument -\newbox\GreTempwidth +\newbox\GreTempwidth% \def\grewidthof#1{% \setbox\GreTempwidth=\hbox{#1}% - \newskip\gre@tempwidth \global\gre@tempwidth=\wd\GreTempwidth% \relax% -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of the initial -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% box containing the initial, and dimen containing its width (and the width of the space after) -\newbox\GreInitial +\newbox\GreInitial% % grebiginitial means that the inital takes two lines -\newcount\grebiginitial +\newcount\grebiginitial% % greknownline is the line we think we are in -\newcount\greknownline +\newcount\greknownline% % macro to call before the call of \initial \def\gresetbiginitial{% \global\grebiginitial=1\relax % \relax % -} +}% % macro to cancel before the call of \initial \def\grenormalinitial{% \global\grebiginitial=0\relax % \relax % -} +}% % macro to call before the first syllable, but after setinitialclef \def\greadjustsecondline{% \gre@additionalleftspace=\gre@initialwidth % \greupdateleftbox % \relax % -} +}% % macro to call during the second line \def\greadjustthirdline{% \gre@additionalleftspace= 0 pt% \greupdateleftbox % \relax % -} +}% \def\greupdateleftbox{% \greupdatelinewidth % \greupdatelinesclef % -} +}% \def\greupdatelinewidth{% \ifdim\gre@additionalleftspace=0pt% \else % - \newskip\gre@tempdim \gre@tempdim=\gre@stafflinewidth % \global\advance\gre@stafflinewidth by -\gre@additionalleftspace % \gregeneratelines % \global\gre@stafflinewidth=\gre@tempdim % \fi % -} +}% \def\greinitial#1{% % see comments on this function to see what it does \gre@calculate@aboveinitialraise % % we print the initial always at the same place, and the we print the GreAboveinitialfirstbox centered % first we print the initial - \newskip\gre@tempdim \gre@tempdim=-\gre@textlower % % if it is a big initial we print it on the second line \ifnum\grebiginitial=0\relax % @@ -285,14 +283,14 @@ \ifdim\gre@manualinitialwidth=0 pt\relax% \global\gre@initialwidth=\wd\GreInitial % \else% - \global\gre@initialwidth=\gre@manualinitialwidth% - \fi + \greinitialformat{\global\gre@initialwidth=\gre@manualinitialwidth}% + \fi% \ifdim\wd\GreAboveinitialfirstbox>\gre@initialwidth\relax% - \global\gre@initialwidth=\wd\GreAboveinitialfirstbox - \fi + \global\gre@initialwidth=\wd\GreAboveinitialfirstbox% + \fi% \ifdim\wd\GreAboveinitialsecondbox>\gre@initialwidth\relax% - \global\gre@initialwidth=\wd\GreAboveinitialsecondbox - \fi + \global\gre@initialwidth=\wd\GreAboveinitialsecondbox% + \fi% \setbox\GreInitial=\hbox to \gre@initialwidth {\hss\raise -\gre@tempdim\hbox{\greinitialformat{#1}}\hss}% \else % \advance\gre@tempdim by \gre@additionalbottomspace % @@ -305,29 +303,39 @@ \ifdim\gre@manualinitialwidth=0 pt\relax% \global\gre@initialwidth=\wd\GreInitial % \else% - \global\gre@initialwidth=\gre@manualinitialwidth% - \fi + \grebiginitialformat{\global\gre@initialwidth=\gre@manualinitialwidth}% + \fi% \ifdim\wd\GreAboveinitialfirstbox>\gre@initialwidth\relax% - \global\gre@initialwidth=\wd\GreAboveinitialfirstbox - \fi + \global\gre@initialwidth=\wd\GreAboveinitialfirstbox% + \fi% \ifdim\wd\GreAboveinitialsecondbox>\gre@initialwidth\relax% - \global\gre@initialwidth=\wd\GreAboveinitialsecondbox - \fi + \global\gre@initialwidth=\wd\GreAboveinitialsecondbox% + \fi% \setbox\GreInitial=\hbox{\vbox to 0pt{\hbox to \gre@initialwidth {\hss\raise -\gre@tempdim\hbox{\grebiginitialformat{#1}}\hss}\vss}}% \fi % - \hskip\gre@beforeinitialshift % + \ifnum\grebiginitial=0\relax% + \greinitialformat{\global\gre@temp = \gre@beforeinitialshift}% + \else% + \grebiginitialformat{\global\gre@temp = \gre@beforeinitialshift}% + \fi% + \hskip\gre@temp % + \global\advance\gre@initialwidth by \gre@temp % \copy\GreInitial% - \hskip\gre@afterinitialshift % - \global\advance\gre@initialwidth by \gre@afterinitialshift% - \global\advance\gre@initialwidth by \gre@beforeinitialshift % + \ifnum\grebiginitial=0\relax% + \greinitialformat{\global\gre@temp = \gre@afterinitialshift}% + \else% + \grebiginitialformat{\global\gre@temp = \gre@afterinitialshift}% + \fi% + \hskip\gre@temp % + \global\advance\gre@initialwidth by \gre@temp% % then we center the first box above the initial, if there is one \ifdim\wd\GreAboveinitialfirstbox=0 pt\relax % \else % - \newskip\gre@tempdim \gre@tempdim=\gre@initialwidth % \advance\gre@tempdim by -\wd\GreAboveinitialfirstbox % \divide\gre@tempdim by 2 % - \hskip -\gre@initialwidth % + \gre@temp = -\gre@initialwidth% + \hskip\gre@temp % \kern\gre@tempdim % \raise\gre@aboveinitialfirstraise\copy\GreAboveinitialfirstbox % \kern\gre@tempdim % @@ -336,30 +344,31 @@ % then we center the second box above the initial, if there is one \ifdim\wd\GreAboveinitialsecondbox=0 pt\relax % \else % - \newskip\gre@tempdim + \newskip\gre@tempdim% \gre@tempdim=\gre@initialwidth % \advance\gre@tempdim by -\wd\GreAboveinitialsecondbox % \divide\gre@tempdim by 2 % - \hskip -\gre@initialwidth % + \gre@temp = -\gre@initialwidth% + \hskip\gre@temp % \kern\gre@tempdim % \raise\gre@aboveinitialsecondraise\copy\GreAboveinitialsecondbox % \kern\gre@tempdim % \setbox\GreAboveinitialsecondbox=\hbox{}% \fi % \relax % -} +}% \def\grenoinitial{% \setbox\GreInitial=\hbox{}% \global\gre@initialwidth=0pt % \global\grelastoflinecount=2\relax % \relax % -} +}% % We set two boxes for the two lines above the initial -\newbox\GreAboveinitialfirstbox -\newbox\GreAboveinitialsecondbox +\newbox\GreAboveinitialfirstbox% +\newbox\GreAboveinitialsecondbox% % the height difference between the bottom of the first annotation line and the top of the second annotation line (above the initial) is controlled by the \gre@aboveinitialseparation space, in gregoriotex-spaces.tex \def\gresetfirstlineaboveinitial#1#2{% @@ -369,38 +378,38 @@ \global\gre@aboveinitialfirstraise=-\ht\GreAboveinitialfirstbox % \global\setbox\GreAboveinitialfirstbox=\hbox{#1}% \relax % -} +}% \def\gresetfirstannotation#1{% \gresetfirstlineaboveinitial{#1}{#1}% \relax % -} +}% -\let\setfirstannotation\gresetfirstannotation +\let\setfirstannotation\gresetfirstannotation% \def\gresetsecondannotation#1{% \setbox\GreAboveinitialsecondbox=\hbox{#1}% \global\gre@aboveinitialsecondraise=-\ht\GreAboveinitialsecondbox % \global\advance\gre@aboveinitialsecondraise by -\gre@aboveinitialseparation % \relax % -} +}% -\let\setsecondannotation\gresetsecondannotation +\let\setsecondannotation\gresetsecondannotation% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the score reference (unused) -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\grescorereference#1{} +\def\grescorereference#1{}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting the things above the initial -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\writemode#1{% \gresetfirstlineaboveinitial{\sc{\bf{#1}}}{\sc{\bf{#1}}}% \relax % -} +}% \def\gregorianmode#1{% \ifhbox \GreAboveinitialfirstbox% @@ -426,11 +435,11 @@ \fi% \fi% \relax% -} +}% \def\scorereference#1{% \relax% -} +}% %% macro that draws the lines : starts by the first and then draws the lines of every line. %% has to be called before drawing the key, after drawing the initial @@ -441,41 +450,43 @@ \copy\GreLines % }% \relax % -} +}% \def\commentary#1{% \vbox{\hfill\hbox{#1}}% \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macro for putting text above lines for annotations and the like -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% additional space for the text above lines +% format for text above the lines \def\greabovelinestextstyle#1{% #1\relax % -} +}% % set space above the text lines - almost the same as for the translation \def\greaddspaceabove{% - \global\gre@currentabovelinestextheight=\gre@abovelinestextheight % - \gregeneratelines % - \relax % -} + \greabovelinestextstyle{% + \global\gre@currentabovelinestextheight=\gre@abovelinestextheight % + \gregeneratelines % + }% + \relax % +}% % we don't need space above any more \def\greremovespaceabove{% \global\gre@currentabovelinestextheight=0 sp% \gregeneratelines % \relax % -} +}% % the code is a bit strange here: we always execute \gre@spaceabovelines at the beginning of a glyph. This will: % - typeset the text above the lines if relevant, and making sure we execute it only once % - not do anything else -\xdef\grecurrenttextabovelines{} +\xdef\grecurrenttextabovelines{}% \def\gresettextabovelines#1{% \gdef\grecurrenttextabovelines{% @@ -483,12 +494,11 @@ \gdef\grecurrenttextabovelines{}% \relax % }% -} +}% % typesets the text above the line \def\gretypesettextabovelines#1{% - \newskip\gre@tempdim - \gre@tempdim=\gre@abovelinestextraise % + \greabovelinestextstyle{\gre@tempdim=\gre@abovelinestextraise} % \advance\gre@tempdim by 4\gre@stafflineheight % \advance\gre@tempdim by 4\gre@interstafflinespace % \advance\gre@tempdim by \gre@spacebeneathtext % @@ -497,30 +507,31 @@ \advance\gre@tempdim by \gre@additionalbottomspace % \leavevmode\raise\gre@tempdim\hbox to 0pt{\greabovelinestextstyle{#1}\hss}% \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of the lines -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% first a macro to prevent the typesetting of the lines (useful for some people) -\xdef\greremovelinescount{0} +\xdef\greremovelinescount{0}% \def\greremovelines{% \xdef\greremovelinescount{1}% \relax % -} +}% \def\gredonotremovelines{% \xdef\greremovelinescount{0}% \relax % -} +}% %% macro that draws the stafflines on the first line, it is different from others due to the initial that can take some place, without lines \def\gredrawfirstlines{% \advance\gre@stafflinewidth by -\gre@initialwidth% - %\gre@initialwidth=0pt% - \hbox to0pt{% +% \advance\gre@stafflinewidth by -\gre@minimalspaceatlinebeginning + %\gre@initialwidth=0pt + \hbox to 0pt{% \vbox{% \grenormalstafflinesformat % \vskip\gre@currentabovelinestextheight % @@ -530,19 +541,22 @@ \else % \vskip\gre@stafflineheight % \fi % - \kern\the\gre@interstafflinespace % + \gre@temp = \gre@interstafflinespace% + \kern\gre@temp % \ifnum\greremovelinescount=0\relax % \hrule height \gre@stafflineheight width \gre@stafflinewidth % \else % \vskip\gre@stafflineheight % \fi % - \kern\the\gre@interstafflinespace % + \gre@temp = \gre@interstafflinespace% + \kern\gre@temp % \ifnum\greremovelinescount=0\relax % \hrule height \gre@stafflineheight width \gre@stafflinewidth % \else % \vskip\gre@stafflineheight % \fi % - \kern\the\gre@interstafflinespace % + \gre@temp = \gre@interstafflinespace% + \kern\gre@temp % \ifnum\greremovelinescount=0\relax % \hrule height \gre@stafflineheight width \gre@stafflinewidth % \else % @@ -557,14 +571,14 @@ }% \gre@stafflinewidth=\gre@linewidth% \relax% -} +}% %% box containing the stafflines for other lines than the first -\newbox\GreLines +\newbox\GreLines% % macro that must be called at each change of linewidth and grefactor \def\gregeneratelines{% - \setbox\GreLines=\hbox to0pt{% + \setbox\GreLines=\hbox to 0pt{% \vbox{% \grenormalstafflinesformat % \vskip\gre@spaceabovelines % @@ -574,19 +588,22 @@ \else % \vskip\gre@stafflineheight % \fi % - \kern\the\gre@interstafflinespace % + \gre@temp = \gre@interstafflinespace% + \kern\gre@temp % \ifnum\greremovelinescount=0\relax % \hrule height \gre@stafflineheight width \gre@stafflinewidth % \else % \vskip\gre@stafflineheight % \fi % - \kern\the\gre@interstafflinespace % + \gre@temp = \gre@interstafflinespace% + \kern\gre@temp % \ifnum\greremovelinescount=0\relax % \hrule height \gre@stafflineheight width \gre@stafflinewidth % \else % \vskip\gre@stafflineheight % \fi % - \kern\the\gre@interstafflinespace % + \gre@temp = \gre@interstafflinespace% + \kern\gre@temp % \ifnum\greremovelinescount=0\relax % \hrule height \gre@stafflineheight width \gre@stafflinewidth % \else % @@ -600,61 +617,59 @@ \hss% }% \relax % -} +}% % macro called when the initial is big, and so when the second line is at the same level as the first \def\gresmallsecondline{% - \newskip\gre@tempdim \gre@tempdim=\gre@stafflinewidth % \global\advance\gre@stafflinewidth by -\gre@initialwidth % \gregeneratelines % \global\gre@stafflinewidth=\gre@tempdim % \relax % -} +}% % macro called when we are after the second line of a big initial, to have normal lines back \def\grenormallines{% \global\gre@stafflinewidth=\gre@linewidth % \gregeneratelines % \relax % -} +}% -\input gregoriotex-chars.tex +\input gregoriotex-chars.tex% -\input gregoriotex-signs.tex +\input gregoriotex-signs.tex% -\input gregoriotex-syllable.tex +\input gregoriotex-syllable.tex% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the translations -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\xdef\gretranslationcenteringscheme{0} +\xdef\gretranslationcenteringscheme{0}% -\def\setgretranslationcenteringscheme#1{ +\def\setgretranslationcenteringscheme#1{% \xdef\gretranslationcenteringscheme{\number #1}% -} +}% -\xdef\grenlbintranslation{0} +\xdef\grenlbintranslation{0}% \def\gresetnlbintranslation#1{% \xdef\grenlbintranslation{\number #1}% -} +}% \def\grewritetranslation#1{% \ifnum\gretranslationcenteringscheme=0\relax % \raise\gre@spacebeneathtext\hbox to 0pt{\vbox to 0pt{\vss\hbox to 0pt{\gretranslationformat{#1}\hss}}}% \else % - \newskip\gre@tempdim \gre@tempdim=\wd\GreSyllabletext % \setbox\GreTempwidth=\hbox{#1}% \advance\gre@tempdim by -\wd\GreTempwidth % \divide\gre@tempdim by 2\relax % - \kern \gre@tempdim % + \kern\gre@tempdim % \raise\gre@spacebeneathtext\hbox to 0pt{\vbox to 0pt{\vss\hbox to 0pt{\gretranslationformat{#1}\hss}}}% - \kern -\gre@tempdim % + \kern-\gre@tempdim % \fi % -} +}% \def\grewritetranslationwithcenterbeginning#1{% \ifnum\grenlbintranslation=1\relax % @@ -664,14 +679,14 @@ \raise\gre@spacebeneathtext\hbox to 0pt{\kern 0pt\vbox to 0pt{\vss\hbox to 0pt{\gretranslationformat{#1}\hss}}\kern 0pt}% \unsetluatexattribute{\gregoriocenterattr}% \relax % -} +}% -\xdef\gremustdotranslationcenterend{0} +\xdef\gremustdotranslationcenterend{0}% \def\gretranslationcenterend{% \xdef\gremustdotranslationcenterend{1}% \relax % -} +}% \def\gredotranslationcenterend{% \ifnum\grenlbintranslation=1\relax % @@ -681,11 +696,11 @@ \raise\gre@spacebeneathtext\hbox to 0pt{}% \unsetluatexattribute{\gregoriocenterattr}% \relax % -} +}% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the chironomic signs lines -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % here is a quite special macro called at beggining of lines, that inserts a line of chironomic signs \def\greinsertchiroline{% @@ -695,26 +710,29 @@ \hbox{\directlua{grechiro.printLine()}}% \par % % TODO: this line bugs with my version of LuaTeX - %\grenobreak % - \kern\gre@belowsignsspace % - %\grenobreak % + %\grenobreak + \gre@temp = \gre@belowsignsspace% + \kern\gre@temp % + %\grenobreak \noindent % \else % % not very beaufiful, I don't like to make a new par inside a score, but.... \grelocalleftbox{}% \grelocalrightbox{}% \par % - \kern\gre@abovesignsspace % + \gre@temp = \gre@abovesignsspace% + \kern\gre@temp % \noindent\hbox{\directlua{grechiro.printLine()}}% \greupdateleftbox % \par % \grenobreak% - \kern\gre@belowsignsspace % + \gre@temp = \gre@belowsignsspace% + \kern\gre@temp % \grenobreak % \noindent % \fi % \relax % -} +}% %macro to call just after begingregorioscore, if there are some chironomic signs \def\greactivatechironomy{% @@ -725,16 +743,16 @@ \RequireLuaModule{gregoriotex-ictus}% \directlua{grechiro.atBeginScore()}% \fi % -} +}% % count that is 1 or 0 if we need to print the small vertical bars in the chironomic line -\newcount\printchirovbars -\printchirovbars=1 +\newcount\printchirovbars% +\printchirovbars=1% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% other macros -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % gregorioattr (see its definition in gregorio-syllable) is 0 when we are in a score, and unset when we are not @@ -750,7 +768,6 @@ \gregorioattr=0\relax % \xdef\greexhyphencharsave{\the\exhyphenchar}% \exhyphenchar=-1\relax % - \global\gre@stafflinewidth=\gre@linewidth % \gregeneratelines % \noindent% \directlua{gregoriotex.atScoreBeggining()}% @@ -760,7 +777,7 @@ \fi % \global\greknownline=1\relax % \relax% -} +}% %macro called at the end of a score \def\endgregorioscore{% @@ -792,7 +809,7 @@ \exhyphenchar=\greexhyphencharsave % \directlua{gregoriotex.atScoreEnd()}% \relax% -} +}% % macro to call when there is just a little thing that will go to the last line, % when it is not necessary @@ -800,15 +817,19 @@ \def\grenolastline{% \ifdim\gre@enddifference > 0 pt % \ifdim\gre@nextbegindifference > 0 pt % - \hskip\gre@interwordspacenotes % + \gre@temp = \gre@interwordspacenotes% + \hskip\gre@temp % \else % (next begin difference >0pt) - \hskip\gre@interwordspacenotestext % + \gre@temp = \gre@interwordspacenotestext% + \hskip\gre@temp % \fi % \else%(enddifference < Opt) \ifdim\gre@nextbegindifference < 0 pt % - \hskip\gre@interwordspacetext % + \gre@temp = \gre@interwordspacetext% + \hskip\gre@temp % \else %(next begin difference < 0 pt) - \hskip\gre@interwordspacetextnotes % + \gre@temp = \gre@interwordspacetextnotes% + \hskip\gre@temp % \fi % \fi % \global\greendofscore=1 % @@ -816,7 +837,7 @@ \grelocalleftbox{}% \penalty{\grenolastlinepenalty }% \relax% -} +}% % macro called at each end of word \def\greendofword#1{% @@ -824,21 +845,25 @@ \ifnum#1=1\relax % \ifdim\gre@enddifference > 0 pt % \ifdim\gre@nextbegindifference > 0 pt % - \grehskip\gre@interwordspacenotes % + \gre@temp = \gre@interwordspacenotes% + \grehskip\gre@temp % \else % (next begin difference >0pt) - \grehskip\gre@interwordspacenotestext % + \gre@temp = \gre@interwordspacenotestext% + \grehskip\gre@temp % \fi % \else %(enddifference < Opt) \ifdim\gre@nextbegindifference < 0 pt % - \grehskip\gre@interwordspacetext % + \gre@temp = \gre@interwordspacetext% + \grehskip\gre@temp % \else %(next begin difference < 0 pt) - \grehskip\gre@interwordspacetextnotes % + \gre@temp = \gre@interwordspacetextnotes% + \grehskip\gre@temp % \fi % \fi % \fi % - %\global\gre@enddifference=0pt % + %\global\gre@enddifference=0pt \relax% -} +}% % macro called at the end of a word or syllable when the next thing is a bar \def\greendbeforebar#1{% @@ -846,22 +871,26 @@ \ifnum#1=1\relax % \ifdim\gre@enddifference > 0 pt % \ifdim\gre@nextbegindifference > 0 pt % - \grehskip\gre@notebarspace % + \gre@temp = \gre@notebarspace% + \grehskip\gre@temp % \else % (next begin difference >0pt) - \grehskip\gre@textbartextspace % + \gre@temp = \gre@textbartextspace% + \grehskip\gre@temp % \fi % \else%(enddifference < Opt) \ifdim\gre@nextbegindifference < 0 pt % - \grehskip\gre@textbartextspace % + \gre@temp = \gre@textbartextspace% + \grehskip\gre@temp % \else %(next begin difference < 0 pt) - \grehskip\gre@interwordspacetextnotes % + \gre@temp = \gre@interwordspacetextnotes% + \grehskip\gre@temp % \fi % \fi % \fi % \grenobreak % - %\global\gre@enddifference=0pt % + %\global\gre@enddifference=0pt \relax % -} +}% % macro called at the end of a bar. Almost the same, but not for the penalties \def\greendafterbar#1{% @@ -869,24 +898,28 @@ \ifnum#1=1\relax % \ifdim\gre@enddifference > 0 pt % \ifdim\gre@nextbegindifference > 0 pt % - \grehskip\gre@notebarspace % + \gre@temp = \gre@notebarspace% + \grehskip\gre@temp % \else % (next begin difference >0pt) - \grehskip\gre@textbartextspace % + \gre@temp = \gre@textbartextspace% + \grehskip\gre@temp % \fi % \else%(enddifference < Opt) \ifdim\gre@nextbegindifference < 0 pt % - \grehskip\gre@textbartextspace % + \gre@temp = \gre@textbartextspace% + \grehskip\gre@temp % \else %(next begin difference < 0 pt) - \grehskip\gre@interwordspacetextnotes % + \gre@temp = \gre@interwordspacetextnotes% + \grehskip\gre@temp % \fi % \fi % \fi % - %\grepenalty{\greendafterbarpenalty }\relax % - %\global\gre@enddifference=0pt % + %\grepenalty{\greendafterbarpenalty }\relax + %\global\gre@enddifference=0pt \relax % -} +}% -\newcount\grelastoflinecount +\newcount\grelastoflinecount% % TODO: case where we're at the beginning *and* end of a line... quite rare case though... % macro to tell gregorioTeX no to put a space after the current syllable (otherwise it may cause annoying black boxes in the pdf if written in plainTeX) @@ -896,7 +929,7 @@ \def\grelastofline{% \global\grelastoflinecount=1\relax% \relax% -} +}% % same as above, but for the score. For now it is the same behaviour. \def\grelastofscore{% @@ -906,34 +939,34 @@ \greblockcustos % \global\grelastoflinecount=1\relax% \relax% -} +}% % a macro to disable (or reenable) the left shift for first syllables of scores -\edef\gredisableeolshifts{0} +\edef\gredisableeolshifts{0}% \def\GreDisableEOLShifts{% \xdef\gredisableeolshifts{1}% -} +}% \def\GreEnableEOLShifts{% \xdef\gredisableeolshifts{0}% -} +}% % a count that is 1 if we block the custo, and 0 if we don't. We just block custos at the end of a score, to prevent a bug. -\newcount\greblockcusto +\newcount\greblockcusto% % macro to suppress the custos \def\greblockcustos{% \global\greblockcusto=1\relax % \grelocalrightbox{}% \relax % -} +}% % macro called at each end of syllable which is not an end of word \def\greendofsyllable{% \grepenalty{\greendofsyllablepenalty }% \relax% -} +}% % macro to end elements, #1 is the type of space, it can be : %% 0: default space @@ -949,17 +982,20 @@ \grenobreak % \fi % \ifcase#1% - \grehskip\gre@interelementspace % + \gre@temp = \gre@interelementspace% + \grehskip\gre@temp % \or% case 1 - \grehskip\gre@largerspace % + \gre@temp = \gre@largerspace% + \grehskip\gre@temp % \or% case 2 - \grehskip\gre@glyphspace % + \gre@temp = \gre@glyphspace% + \grehskip\gre@temp % \fi% \ifnum #2=1\relax % \grenobreak % \fi % \relax% -} +}% % macro to end a glyph without ending the element, argument is the type of space, it can be : %% 0: default space @@ -979,39 +1015,51 @@ \def\greendofglyph#1{% \grenobreak % \ifcase#1% - \grehskip\gre@interglyphspace % + \gre@temp = \gre@interglyphspace% + \grehskip\gre@temp % \or% case 1 - \grehskip\gre@zerowidthspace % + \gre@temp = \gre@zerowidthspace% + \grehskip\gre@temp % \or% case 2 - \grehskip\gre@alterationspace % + \gre@temp = \gre@alterationspace% + \grehskip\gre@temp % \or% case 3 - \grehskip\gre@punctuminclinatumshift % + \gre@temp = \gre@punctuminclinatumshift% + \grehskip\gre@temp % \or% case 4 - \grehskip\gre@bitrivirspace % + \gre@temp = \gre@bitrivirspace% + \grehskip\gre@temp % \or% case 5 - \grehskip\gre@bitristrospace % + \gre@temp = \gre@bitristrospace% + \grehskip\gre@temp % \or% case 6 - \grehskip\gre@spaceaftersigns % + \gre@temp = \gre@spaceaftersigns% + \grehskip\gre@temp % \or% case 7 - \grehskip\gre@punctuminclinatumanddebilisshift % + \gre@temp = \gre@punctuminclinatumanddebilisshift% + \grehskip\gre@temp % \or% case 8 - \grehskip\gre@punctuminclinatumdebilisshift % + \gre@temp = \gre@punctuminclinatumdebilisshift% + \grehskip\gre@temp % \or% case 9 - \grehskip\gre@beforepunctainclinatashift % + \gre@temp = \gre@beforepunctainclinatashift% + \grehskip\gre@temp % \or% case 10 - \grehskip\gre@punctuminclinatumbigshift % + \gre@temp = \gre@punctuminclinatumbigshift% + \grehskip\gre@temp % \or% case 11 - \grehskip\gre@punctuminclinatummaxshift % + \gre@temp = \gre@punctuminclinatummaxshift% + \grehskip\gre@temp % \fi% \grenobreak % \relax% -} +}% % The different states of line break areas: % 0: not currently in a no line break area % 1: no line break area due tu translation centering % 2: no line break area due to tag -\xdef\grenlbstate{0} +\xdef\grenlbstate{0}% % 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 @@ -1046,7 +1094,7 @@ \xdef\grehyphenpenaltysave{\grehyphenpenalty }% \xdef\grehyphenpenalty{10001}% \fi % -} +}% \def\greendnlbarea#1#2{% \xdef\grenlbinitialstate{\grenlbstate}% @@ -1081,111 +1129,109 @@ \fi % \fi % \fi % -} +}% -\input gregoriotex-symbols.tex +\input gregoriotex-symbols.tex% -%%%%%%%% +%%%%%%%%% %% fonts -%%%%%%%% +%%%%%%%%% \def\gretilde{% \ensuremath{\sim}% \relax % -} +}% \def\greitalic#1{% {\it #1}% -% \relax % -} +% \relax +}% \def\gresmallcaps#1{% {\sc #1}% \relax % -} +}% \def\grebold#1{% {\bf #1}% \relax % -} +}% -\let\greboldfont\grebold +\let\greboldfont\grebold% \def\grett#1{% {\tt #1}% \relax % -} +}% \def\greul#1{% {#1}% \relax % -} +}% \def\grecolored#1{% {#1}% \relax % -} +}% % the default gregorio font -\xdef\gregoriofontname{greciliae} +\xdef\gregoriofontname{greciliae}% \def\setgregoriofont#1{% \xdef\gregoriofontname{#1}% - \newcount\gretempdimcount \gretempdimcount = \the\grefactor % \multiply\gretempdimcount by 100000 % \global\font\gregoriofont="name:#1" at \the\gretempdimcount sp% \relax% -} +}% -\xdef\greusestylefont{0} +\xdef\greusestylefont{0}% % gregoriostylefont is the font used for additional glyphs \def\gresetstylefont{% - \newcount\gretempdimcount \gretempdimcount = \the\grefactor % \multiply\gretempdimcount by 100000\relax % \global\font\gregoriostylefont="name:greextra" at \the\gretempdimcount sp% \relax% -} +}% \def\gretranslationformat#1{% \greitalic{#1}% \relax % -} +}% \def\grenormalstafflinesformat{% \relax % -} +}% \def\greadditionalstafflinesformat{% \relax % -} +}% \def\GreSetStaffLinesFormat#1{% \global\def\greadditionalstafflinesformat{#1\relax }% \global\def\grenormalstafflinesformat{#1\relax }% \relax % -} +}% \def\greinitialformat#1{% \font\grefontofinitial=pncr at 40pt% {\grefontofinitial #1}% \relax % -} +}% \def\grebiginitialformat#1{% \font\grefontofgrebiginitial=pncr at 80pt% {\grefontofgrebiginitial #1}% \relax % -} +}% \def\setgrefactor#1{% - \ifnum#1<0\relax - \greerror{\protect\grefactor\space must be a positive integer.} - \else + \ifnum#1<0\relax% + \greerror{\protect\grefactor\space must be a positive integer.}% + \else% \gre@changedimenfactor{\grefactor}{#1}% \global\grefactor=#1\relax % \gre@computespaces % @@ -1194,13 +1240,13 @@ \ifnum\greusestylefont=1\relax % \gresetstylefont % \fi % - \fi + \fi% \relax % -} +}% -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% %% score including -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% % The primary macro that includes a score. The lua function check that: % -- The gtex file exists. @@ -1211,43 +1257,43 @@ \def\gre@includescore#1{% \directlua{gregoriotex.include_score([[#1]])}% \relax% -} +}% -\ifdefined\includetexscore - \gre@warning{\protect\includetexscore\space is deprecated. \MessageBreak Use \protect\includescore\space instead.} -\else +\ifdefined\includetexscore% + \gre@warning{\protect\includetexscore\space is deprecated. \MessageBreak Use \protect\includescore\space instead.}% +\else% \def\includetexscore#1{% - \gre@includescore{#1} - } -\fi + \gre@includescore{#1}% + }% +\fi% \def\greincludetexscore#1{% - \gre@warning{\protect\greincludedtexscore\space is deprecated.\MessageBreak Use \protect\includescore\space instead.} - \gre@includescore{#1} -} + \gre@warning{\protect\greincludedtexscore\space is deprecated.\MessageBreak Use \protect\includescore\space instead.}% + \gre@includescore{#1}% +}% -\ifdefined\includegabcscore - \gre@warning{\protect\includegabcscore\space is deprecated.\MessageBreak Use \protect\includescore\space instead.} -\else +\ifdefined\includegabcscore% + \gre@warning{\protect\includegabcscore\space is deprecated.\MessageBreak Use \protect\includescore\space instead.}% +\else% \def\includegabcscore#1{% - \gre@includescore{#1} - } -\fi + \gre@includescore{#1}% + }% +\fi% \def\greincludegabcscore#1{% - \gre@warning{\protect\greincludedgabcscore\space is deprecated.\MessageBreak Use \protect\includescore\space instead.} - \gre@includescore{#1} -} + \gre@warning{\protect\greincludedgabcscore\space is deprecated.\MessageBreak Use \protect\includescore\space instead.}% + \gre@includescore{#1}% +}% % A macro that passes the score directly to TeX without performing the API version check or if the gabc was modified since the creation of the gtex file. \def\gre@includescorewithoption[#1]#2{% \input #2% \relax% -} +}% % The main macro used by the user to input scores into the document. \def\includescore{\@ifnextchar[{\gre@includescorewithoption}% {\gre@includescore}% -} +}% % If called without the optional argument: '\includescore{Antiphon}' % the filename will be passed to the lua function 'include_score' @@ -1264,33 +1310,33 @@ % checked by the lua function 'include_score'. This does not bypass % the API version test done by '\gregoriotexapiversion'. -%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%% %% some hyphen definitions -%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%% % a zero-width hyphen, useful for fine tuning line endings. To input in gabc verb for example. \def\grezerhyph{% \hbox to 0pt{% - %-% + %- \char\the\hyphenchar\font % \hss % }% -} +}% % a normal hyphen \def\grenormalhyph{% - %-% + %- \char\the\hyphenchar\font % -} +}% % the definition that will be always used for end of lines hyphens in gregorio, except if one of the two before is explicitely used -\let\grehyph\grenormalhyph +\let\grehyph\grenormalhyph % % two macros to change the definition of the hyphen: \def\GreUseNormalHyphen{% \global\let\grehyph\grenormalhyph % -} +}% -\def\GreUseZeroHyphen{ +\def\GreUseZeroHyphen{% \global\let\grehyph\grezerhyph % -} +}% diff --git a/tex/gsp-default.tex b/tex/gsp-default.tex index 2f4644c5d..54862873c 100644 --- a/tex/gsp-default.tex +++ b/tex/gsp-default.tex @@ -19,183 +19,180 @@ %% First, the penalties % penalty at the end of a syllable which is the end of a word -\xdef\greendofwordpenalty{-100} +\xdef\greendofwordpenalty{-100}% % penalty at the end of a syllable which is not the end of a word -\xdef\greendofsyllablepenalty{-50} +\xdef\greendofsyllablepenalty{-50}% % penalty at the end of a syllable which is just a bar, with something printed % under it -\xdef\greendafterbarpenalty{-200} +\xdef\greendafterbarpenalty{-200}% % penalty right after a bar with nothing printed -\xdef\greendafterbaraltpenalty{-200} +\xdef\greendafterbaraltpenalty{-200}% % penalty at the end of a breakable neumatic element (typically at a space % between elements) -\xdef\greendofelementpenalty{-50} +\xdef\greendofelementpenalty{-50}% % hyphenpenalty will be used in discretionaries, in Gregorio this is used for % a bar with clef change for example. It also set \exhyphenpenalty. It should % be close to \greendafterbarpenalty -\xdef\grehyphenpenalty{-200} +\xdef\grehyphenpenalty{-200}% % broken penalty is the vertical penalty inserted after a break on a clef change % I'm not sure it should be set, but it might be useful... -\xdef\grebrokenpenalty{0} +\xdef\grebrokenpenalty{0}% %% Then, some fine tunings -\def\grelooseness{\looseness} -\def\gretolerance{9000} +\def\grelooseness{\looseness}% +\def\gretolerance{9000}% % Workaround for bug 842 (http://tracker.luatex.org/view.php?id=842) % see http://tug.org/pipermail/luatex/2013-July/004516.html \ifnum\the\luatexversion < 78\relax % - \global\def\grepretolerance{-1} + \global\def\grepretolerance{-1}% \else % - \global\def\grepretolerance{\pretolerance} + \global\def\grepretolerance{\pretolerance}% \fi % -\def\greemergencystretch{\emergencystretch} +\def\greemergencystretch{\emergencystretch}% % By default, we don't care if a line of score is alone on the page, % if you think it is bad, you can modify the two following values. Assigning % 10000 to them will prevent all orphaned lines (this will certainly improve % some spacings a lot). -\def\grewidowpenalty{0} -\def\greclubpenalty{0} +\def\grewidowpenalty{0}% +\def\greclubpenalty{0}% -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% %% And finally, all the spacings: -%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%% %This count tells gregoriotex what \grefactor the below values correspond to. %% All the following values correspond to a grefactor of 17. At this size the scores should be approximately the size usually seen in a gradual. %% If you’re creating your own space configuration file, you may set this to some other value, should you so desire. -\newcount\greconffactor -\greconffactor=17 - -\makeatletter %needed temporarily until \gresetdimen is added. +\newcount\greconffactor% +\greconffactor=17% % the additional width of the additional lines (compared to the width of the glyph they're associated with) -\gre@additionallineswidth = 0.14584 cm +\gresetdim{additionallineswidth}{0.14584 cm}{1}% % width of the additional lines, used only for the custos (maybe should depend on the width of the custo...) % the width is the one for the custos at end of lines, the line for custos in the middle of a score is the same % multiplied by 2. -\gre@additionalcustoslineswidth = 0.09114 cm +\gresetdim{additionalcustoslineswidth}{0.09114 cm}{1}% % null space -\gre@zerowidthspace = 0 cm plus 0 cm minus 0 cm +\gresetdim{zerowidthspace}{0 cm}{1}% % space between glyphs in the same element -\gre@interglyphspace = 0.06927 cm plus 0.00363 cm minus 0.00363 cm +\gresetdim{interglyphspace}{0.06927 cm plus 0.00363 cm minus 0.00363 cm}{1}% % space between an alteration (flat or natural) and the next glyph -\gre@alterationspace = 0.07747 cm plus 0.01276 cm minus 0.00455 cm +\gresetdim{alterationspace}{0.07747 cm plus 0.01276 cm minus 0.00455 cm}{1}% % space between a clef and a flat (for clefs with flat) -\gre@clefflatspace = 0.05469 cm plus 0.00638 cm minus 0.00638 cm +\gresetdim{clefflatspace}{0.05469 cm plus 0.00638 cm minus 0.00638 cm}{1}% % space before a choral sign -\gre@beforechoralsignspace = 0.04556 cm plus 0.00638 cm minus 0.00638 cm +\gresetdim{beforechoralsignspace}{0.04556 cm plus 0.00638 cm minus 0.00638 cm}{1}% % negative space, difference between the normal space between two notes and the space between a note and a flat -\gre@beforealterationspace = -0.32816 cm plus 0.01093 cm minus 0.01093 cm +\gresetdim{beforealterationspace}{-0.32816 cm plus 0.01093 cm minus 0.01093 cm}{1}% % space between elements -\gre@interelementspace = 0.06927 cm plus 0.00182 cm minus 0.00363 cm +\gresetdim{interelementspace}{0.06927 cm plus 0.00182 cm minus 0.00363 cm}{1}% % larger space between elements -\gre@largerspace = 0.10938 cm plus 0.01822 cm minus 0.00911 cm +\gresetdim{largerspace}{0.10938 cm plus 0.01822 cm minus 0.00911 cm}{1}% % space between elements which has the size of a note -\gre@glyphspace = 0.21877 cm plus 0.01822 cm minus 0.01822 cm +\gresetdim{glyphspace}{0.21877 cm plus 0.01822 cm minus 0.01822 cm}{1}% % minimum space between two notes of different syllables -\gre@intersyllablespace= 0.25523 cm plus 0.31903 cm minus 0 cm +\gresetdim{intersyllablespace}{0.25523 cm plus 0.31903 cm minus 0 cm}{1}% % space before custo -\gre@spacebeforecusto = 0.1823 cm plus 0.31903 cm minus 0.0638 cm +\gresetdim{spacebeforecusto}{0.1823 cm plus 0.31903 cm minus 0.0638 cm}{1}% % space before punctum mora and augmentum duplex -\gre@spacebeforesigns= 0.05469 cm plus 0.00455 cm minus 0.00455 cm +\gresetdim{spacebeforesigns}{0.05469 cm plus 0.00455 cm minus 0.00455 cm}{1}% % space after punctum mora and augmentum duplex -\gre@spaceaftersigns= 0.08203 cm plus 0.0082 cm minus 0.0082 cm +\gresetdim{spaceaftersigns}{0.08203 cm plus 0.0082 cm minus 0.0082 cm}{1}% % space after a clef at the beginning of a line -\gre@spaceafterlineclef = 0.27345 cm plus 0.14584 cm minus 0.01367 cm +\gresetdim{spaceafterlineclef}{0.27345 cm plus 0.14584 cm minus 0.01367 cm}{1}% % space after at the end of a word when the last written symbol is a note and the first is a note -\gre@interwordspacenotes = 0.29169 cm plus 0.08751 cm minus 0.05469 cm +\gresetdim{interwordspacenotes}{0.29169 cm plus 0.08751 cm minus 0.05469 cm}{1}% % space after at the end of a word when the last written symbol is a note and the first is text -\gre@interwordspacenotestext = 0.27345 cm plus 0.27345 cm minus 0.07292 cm +\gresetdim{interwordspacenotestext}{0.27345 cm plus 0.27345 cm minus 0.07292 cm}{1}% % space after at the end of a word when the last written symbol is text and the first is a note -\gre@interwordspacetextnotes = 0.27345 cm plus 0.27345 cm minus 0.07292 cm +\gresetdim{interwordspacetextnotes}{0.27345 cm plus 0.27345 cm minus 0.07292 cm}{1}% % space after at the end of a word when the last written symbol is text and the first is text -\gre@interwordspacetext = 0.22787 cm plus 0.41019 cm minus 0.07292 cm +\gresetdim{interwordspacetext}{0.22787 cm plus 0.41019 cm minus 0.07292 cm}{1}% % space between notes of a bivirga or trivirga -\gre@bitrivirspace = 0.06927 cm plus 0.00182 cm minus 0.00546 cm +\gresetdim{bitrivirspace}{0.06927 cm plus 0.00182 cm minus 0.00546 cm}{1}% % space between notes of a bistropha or tristrophae -\gre@bitristrospace = 0.06927 cm plus 0.00182 cm minus 0.00546 cm +\gresetdim{bitristrospace}{0.06927 cm plus 0.00182 cm minus 0.00546 cm}{1}% % space between two punctum inclinatum -\gre@punctuminclinatumshift= -0.03918 cm plus 0.0009 cm minus 0.0009 cm +\gresetdim{punctuminclinatumshift}{-0.03918 cm plus 0.0009 cm minus 0.0009 cm}{1}% % space before puncta inclinata -\gre@beforepunctainclinatashift= 0.05286 cm plus 0.00728 cm minus 0.00455 cm +\gresetdim{beforepunctainclinatashift}{0.05286 cm plus 0.00728 cm minus 0.00455 cm}{1}% % space between a punctum inclinatum and a punctum inclinatum deminutus -\gre@punctuminclinatumanddebilisshift= -0.02278 cm plus 0.0009 cm minus 0.0009 cm +\gresetdim{punctuminclinatumanddebilisshift}{-0.02278 cm plus 0.0009 cm minus 0.0009 cm}{1}% % space between two punctum inclinatum deminutus -\gre@punctuminclinatumdebilisshift= -0.00728 cm plus 0.0009 cm minus 0.0009 cm +\gresetdim{punctuminclinatumdebilisshift}{-0.00728 cm plus 0.0009 cm minus 0.0009 cm}{1}% % space between puncta inclinata, larger ambitus (range=3rd) -\gre@punctuminclinatumbigshift= 0.07565 cm plus 0.0009 cm minus 0.0009 cm +\gresetdim{punctuminclinatumbigshift}{0.07565 cm plus 0.0009 cm minus 0.0009 cm}{1}% % space between puncta inclinata, larger ambitus (range=4th -or more?-) -\gre@punctuminclinatummaxshift= 0.17865 cm plus 0.0009 cm minus 0.0009 cm +\gresetdim{punctuminclinatummaxshift}{0.17865 cm plus 0.0009 cm minus 0.0009 cm}{1}% % space for the bars (inside syllables) %first for virgula and divisio minima -\gre@spacearoundsmallbar = 0.1823 cm plus 0.22787 cm minus 0.05469 cm +\gresetdim{spacearoundsmallbar}{0.1823 cm plus 0.22787 cm minus 0.05469 cm}{1}% %then divisio minor -\gre@spacearoundminor = 0.1823 cm plus 0.22787 cm minus 0.05469 cm +\gresetdim{spacearoundminor}{0.1823 cm plus 0.22787 cm minus 0.05469 cm}{1}% %divisio major -\gre@spacearoundmaior = 0.1823 cm plus 0.22787 cm minus 0.05469 cm +\gresetdim{spacearoundmaior}{0.1823 cm plus 0.22787 cm minus 0.05469 cm}{1}% %divisio finalis -\gre@spacearoundfinalis = 0.1823 cm plus 0.22787 cm minus 0.05469 cm +\gresetdim{spacearoundfinalis}{0.1823 cm plus 0.22787 cm minus 0.05469 cm}{1}% %a special space for finalis, for when it is the last glyph -\gre@spacebeforefinalfinalis= 0.29169 cm plus 0.07292 cm minus 0.27345 cm +\gresetdim{spacebeforefinalfinalis}{0.29169 cm plus 0.07292 cm minus 0.27345 cm}{1}% % additional space that will appear around bars that are preceded by a custo and followed by a key. -\gre@spacearoundclefbars= 0.03645 cm plus 0.00455 cm minus 0.0009 cm +\gresetdim{spacearoundclefbars}{0.03645 cm plus 0.00455 cm minus 0.0009 cm}{1}% % space between the text and the text of the bar -\gre@textbartextspace = 0.24611 cm plus 0.13672 cm minus 0.04921 cm +\gresetdim{textbartextspace}{0.24611 cm plus 0.13672 cm minus 0.04921 cm}{1}% % minimal space between a note and a bar -\gre@notebarspace = 0.31903 cm plus 0.27345 cm minus 0.02824 cm +\gresetdim{notebarspace}{0.31903 cm plus 0.27345 cm minus 0.02824 cm}{1}% % maximal space between two syllables for which we consider a dash is not needed -\gre@maximumspacewithoutdash = 0.02005 cm +\gresetdim{maximumspacewithoutdash}{0.02005 cm}{1}% % an extensible space for the beginning of lines -\gre@afterclefnospace = 0 cm plus 0.27345 cm minus 0 cm +\gresetdim{afterclefnospace}{0 cm plus 0.27345 cm minus 0 cm}{1}% % space between the initial and the beginning of the score -\gre@afterinitialshift = 0.2457 cm plus 0 cm minus 0 cm +\gresetdim{afterinitialshift}{0.2457 cm}{1}% % space before the initial -\gre@beforeinitialshift = 0.2457 cm plus 0 cm minus 0 cm +\gresetdim{beforeinitialshift}{0.2457 cm}{1}% % minimum space before each line (except those preceded by the initial) -\gre@minimalspaceatlinebeginning = 0.1 cm +\gresetdim{minimalspaceatlinebeginning}{0.1 cm}{1}% % space to force the initial width to. Ignored when 0. -\gre@manualinitialwidth = 0 cm +\gresetdim{manualinitialwidth}{0 cm}{1}% % this space is the one between the bottom of the first anotation line and the top % of the second anotation line (above the initial) -\gre@aboveinitialseparation = 0.05 cm +\gresetdim{aboveinitialseparation}{0.05 cm}{1}% % space at the beginning of the lines if there is no clef -\gre@noclefspace = 0.1 cm +\gresetdim{noclefspace}{0.1 cm}{1}% % space around a clef change -\gre@clefchangespace = 0.01768 cm plus 0.00175 cm minus 0.01768 cm% +\gresetdim{clefchangespace}{0.01768 cm plus 0.00175 cm minus 0.01768 cm}{1}% %When \gre@clivisalignment is 2, this distance is the maximum length of the consonants after vowels for which the clivis will be aligned on its center. -\gre@clivisalignmentmin = 0.3 cm +\gresetdim{clivisalignmentmin}{0.3 cm}{1}% -%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%% % vertical spaces -%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%% % first, we have two spaces for the chironomic signs -\gre@abovesignsspace = 0.8 cm -\gre@belowsignsspace = 0 cm +\gresetdim{abovesignsspace}{0.8 cm}{1}% +\gresetdim{belowsignsspace}{0 cm}{1}% % the shift for the low choral sign and the high choral signs on totally free interlines -\gre@lowchoralsignshift = 0.00911 cm +\gresetdim{lowchoralsignshift}{0.00911 cm}{1}% % the shift for the high choral sign -\gre@highchoralsignshift = -0.04556 cm +\gresetdim{highchoralsignshift}{-0.04556 cm}{1}% % the space for the translation -\gre@translationheight = 0.5 cm +\gresetdim{translationheight}{0.5 cm}{1}% %the space above the lines -\gre@spaceabovelines = 0.45576 cm plus 0.36461 cm minus 0.09114 cm +\gresetdim{spaceabovelines}{0.45576 cm plus 0.36461 cm minus 0.09114 cm}{1}% %the space between the lines and the bottom of the text -\gre@spacelinestext = 0.60617 cm plus 0 cm minus 0 cm +\gresetdim{spacelinestext}{0.60617 cm}{1}% %the space beneath the text -\gre@spacebeneathtext = 0 cm plus 0 cm minus 0 cm +\gresetdim{spacebeneathtext}{0 cm}{1}% % height of the text above the note line -\gre@abovelinestextraise = -0.1 cm% +\gresetdim{abovelinestextraise}{-0.1 cm}{1}% % height that is added at the top of the lines if there is text above the lines (it must be bigger than the text for it to be taken into consideration) -\gre@abovelinestextheight = 0.3 cm% +\gresetdim{abovelinestextheight}{0.3 cm}{1}% % an additional shift you can give to the brace above the bars if you don't like it -\gre@braceshift = 0 cm +\gresetdim{braceshift}{0 cm}{1}% % a shift you can give to the accentus above the curly brace -\gre@curlybraceaccentusshift = -0.05 cm +\gresetdim{curlybraceaccentusshift}{-0.05 cm}{1}% -\makeatother \ No newline at end of file diff --git a/windows/gregorio.iss b/windows/gregorio.iss index 74d081f48..1393c96a6 100644 --- a/windows/gregorio.iss +++ b/windows/gregorio.iss @@ -1,6 +1,6 @@ [Setup] AppName=gregorio -AppVersion=2.4.2 +AppVersion=2.4.3 DefaultDirName={pf}\gregorio DefaultGroupName=gregorio SetupIconFile=gregorio.ico diff --git a/windows/install.lua b/windows/install.lua index 9df53f820..9f930c241 100644 --- a/windows/install.lua +++ b/windows/install.lua @@ -249,7 +249,7 @@ showPdf=true]] full_tools_ini[4] = [[name=LuaLaTeX program=lualatex.exe -arguments=$synctexoption, $fullname +arguments=--shell-escape, $synctexoption, $fullname showPdf=true]] full_tools_ini[5] = [[name=XeTeX @@ -289,13 +289,12 @@ showPdf=false]] function texworks_conf_tools(filename, install_dir) local lualatexfound = 0 - local gregoriofound = 0 - local gregbookfound = 0 -- by default, there is no tools.ini in the recent versions of TeXWorks if not lfs.isfile(filename) then print(filename.." does not exist, creating it...\n") local toolstable = full_tools_ini current = 11 + lualatexfound = 1 else -- let's remove the read-only attribute remove_read_only(filename) @@ -309,10 +308,6 @@ function texworks_conf_tools(filename, install_dir) elseif l ~= "" then if string.lower(l) == "name=lualatex" then lualatexfound = 1 - elseif string.lower(l) == "name=gregorio" then - gregoriofound = 1 - elseif string.lower(l) == "name=greg-book" then - gregbookfound = 1 end if toolstable[current] == nil then toolstable[current] = l @@ -326,24 +321,9 @@ function texworks_conf_tools(filename, install_dir) current = current + 1 toolstable[current] = "name=LuaLaTeX" toolstable[current] = toolstable[current]..'\n'..'program=lualatex' - toolstable[current] = toolstable[current]..'\n'..'arguments=$synctexoption, $fullname' - toolstable[current] = toolstable[current]..'\n'..'showPdf=true' - end - if gregoriofound == 0 then - current = current + 1 - toolstable[current] = "name=gregorio" - toolstable[current] = toolstable[current]..'\n'..'program='..install_dir..'/contrib/TeXworks/gregorio.bat' - toolstable[current] = toolstable[current]..'\n'..'arguments=$fullname, $basename' - toolstable[current] = toolstable[current]..'\n'..'showPdf=false' - end - if gregbookfound == 0 then - current = current + 1 - toolstable[current] = 'name=greg-book' - toolstable[current] = toolstable[current]..'\n'..'program='..install_dir..'/contrib/TeXworks/greg-book.bat' - toolstable[current] = toolstable[current]..'\n'..'arguments=$fullname' + toolstable[current] = toolstable[current]..'\n'..'arguments=--shell-escape, $synctexoption, $fullname' toolstable[current] = toolstable[current]..'\n'..'showPdf=true' - end - if gregbookfound == 1 and gregoriofound == 1 and lualatexfound == 1 then + else return end local data = ""