Skip to content
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

TOC tabs leader implementation missing #1696

Open
anti-the-social opened this issue Oct 5, 2022 · 0 comments
Open

TOC tabs leader implementation missing #1696

anti-the-social opened this issue Oct 5, 2022 · 0 comments

Comments

@anti-the-social
Copy link
Contributor

anti-the-social commented Oct 5, 2022

Guten tag :)

One of the settings for the Table Of Contents is the leader character. (chars between the words and page number) It is implemented in Word via tabs.
new TableOfContents element has many settings just like it should, but we can't set paragraphs properties anyhow yet (I guess because TOC is two paragraphs.) It seems that first paragraph properties affect the whole TOC settings

One lifehack I tried is to set tabs and leader character to the attached style for the certain levels, but that didn't catch up, Word ignores it.
image
image
image

And if I manually add tabs for the first paragraph of the TOC element then Word catches what it meant to do
image

Solution:
I guess we should add additional property to ITableOfContentsOptions Interface, I would guess all the IParagraphOptions because at the moment I am not sure which other features TOC might require. (other than tabs)

Took this demo for testing: https://github.com/dolanmiu/docx/blob/master/demo/28-table-of-contents.ts

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

No branches or pull requests

2 participants