jgm/pandoc

The First Paragraph style of reference docx can only work on the first paragraph, and the following paragraphs cannot work

InnocenseYu opened this issue · 3 comments

Run the input.md document with panrun, the command is panrun input.md, the document content and frontmatter information are as follows:

---
output:
    docx:
        from: markdown
        to: docx
        output: output.docx
---

## heading2

First paragraph.

Second paragraph.

Reference docx is exported using the pandoc -o custom-reference.docx --print-default-data-file reference.docx command, it has been renamed to reference.docx in the USERDATA default directory and can be called normally.

Currently, only the Heading 2 style Font format is changed to black, bold and the Paragraph format of the First Paragraph style is indented 0.85cm into the first line. Other contents are not changed.

The following is the reference.docx document.
reference.docx

Result:The First paragraph. in the output file output.docx is indented by 0.85cm, but the Second paragraph. is not indented.

Pandoc version?
windows10, pandoc 3.1.12.3

jgm commented

Isn't this what you would expect to happen? The "First Paragraph" style only affects the first paragraph in a section. That is what it's for.

I think the First Paragraph style should affect all body paragraphs of the section. As described in my test case, it should also apply to the Second paragraph., like First paragraph., same thing with an indentation. Here are my test results:

image

I hope that the subsequent paragraph style is the same as the previous paragraph. Here's What I expect:

image

Maybe I didn't set the parameters for pandoc or the style for 'reference.docx' , but I haven't been able to get the results I was hoping for so far. I wonder if you have any advice to share with us, please.

jgm commented

I think the First Paragraph style should affect all body paragraphs of the section.

No. That is why it's called the First Paragraph style. It's only for the first paragraph in a section. Adjust "Body Text" style if you want to affect other paragraphs.