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
[macros] Index all occurrences of \grammarterm #1858
Conversation
Regrettably, this doesn't work properly with the "empty \opt detection": In a case like \opt{\grammarterm{blah}}, there's an error. So I've disabled the check for now. |
We can probably fix the empty \opt detection by moving the index entry after the text in \grammarterm. Though I suspect the right fix is to \protect ... something. |
@zygoloid: "We can probably fix the empty \opt detection by moving the index entry after the text in \grammarterm." Well, I tried this (unrelated to \opt), and it messes up kerning / spacing, for example when a period or comma follows. |
You might try the |
@godbyk: It does avoid the error for \opt{\grammarterm{blah}}, but adds a new package dependency. Also, I've simply put an \opt in the middle of running text (no braces), and it doesn't flag the misuse. I'm inclined to believe that I'm fighting an uphill battle against TeX's basic parser here, and we should simply give up on checking for empty \opt arguments. |
If you write The |
@godbyk: Ah, ok. Hm... But that's one of the main motivations/use-cases here: |
f6a49d9
to
10f31b5
Compare
@jensmaurer Ah, I see. Well, it's doable, but it's a bit tricky. One way would be to rewrite the macro to not take an argument via However, it might be easier to just add a |
10f31b5
to
0f7b52c
Compare
@godbyk: Agreed regarding adding a Travis-CI check. Done. |
0f7b52c
to
15f164a
Compare
15f164a
to
490135e
Compare
Rebased. |
…x; adjust introductory text for index of grammar productions. (#1858)
@jensmaurer: Could you please take a look at the grammarterm index log? There are a lot of warnings now. |
@tkoeppe: I see these warnings: Warning (input = grammarindex.idx, line = 2206; output = grammarindex.ind, line = 8):-- Conflicting entries: multiple encaps for the same page under same key. which is caused by (e.g.) access-specifier defined on page 227 (bold entry) and used on page 227 (non-bold entry). Two entries on the same page with different formatting is apparently disliked by "makeindex". Do you know how to tell "makeindex" that the "bold" entry should probably win in these cases? Or we can leave the status quo, it's not wrong. |
@jensmaurer: I have no idea, I just noticed this, but I would really really like to not have any warnings. |
@tkoeppe: Well, feel free to create a new issue so that we can discuss this. Preferably not in a merged pull request. |
If desired, we could also add them to the main index. (The main index currently contains only the places where the grammar snippets occur.)
Fixes #1452.