-
Notifications
You must be signed in to change notification settings - Fork 25
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
Figure number reset for figures in different headings #76
Comments
Happens only in the docx/odt writers for me. PDF is correctly numbered. |
Thanks @p3palazzo, I also didn't check latex or html compatibility either because my use case is docx for this application. Minimally, I would expect design behavior to be consistent between docx/odt/pdf/latex/html/etc unless I've missed something in terms of design criteria. Advice on how to dig in is appreciated. My work-around will be to just hard code figure numbers for now. |
@pwolfram @p3palazzo The reason why PDF is correctly numbered is that LaTeX/pdf does the numbering itself whereas for other output formats, pandoc-fignos must do hard-code the figure numbers. I had a quick look at the code and believe the reason for this is that the figure number is reset in every section irrespective of whether fignos-number-by-section is set or not. A patch for this might be:
By the way, this will also affect the other pandoc-*nos filters. |
Thank you @ValiValpas. The patch works in all common use cases (PDF, DOCX, ODT, HTML). When setting |
What is the culture here for PRs/patches? Don't know what my responsibility as a contributor is in this venue but can help on this later next week. Thanks everyone for digging in and for the solution! |
This happens when converting markdown to HTML. Works fine for PDF. |
@ValiValpas should be the one making the pull request because he came up with the solution, otherwise we'd be taking credit for his work. |
Thanks! But what is the status of this fix? @ValiValpas, did you actually make the pull request? I can't see it. |
@Dabsen, I referenced this issue in my commit so that my commit is shown in this issue. A pull request is not necessary, it would just create another issue that needs to be referenced and synced with this one. |
I'm having this issue. A workaround (by the user) is to add "secno=1" attribute to every figures. E.g.
|
This is a workaround to issue tomduck/pandoc-fignos#76.
Thank you for this report and discussion, which were helpful. Sorry for the long wait. The problem is now fixed in the Tom |
pandoc-fignos 2.3.0 is now released. --Tom |
Figures numbers are reset under different headings, e.g., for a file
tester.md
,built by
![image](https://user-images.githubusercontent.com/4295853/73375380-f446a280-4278-11ea-92cb-d8e523a00a1d.png)
pandoc -o tester.docx -f markdown -t docx tester.md --filter=pandoc-xnos; open tester.docx
produces output like
Is this expected behavior?
Version info:
The text was updated successfully, but these errors were encountered: