question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Numbering start from number doesn't work

See original GitHub issue

My greetings 😃 This list men to to start from 50, but it does not. Do I do something wrong or feature got corrupted? Tested on 6.0.1, 6.0.3 Based on: https://github.com/dolanmiu/docx/blob/7acd9e1/src/file/numbering/level.ts#L89 image

const fs = require('fs');
const { Document, Packer, Paragraph, PageNumberFormat} = require('docx');

const doc = new Document({
  numbering:{
    config:[{
      reference: 'ref1',
      levels: [
        {
          level: 0,
          format: PageNumberFormat.DECIMAL,
          text: '%1)',
          start: 50,
        }
      ],
    }]
  },
  sections: [{
    children: [
      new Paragraph({
        text: "REF1 - inst:0 - lvl:0",
        numbering : {
          reference: 'ref1',
          instance: 0,
          level: 0,
        }
      }),
      new Paragraph({
        text: "REF1 - inst:0 - lvl:0",
        numbering : {
          reference: 'ref1',
          instance: 0,
          level: 0,
        }
      }),
      new Paragraph({
        text: "REF1 - inst:0 - lvl:0",
        numbering : {
          reference: 'ref1',
          instance: 0,
          level: 0,
        }
      }),
    ],
  }]
});

// Used to export the file into a .docx file
Packer.toBuffer(doc).then((buffer) => {
    fs.writeFileSync("start_numbering.docx", buffer);
});

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
anti-the-socialcommented, Aug 7, 2021

@TheDarkStrix Can you create some easy example for me to run to illustrate the problem? (Just like I did in the issue description) This way it would be a little easier to understand what exactly doesn’t work.

1reaction
anti-the-socialcommented, Aug 2, 2021

I would close the issue, since the first stated problem solved by merged https://github.com/dolanmiu/docx/pull/1057 @tiejunhu I think it worth opening new issue if your problem persists. Or you can reopen if you like…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the numbering in a numbered list - Microsoft Support
Double-click the numbers in the list. The text will not appear selected. Numbers selected. Right-click the number you want to start a new...
Read more >
Word: Solutions for Common Issues with Numbered Lists
This is a simple fix. Right click on top of the number 1 next to the word Brouhaha.
Read more >
Word: When Restart Numbering doesn't work
Put your cursor at the beginning of the second item (was the first), and right-click. Select Restart Numbering. Your second item should now...
Read more >
Word will not set the Numbering Value that I choose
Right click the number · Click 'Adjust List Indents...' · Click 'More >>' (bottom left) · Untick the 'Restart lst after:' option on...
Read more >
Correct a Word document when lists won't renumber correctly
It can be frustrating the numbered list in your Word document keeps starting at the wrong number -- even if you select Restart...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found