-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixing #1189 #1195
fixing #1189 #1195
Changes from 5 commits
7e53de9
f64c6cb
b7e1a5d
9916152
d45a36b
c37eb8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1008,6 +1008,26 @@ \subsubsection{End of Line Behavior} | |
& \texttt{disable} & The shifts are not applied. | ||
\end{argtable} | ||
|
||
\macroname{\textbackslash grebolshiftcleftype}{\{\#1\}}{gregoriotex-spaces.tex} | ||
Macro to determine how notes should be left aligned in the case where clefs of different widths appear in the same score. | ||
|
||
\begin{argtable} | ||
\#1 & \texttt{largest} & The notes are aligned as if all clefs had the width of the largest clef (default)\\ | ||
& \texttt{current} & The notes are aligned on the current clef, which leads to unaligned notes. This was the default of Gregorio < \texttt{5.0}. | ||
\end{argtable} | ||
|
||
\macroname{\textbackslash grelocalbolshiftcleftype}{\{\#1\}}{gregoriotex-spaces.tex} | ||
Equivalent of \verb=\grebolshiftcleftype= but valid only until the next end of a score, and with more options. This can be used inside gabc for corner cases like different alignment on a score taking two pages. | ||
|
||
\begin{argtable} | ||
\#1 & \texttt{largest} & same as in \verb=\grebolshiftcleftype=\\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, as this is user documentation, I would repeat the descriptions here rather then refer to another macro. |
||
& \texttt{current} & idem\\ | ||
& \texttt{f} & force left alignment of notes as if all clef were f clef\\ | ||
& \texttt{c} & idem with c clef\\ | ||
& \texttt{fb} & idem with flatted f clef\\ | ||
& \texttt{cb} & idem with flatted c clef\\ | ||
\end{argtable} | ||
|
||
\macroname{\textbackslash gresetlastline}{\{\#1\}}{gregoriotex-main.tex} | ||
Macro to determine whether the last line of the score should be justified or not. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,11 +142,12 @@ | |
]% | ||
}% | ||
|
||
|
||
%% marcro to define the clef that will appear at the beginning of the lines | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since you're here, you might as well correct the spelling of macro. |
||
% the first argument is the type : f or c, and the second is the height | ||
% the third argument is whether we must type a space after or not (0 if not, 1 if yes) | ||
% if the fourth argument is 3, it means that we must not put a flat after the key, otherwise it's the height of the flat | ||
%% #1 c or f: type of first clef | ||
%% #2 int: line of first clef | ||
%% #3 int: 0 if not space, 1 if normal space, 2 for short space | ||
%% #4 int: height of the flat of first clef, 3 for no flat | ||
%% #5, #6, #7 = #1, #2, #3 for second clef | ||
\def\GreSetLinesClef#1#2#3#4#5#6#7{% | ||
\gre@localleftbox{% | ||
\gre@skip@temp@four = \gre@dimen@additionalleftspace\relax% | ||
|
@@ -166,6 +167,15 @@ | |
\relax% | ||
}% | ||
|
||
% defines the largest clef of the score | ||
% arguments are the same as \GreSetLinesClef except that the #3 of | ||
% \GreSetLineClef is removed (always 1) | ||
\def\GreSetLargestClef#1#2#3#4#5#6{% | ||
\gre@boxclef{#1}{#2}{0}{1}{#3}{#4}{#5}{#6}% | ||
\gre@update@clefwidth@largest{\wd\gre@box@temp@width}% | ||
\relax% | ||
}% | ||
|
||
\def\gre@save@clef#1#2#3#4#5#6{% | ||
\global\let\gre@clef=#1\relax% | ||
\xdef\gre@clefheight{#2}% | ||
|
@@ -183,18 +193,10 @@ | |
|
||
\newbox\gre@box@temp@clef% | ||
\newbox\gre@box@temp@cleftwo% | ||
% macro that typesets the clef | ||
% arguments are : | ||
%% #1: the type of the clef : c or f | ||
%% #2: the line of the clef (1 is the lowest) | ||
%% #3: if we must use small clef characters (inside a line) or not 0: if not inside, 1 if inside | ||
%% #4: 0: no space after, 1: normal space after, 2: short space after | ||
%% #5: if 3, it means that we must not put a flat after the clef, otherwise it's the height of the flat | ||
%% #6: the type of the secondary clef : c or f | ||
%% #7: the line of the secondary clef (1 is the lowest) | ||
%% #8: if 3, it means that we must not put a flat after the secondary clef, otherwise it's the height of the flat | ||
\def\gre@typeclef#1#2#3#4#5#6#7#8{% | ||
\setbox\gre@box@temp@width=\hbox{% | ||
|
||
% sets \gre@box@temp@width with the clef, the arguments are the same as \gre@typeclef | ||
\def\gre@boxclef#1#2#3#4#5#6#7#8{% | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This macro needs to be added to Command_Index_internal.tex. |
||
\global\setbox\gre@box@temp@width=\hbox{% | ||
\ifcase#7% | ||
\gre@typesingleclef{#1}{#2}{#3}{#5}% | ||
\else % | ||
|
@@ -214,8 +216,22 @@ | |
\fi % | ||
\fi % | ||
}% | ||
} | ||
|
||
% macro that typesets the clef | ||
% arguments are : | ||
%% #1: the type of the clef : c or f | ||
%% #2: the line of the clef (1 is the lowest) | ||
%% #3: if we must use small clef characters (inside a line) or not 0: if not inside, 1 if inside | ||
%% #4: 0: no space after, 1: normal space after, 2: short space after | ||
%% #5: if 3, it means that we must not put a flat after the clef, otherwise it's the height of the flat | ||
%% #6: the type of the secondary clef : c or f | ||
%% #7: the line of the secondary clef (1 is the lowest) | ||
%% #8: if 3, it means that we must not put a flat after the secondary clef, otherwise it's the height of the flat | ||
\def\gre@typeclef#1#2#3#4#5#6#7#8{% | ||
\gre@boxclef{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% | ||
\ifcase#3% | ||
\global\gre@dimen@clefwidth=\wd\gre@box@temp@width % | ||
\gre@update@clefwidth@current{\wd\gre@box@temp@width}% | ||
\fi % | ||
\copy\gre@box@temp@width % | ||
\ifcase#4 % | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -396,6 +396,14 @@ | |
\else% | ||
\global\advance\gre@skip@temp@three by \gre@dimen@bolextra\relax% | ||
\fi% | ||
\gre@debugmsg{bolshift}{ clefwidthcurrent = \the\gre@dimen@clefwidth@current}% | ||
\gre@debugmsg{bolshift}{ clefwidthbol = \the\gre@dimen@clefwidth@bol}% | ||
% we ignore the current-bol adjustment if the clef is the first of the score and there is an initial on one line: | ||
\ifnum\gre@initiallines=1\ifgre@beginningofscore\else % | ||
\global\advance\gre@skip@temp@three by \dimexpr(\gre@dimen@clefwidth@current-\gre@dimen@clefwidth@bol)\relax % | ||
\fi\else % | ||
\global\advance\gre@skip@temp@three by \dimexpr(\gre@dimen@clefwidth@current-\gre@dimen@clefwidth@bol)\relax % | ||
\fi % | ||
\ifdim#1>0pt\relax% | ||
% no additional shift is needed if the notes start before the text | ||
\global\gre@dimen@bolshift = \gre@skip@temp@three\relax% | ||
|
@@ -407,7 +415,7 @@ | |
% we don't want to kern more than clefwidth + spaceafterlineclef - minimalspaceatlinebeginning | ||
% violating this would mean that either the notes are closer than (clefwidth + spaceafterlineclef) | ||
% or that the lyrics are closer than minimalspaceatlinebeginning | ||
\gre@skip@temp@one = \glueexpr(\gre@dimen@clefwidth % | ||
\gre@skip@temp@one = \glueexpr(\gre@dimen@clefwidth@current % | ||
+ \gre@space@skip@spaceafterlineclef % | ||
- \gre@space@dimen@minimalspaceatlinebeginning)\relax % | ||
\ifdim\gre@skip@temp@three < \gre@skip@temp@one % | ||
|
@@ -420,6 +428,77 @@ | |
\relax % | ||
} | ||
|
||
% the width of the current | ||
\newdimen\gre@dimen@clefwidth@current\relax% | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These new dimensions and macros need to be added to Command_Index_internal.tex. |
||
% the width of the max clef | ||
\newdimen\gre@dimen@clefwidth@largest\relax% | ||
% the width to compute bolshift with | ||
\newdimen\gre@dimen@clefwidth@bol\relax% | ||
|
||
\def\gre@update@clefwidth@current#1{% | ||
\gre@debugmsg{bolshift}{ updating clefwidthcurrent to \the\gre@dimen@clefwidth@current}% | ||
\global\gre@dimen@clefwidth@current=#1\relax % | ||
\ifnum\gre@bolshiftcleftypelocal=2\relax % | ||
\global\gre@dimen@clefwidth@bol=#1\relax % | ||
\fi % | ||
\relax % | ||
} | ||
|
||
\def\gre@update@clefwidth@largest#1{% | ||
\global\gre@dimen@clefwidth@largest=#1\relax % | ||
\ifnum\gre@bolshiftcleftypelocal=1\relax % | ||
\global\gre@dimen@clefwidth@bol=#1\relax % | ||
\fi % | ||
} | ||
|
||
\def\gre@update@clefwidth@forced#1{% | ||
\global\gre@dimen@clefwidth@bol=#1\relax % | ||
} | ||
|
||
% 1 for largest, 2 for current and 3 for forced | ||
\xdef\gre@bolshiftcleftypeglobal{1} | ||
\xdef\gre@bolshiftcleftypelocal{1} | ||
|
||
\def\grebolshiftcleftype#1{ | ||
\IfStrEqCase{#1}{% | ||
{largest}% | ||
{\xdef\gre@bolshiftcleftypeglobal{1}\xdef\gre@bolshiftcleftypelocal{1}}% | ||
{current}% | ||
{\xdef\gre@bolshiftcleftypeglobal{2}\xdef\gre@bolshiftcleftypelocal{2}}% | ||
}[% all other cases | ||
\gre@error{Unrecognized option "#1" for \protect\grebolshiftcleftype\MessageBreak Possible options are: 'largest' and 'current'.}% | ||
]% | ||
} | ||
|
||
\def\grelocalbolshiftcleftype#1{ | ||
\IfStrEqCase{#1}{% | ||
{largest}% | ||
{\xdef\gre@bolshiftcleftypelocal{1}% | ||
\global\gre@dimen@clefwidth@bol=\gre@dimen@clefwidth@largest\relax }% | ||
{current}% | ||
{\xdef\gre@bolshiftcleftypelocal{2}% | ||
\global\gre@dimen@clefwidth@bol=\gre@dimen@clefwidth@current\relax }% | ||
{c}% | ||
{\gre@boxclef{c}{3}{0}{1}{3}{c}{0}{3}% | ||
\xdef\gre@bolshiftcleftypelocal{3}% | ||
\gre@update@clefwidth@forced{\wd\gre@box@temp@width}}% | ||
{f}% | ||
{\gre@boxclef{f}{3}{0}{1}{3}{c}{0}{3}% | ||
\xdef\gre@bolshiftcleftypelocal{3}% | ||
\gre@update@clefwidth@forced{\wd\gre@box@temp@width}}% | ||
{cb}% | ||
{\gre@boxclef{c}{3}{0}{1}{8}{c}{0}{3}% | ||
\xdef\gre@bolshiftcleftypelocal{3}% | ||
\gre@update@clefwidth@forced{\wd\gre@box@temp@width}}% | ||
{fb}% | ||
{\gre@boxclef{f}{3}{0}{1}{8}{c}{0}{3}% | ||
\xdef\gre@bolshiftcleftypelocal{3}% | ||
\gre@update@clefwidth@forced{\wd\gre@box@temp@width}}% | ||
}[% all other cases | ||
\gre@error{Unrecognized option "#1" for \protect\grelocalbolshiftcleftype\MessageBreak Possible options are: 'largest', 'current', 'c', 'f', 'cb' and 'fb'.}% | ||
]% | ||
} | ||
|
||
% dimen keeping the shift computed with next function | ||
\newdimen\gre@dimen@eolshift | ||
\newcount\gre@count@protrusion@hyphen@eol % | ||
|
@@ -1212,9 +1291,6 @@ | |
% begindifference is the difference between the beginning of the text and the beginning of the notes. Warning : it can be negative. | ||
\newdimen\gre@dimen@begindifference\relax% | ||
|
||
% the width of the clef | ||
\newdimen\gre@dimen@clefwidth\relax% | ||
|
||
% the width of the last glyph | ||
\newdimen\gre@dimen@lastglyphwidth\relax% | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is the user documentation, I would explicitly mention that this should be used in a
<v>texverb</v>
in gabc.