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

<ol start="50"> equivalent? #291

Closed
alpha1125 opened this issue Jun 24, 2014 · 2 comments
Closed

<ol start="50"> equivalent? #291

alpha1125 opened this issue Jun 24, 2014 · 2 comments

Comments

@alpha1125
Copy link

Say I have a list:

  1. Item A
  2. Item B
  3. Item C
    ----
  4. Item D
  5. Item E
  6. Item F
  • List Alpha
  • I start a new section/paragraph.
  • List Beta, should restart at 1, or be able to pick an arbitrary number.

I would like to restart the list count to begin at one (or the first one) again. Can this be done, if so, how? Sample 14 isn't exactly clear to me.

Thanks.

@ivanlanin ivanlanin added this to the 0.12.0 milestone Jun 28, 2014
@ivanlanin ivanlanin self-assigned this Jun 28, 2014
@ivanlanin
Copy link
Contributor

I'm not pretty sure what you need, but try this:

$phpWord->addNumberingStyle(
    'alphanum',
    array('type' => 'multilevel', 'levels' => array(
        array(
            'format' => 'decimal', 'text' => '%1.',
            'left' => 360, 'hanging' => 360, 'tabPos' => 360),
        )
    )
);
$phpWord->addNumberingStyle(
    'betanum',
    array('type' => 'multilevel', 'levels' => array(
        array(
            'format' => 'decimal', 'text' => '%1.',
            'left' => 360, 'hanging' => 360, 'tabPos' => 360),
        )
    )
);

$section->addText('Alpha');
$section->addListItem('A', 0, null, 'alphanum');
$section->addListItem('B', 0, null, 'alphanum');
$section->addListItem('C', 0, null, 'alphanum');

$section->addText('Beta');
$section->addListItem('D', 0, null, 'betanum');
$section->addListItem('E', 0, null, 'betanum');
$section->addListItem('F', 0, null, 'betanum');

That code will produce this:
2014-06-28-121433-ss

@alpha1125
Copy link
Author

It was user error.

I wasn't setting adding a new addNumberingStyle to start a new list.

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

No branches or pull requests

2 participants