On Fri, Nov 07, 2025 at 07:29:51AM -0500, Benjamin Kalish wrote:
> How can I print a special index by itself and also include its entries in
> the concept index? So that I could have something like:
>
> @node Function Index
> @appendix Function Index
>
> @printindex fn @c print just function index
>
> @node Index
> @appendix Index
>
> @printindex cp @c print combined index
> My exact use case is a little different (I need indexes for particular
> sections and also the combined index at the end) but this makes for a
> concise example and the solution should be the same.
>
> @synindex allows the combined index as desired, but also appears to empty
> the original index so it can't be printed.
As you state the problem, it is not possible, for the reason that you
have explained.
> I'd rather not have to write each indexing command twice. It seems like
> there must be a better way.
You could do it with a macro:
@linemacro indexfn {entry}
@findex \entry\
@cindex \entry\
@end linemacro
Then instead of writing this:
@findex foo
- you write this:
@indexfn foo
That will put the "foo" index entry into both indices, with a single line
in the Texinfo source.