-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add option to print only the first flat on each line #1607
base: develop
Are you sure you want to change the base?
Add option to print only the first flat on each line #1607
Conversation
…ope{line} in TeX) that causes only the first alteration (flat) on each line to be printed. Uses the .gaux file, so multiple TeX runs are needed.
…ope{line} in TeX) that causes only the first alteration (flat) on each line to be printed. Uses the .gaux file, so multiple TeX runs are needed.
…ine, it is still printed
tex/gregoriotex-signs.tex
Outdated
\def\gre@alteration@visible#1#2#3#4#5#6{% | ||
\gre@trace{gre@alteration@visible{#1}{#2}{#3}{#4}{#5}{#6}}% | ||
\ifcase#2\relax | ||
\or\def\alterationchar{\gre@fontchar@flat}\def\alterationhole{\gre@fontchar@flathole}% flat |
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.
We try to avoid unprefixed macros in order to prevent name conflicts with other packages (regardless of how unlikely we think they are). Our prefix system is:
\gre@
: Internal macros that users should never interact with in their documents\Gre
: Macros written to the gtex file by the executable. Advanced users might interact with these to do special things in their document\gre
: user facing macros. We expect users to make use of these macros regularly.
With that in mind, \alterationchar
and \alterationhole
should probably be named \gre@alterationchar
and \gre@alterationhole
.
Just one thing that I see right now (and it's not feature related), but it may just be my relative unfamiliarity with the desired feature. Do you think that you could create a matching branch in the test repository and commit proposed tests showing the behavior you're trying to fix. Said tests could be based on the scores where things are currently incorrect, but if the problems are not glaringly obvious at a glance, some text explaining the problem should be added to the test. I wouldn't commit the "corrected" expectations yet so that the image comparison failures can be used to highlight the changes and make sure they are what is desired. |
Done, though I'm not sure if the test is what you're looking for yet. |
Thinking about this, a modification to the gabc syntax may be necessitated by this idea: we might need to differentiate between a flat (or other alteration) that should always show and one that is allowed to disappear according to the ruleset chosen in the document. Currently we have |
I added the header option I like |
…f they are the first on the line or different from the previous alteration. Remove the header option alteration-scope.
Looking back over #157 and #1575, I noticed that naturals (or sharps, I suppose) would also cancel the flat. @davidweichiang, have you taken that into account in this change? (I'm working on my own multi-line initial branch to try and get that finished and so don't have time to poke at this thoroughly myself). The other points where alterations might get canceled are word-breaks and bar lines. We'll want to implement those possibilities eventually (and the combinations there-of that specify the Vatican and Dominican rulesets), but if we can just get naturals and line breaks for now, I think that's sufficient. |
The current logic is:
So, for example, if the alterations on a line are
|
I tried to explain the current logic in the documentation, and I hope it was clear enough. I think this is ready to go but am of course happy to make further changes if needed. Here's a summary of the user-facing changes:
|
Do we use |
I don't see How about |
I'm not to worried about "spending" characters. Adding new gabc syntax has become a very rare event at this point and we still have lots of unused characters. |
I'll change it to |
I have been loosely following this PR, when it is ready I would like to review the documentation for ease of comprehension. As for There is also |
Thanks! IMO the documentation is ready for review, but it will be very helpful to have a third pair of eyes on it. |
Actually, no, I'm not happy with the documentation. I'll work on it more and let you know when it's really ready. |
Don’t forget we have the doc_check.sh script to help with the documentation process. It won’t write documentation for you, but it’ll help you identify which macros still need to be documented. Sent with GitHawk |
@eschwab Hopefully that's better now! |
doc/Command_Index_gregorio.tex
Outdated
\#1 & integer & Height number of the flat.\\ | ||
\#2 & \texttt{0} & The flat is not part of the clef.\\ | ||
& \texttt{1} & The flat is part of the clef.\\ | ||
\#3 & \TeX\ code & signs to typeset before the glyph (typically additional bars, as they must be "behind" the glyph)\\ |
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.
Please use typographical quotes around behind.
doc/Command_Index_gregorio.tex
Outdated
\#1 & integer & Height number of the natural.\\ | ||
\#2 & \texttt{0} & The natural is not part of the clef.\\ | ||
& \texttt{1} & The natural is part of the clef (doesn't happen).\\ | ||
\#3 & \TeX\ code & signs to typeset before the glyph (typically additional bars, as they must be "behind" the glyph)\\ |
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.
Same comment about quotes.
doc/Command_Index_gregorio.tex
Outdated
\#1 & integer & Height number of the sharp.\\ | ||
\#2 & \texttt{0} & The sharp is not part of the clef.\\ | ||
& \texttt{1} & The sharp is part of the clef (doesn't happen).\\ | ||
\#3 & \TeX\ code & signs to typeset before the glyph (typically additional bars, as they must be "behind" the glyph)\\ |
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.
And a third time.
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.
This was a copy-paste from the existing documentation for \GreFlat
and friends. I've changed them throughout the whole manual.
This uses
post_linebreak
to figure out the first flat on each line, and records this information in the.gaux
file so that\gre@alteration
can print only the first flat. It needs two or three runs to converge.Closes #157. (But not #1575.)