lierdakil / pandoc-crossref

Pandoc filter for cross-references
https://lierdakil.github.io/pandoc-crossref/
GNU General Public License v2.0
952 stars 76 forks source link

Cannot get secPrefix to work for References to Chapters output multiple prefixes for docx file #389

Open aleyner opened 1 year ago

aleyner commented 1 year ago

Hello! I'm looking for a solution to a similar problem (/issues/329). I want to display a section, subsection, paragraph and subparagraph. I convert markdown (github) to docx file. But I can only output the prefix "section" instead of "sec". Can you suggest how I can output multiple prefixes?

 ---
 link-citations: true
 nameInLink: true
 linkReferences: true
 secPrefix:
 - "section"
 - "subsection"                                                   
cref: true
listings: false
codeBlockCaptions: true
 ---

 # Chapter 1 {#sec:section}

Text with reference  [@sec:section] 

 ## Subsection {#sec:subsection}

Text with reference  [@sec:subsection]

I want to get the output:

Chapter 1

Text with reference section 1

Subsection

Text with reference subsection 1.1.

When I change the header structure, my number changes automatically, but the prefix does not. And every time I have to change them manually. I would like to automate this process and not think about such trifles.

My version pandoc-crossref v0.3.7.0 with Pandoc v2.10

lierdakil commented 1 year ago

Hi. Sorry for the prolonged radio silence, this slipped through the cracks. Unfortunately, I don't bring good news, what you want isn't currently possible. secPrefix is an array to allow for proper singular/plural prefixes, e.g. sec. 1 but secs. 1-3 (using an array allows for languages with dual grammatical number as well)

I'll treat it as a feature request, but I can't promise any specific deadlines.

aleyner commented 1 year ago

I'll treat it as a feature request, but I can't promise any specific deadlines.

Thanks for your work and feedback. I will still hope and believe that you will solve this problem sooner or later.