kapsner / authors-block

Quarto extension that brings author blocks to docx documents
MIT License
43 stars 4 forks source link

Move affiliation from below to above the table of contents (toc) #1

Open joundso opened 1 year ago

joundso commented 1 year ago

Minor detail: If a table of contents is rendered, the affiliations are currently below it. For simplicity, however, I would expect the affiliations to be between the author names and (above) the table of contents.

Regardless: Many thanks for this awesome template!

joundso commented 1 year ago

Using this _quarto.yml:

---
title: "Authors-block Example"

authors:
  - name: John Doe
    affiliations:
      - ref: jdct
    corresponding: true
    email: john.doe@jdct.edu
    orcid: 0000-1111-2222-3333
    equal-contributor: true
  - name: John Roe
    affiliations:
      - ref: jdct
    orcid: 0000-3333-2222-1111
  - name: Jane Roe
    affiliations:
      - ref: jdct
      - ref: iot
    orcid: 0000-2222-1111-3333
    equal-contributor: true

affiliations:
  - id: jdct
    name: John Doe Center for Technology, John Doe University, Doetown, Germany.
  - id: iot
    name: Institute of Technology, John Doe University, Doetown, Germany.

filters:
  - authors-block

format:
  #native: default
  docx:
    toc: true
  pdf: default
---

# Brings Quarto's Standardized Authors- & Affiliations-Block to docx-Documents

## Heading 2

Demo text.

Produces this output (with the affiliation below the table of contents): grafik

kapsner commented 1 year ago

Thx for this catch. I'll have a look into this soon.

kapsner commented 1 year ago

Hi @tarleb , it seems as if the toc information is included in the "meta" element, as affiliations, contribution statements etc. are added to the body. However, I have not found a possibility to access the "toc" from meta (actually, I do not know which key to use as "toc", "tableofcontents", "table-of-contents" all seem to be wrong), to move the toc to the beginning of the body-list. Any ideas how to solve this?

tarleb commented 1 year ago

This is a known limitation and currently not really solvable. Pandoc 3 will come with support for advanced custom writers, we'll have to wait till then.