Skip to content

Conversation

@sanoakr
Copy link
Contributor

@sanoakr sanoakr commented Dec 3, 2025

Fix table of contents alignment for unnumbered sections

This PR fixes the indentation issue in the table of contents where unnumbered sections (e.g., "Acknowledgments", "Appendix") were not aligned with numbered sections.

Changes

  • Added padding-left: 1.7em to unnumbered items in _toc.scss to align text with numbered items
  • All list items now have list-style-type: none for consistent styling

Before

Unnumbered sections appeared left-aligned, while numbered sections had spacing from the location prefix (e.g., "1 ", "2 ").

After

All section titles now start at the same horizontal position, regardless of numbering.

@iamgio
Copy link
Owner

iamgio commented Dec 5, 2025

Thank you, I'll check as soon as I can :)

@serkonda7
Copy link

Could you maybe add before and after pictures?

@sanoakr
Copy link
Contributor Author

sanoakr commented Dec 7, 2025

  • Add mock/toc.qd demonstrating unnumbered headings in table of contents
  • Below are the pictures of the toc.qd output before and after the commit.
Before_toc After_toc

Copy link
Owner

@iamgio iamgio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, but the solution could be more robust.

  • That 1.7em padding is hardcoded and accounts only for single-digit numbering (1 rather than 1.1) in the default latex theme. Just changing the theme via .theme layout:{minimal} shows visual inconsistencies

    Image
  • This does not specifically look for unnumbered decorative headings (introduced by your last PR), but is rather applied to all ToC entries without any numbering attached. Calling .nonumbering will cause entries to be unnumbered and padding-left to be applied.

Sorry if I'm being finicky! I'd be happy to review again if you'd like to make these changes - I'm not too sure how I would improve it either, maybe I'd let the renderer attach a flag to the ToC entries you're interested in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants