为什么在 quarto 的 pdf 输出中重复相同的隶属关系?

问题描述 投票:0回答:1

四开本文档 quarto-file.md 重复相同的从属关系:

---
title: "Hey!"
author:
  - name: Birdy Bird
    affiliations:
      - University of Birds
  - name: None
    affiliations:
      - University of Birds
format: 
  pdf:
    keep-tex: true
    template-partials: 
      - title.tex
    include-in-header:
      text: |
        \usepackage[noblocks]{authblk}
        \renewcommand*{\Authsep}{, }
        \renewcommand*{\Authand}{, }
        \renewcommand*{\Authands}{, }
        \renewcommand\Affilfont{\small}
---

## Quarto

Quarto enables you to weave together content and executable code into a finished
document. To learn more about Quarto see <https://quarto.org>.

quarto-file-render

我希望不要重复相同的隶属关系,但这在类似问题的答案中使用title.tex不起作用:

$if(title)$
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
$endif$

$if(subtitle)$
\subtitle{$subtitle$}
$endif$

$for(by-author)$
\author[$for(by-author.affiliations)$$it.number$$sep$,$endfor$]{$by-author.name.literal$}
$endfor$

$for(by-author)$
$if(by-author.affiliations)$
$for(by-author.affiliations)$
\affil[$it.number$]{$if(by-author.affiliations.name)$$by-author.affiliations.name$$endif$}
$endfor$
$endif$
$endfor$


\date{$date$}

如何让相同的隶属关系只出现一次(上标相同)?

r pdf latex pdflatex quarto
1个回答
1
投票

您可以使用authors-block扩展,例如

---
title: "Hey!"
authors:
  - name: Birdy Bird
    affiliations:
      - ref: bird
  - name: None
    affiliations:
      - ref: bird

affiliations:
  - id: bird
    name: University of Birds.
      
filters:
  - authors-block

format: pdf
---

## Quarto

Quarto enables you to weave together content and executable code into a finished
document. To learn more about Quarto see <https://quarto.org>.

© www.soinside.com 2019 - 2024. All rights reserved.