-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Automatic numbering TOC #193
Comments
Is it the TOC items or the Headings that you want to give automatic numbering? |
It's the Headings I want to give automatic numbering. I only found the code for the headings in the TOC example. |
This feature will depend on the capability to write |
I already had a look at the numbering.xml file some hours ago but as I'm not that used to the word-format it was already hard to identify the parts of my document. |
Hi @fhaubner. Please get the latest $phpWord->addNumberingStyle(
'hNum',
array('type' => 'multilevel', 'levels' => array(
array('pStyle' => 'Heading1', 'format' => 'decimal', 'text' => '%1'),
array('pStyle' => 'Heading2', 'format' => 'decimal', 'text' => '%1.%2'),
array('pStyle' => 'Heading3', 'format' => 'decimal', 'text' => '%1.%2.%3'),
)
)
);
$phpWord->addTitleStyle(1, array('size' => 16), array('numStyle' => 'hNum', 'numLevel' => 0));
$phpWord->addTitleStyle(2, array('size' => 14), array('numStyle' => 'hNum', 'numLevel' => 1));
$phpWord->addTitleStyle(3, array('size' => 12), array('numStyle' => 'hNum', 'numLevel' => 2));
$section->addTitle('Heading 1', 1);
$section->addTitle('Heading 2', 2);
$section->addTitle('Heading 3', 3); See or run |
@fhaubner Can you confirm that this is working so that we can close this issue? Thanks. |
@fhaubner Any news? Can we close this issue? Thanks. |
Hi, sorry for the late reply. I did not have much time since I was moving home from abroad and had a lot to organize the last weeks. Thanks for your efforts, you can close the issue. Best regards Florian Von: Ivan Lanin [mailto:[email protected]] @fhaubner https://github.com/fhaubner Any news? Can we close this issue? Thanks. — |
Thanks. Welcome home :) |
Hallo,
is it possible to insert automatic numbering for the TOC Items?
I looked into the TOC Files but couldn't find any way to do this.
Thanks
Florian
The text was updated successfully, but these errors were encountered: