@@ -725,6 +725,17 @@ DefConstructorI('\tableofcontents', undef,
725725 push (@s , (qw( ltx:appendix ltx:index ltx:bibliography) )) if @s ;
726726 (select => join (' | ' , @s ),
727727 name => DigestText(T_CS(' \contentsname' ))); });
728+ # Ensure we add the TOC-relevant attributes to the relevant elements.
729+ Tag(' ltx:abstract' , afterOpen => sub {
730+ my ($document , $node , $thing ) = @_ ;
731+ $document -> setAttribute($node , inlist => ' toc' );
732+ GenerateID($document , $node , $thing , ' abstract' );
733+ return ; });
734+ Tag(' ltx:acknowledgements' , autoClose => 1, afterOpen => sub {
735+ my ($document , $node , $thing ) = @_ ;
736+ $document -> setAttribute($node , inlist => ' toc' );
737+ GenerateID($document , $node , $thing , ' acknowledgements' );
738+ return ; });
728739
729740# DefMacroI('\listfigurename', undef, 'List of Figures');
730741DefConstructorI(' \listoffigures' , undef ,
@@ -4085,8 +4096,9 @@ DefConstructorI('\endthebibliography', undef, sub {
40854096 locked => 1);
40864097Let(' \saved@endthebibliography' , ' \endthebibliography' );
40874098# auto close the bibliography and contained biblist.
4088- Tag(' ltx:biblist' , autoClose => 1);
4089- Tag(' ltx:bibliography' , autoClose => 1);
4099+ Tag(' ltx:biblist' , autoClose => 1);
4100+ Tag(' ltx:bibliography' , autoClose => 1,
4101+ afterOpen => sub { $_ [1]-> setAttribute(' inlist' , ' toc' ); });
40904102
40914103# Since SOME people seem to write bibliographies w/o \bibitem,
40924104# just blank lines between apparent entries,
0 commit comments