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

docx writer does not respect yaml toc variable #4645

Closed
tolot27 opened this issue May 11, 2018 · 7 comments
Closed

docx writer does not respect yaml toc variable #4645

tolot27 opened this issue May 11, 2018 · 7 comments

Comments

@tolot27
Copy link
Contributor

tolot27 commented May 11, 2018

The following markdown snippet does not produce a docx with a TOC but a PDF with a TOC:

---
toc: true
toc-title: Inhaltsverzeichnis
...

# Test

Some text.

Only after addint --toc to the command line of pandoc, a TOC is generated in docx but now also with the title defined in the yaml variable toc-title.

@mb21
Copy link
Collaborator

mb21 commented May 11, 2018

Yes, that's due to the fact that the docx writer doesn't use a template. Thus you cannot use metadata to change the writer's behavior.

@tolot27
Copy link
Contributor Author

tolot27 commented May 11, 2018

I don't understand this explanation. Currently, the docx writer supports the yaml variable toc-title but not toc. What's the difference here? And what is ment by "use a template"?
And does it mean this issue is unfixable?

@mb21
Copy link
Collaborator

mb21 commented May 11, 2018

Currently, the docx writer supports the yaml variable toc-title

Ah yes, the docx writer looks up that variable here. So I guess we could do the same thing for toc... or consider something like #4627...

And what is ment by "use a template"?

see http://pandoc.org/MANUAL.html#templates

@tolot27
Copy link
Contributor Author

tolot27 commented May 11, 2018

I'd love to see consistency here with other writers like latex. It would be nice if a writer would read command line switches already made available as yaml variable.
In this case here, toc and toc-depth in addition to toc-title.

WRT to templates: Okay, that kind of templates were already known to me. As far as I know, the docx writer uses a default reference.docx. But you are right at that point that this reference.docx does not check variables like the latex template does, because it is simply not possible.

I already considered panzer. Nevertheless, it is a bit confusing, if one writer supports a yaml variable and its corresponding command line switch, but another only the command line switch.

@jgm jgm closed this as completed in 2936967 May 14, 2018
@mb21
Copy link
Collaborator

mb21 commented May 14, 2018

Note: the following produces a toc for latex, but not html and docx:

---
toc:
  - true
---

# Test

but maybe that's okay...

@tolot27
Copy link
Contributor Author

tolot27 commented May 15, 2018

But does the following work now:

---
toc: true
---

That would be sufficient.

@mb21
Copy link
Collaborator

mb21 commented May 15, 2018

@tolot27 yes it does (current nightly build)

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