-
Notifications
You must be signed in to change notification settings - Fork 62
Add an index mechanism that works for all formats, not just latex. #273
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit makes that work by changing how we indicate index entries in the
main text.
So far, we used '\index{_text_to_add_to_index_}' in the main text, which is a
latex-specific mechanism. To make this more format-neutral, this patch changes
this to using spans of class "index" to indicate that some text needs to be
added to the index. In this patch, it has the following features. More features
can be added in later patches, if it shows they would be useful.
- An index entry is added by putting the text that should be indexed in a span
with class "index". It looks like this:
...
An [exploit primitive]{.index} is a mechanism
...
This will add "exploit primitive" to the index. Before this patch, this would
be written as:
...
An exploit primitive\index{exploit primitive} is a mechanism
...
- When you want the entry in the index to be different from the text in the span,
use the "entry" attribute on the span. For example:
...
CFI schemes are sometimes classified as [coarse-grained]{.index
entry="coarse-grained CFI"} or [fine-grained]{.index entry="fine-grained
CFI"}.
...
- If you want multi-level index entries, use the same character as in latex
to indicate the different levels. For example:
...
[cache invalidation]{.index entry="cache!invalidation"}
...
will add a sub-entry "invalidation" under the main entry "cache" in the
index.
Member
Author
Member
Author
|
closes: #90 |
Collaborator
|
LGTM. If I had to add a nitpick question: do you think it would be easier visually to separate each index link with some punctuation, maybe a comma? But this patch is more than ready to go in as-is; approved. |
JLouisKaplan-Arm
approved these changes
Aug 21, 2025
Member
Author
JLouisKaplan-Arm
approved these changes
Aug 21, 2025
Collaborator
JLouisKaplan-Arm
left a comment
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.
Agreed - that does look nice. Thanks!
This was referenced Aug 21, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


This commit makes that work by changing how we indicate index entries in the main text.
So far, we used '\index{text_to_add_to_index}' in the main text, which is a latex-specific mechanism. To make this more format-neutral, this patch changes this to using spans of class "index" to indicate that some text needs to be added to the index. In this patch, it has the following features. More features can be added in later patches, if it shows they would be useful.