在 RMarkdown 中使用 orcid 和隶属关系格式化作者姓名

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

我无法像通常使用 LaTeX 那样使用 RMarkdown 制作标题页。

这是我当前的 Markdown 代码:

---
title: 'Research on the use of mirrors on rooftops to focus on Starlink satellites to burn them down because they interfere with amateur astronomy'
author:
- Heinz Doof, University of Okomba, Lucario 52500, Wakanda.
- Phenias Krill, Barry University, Millet Department, Dublin DD 0562, Ireland.
- Ferb Mayo, University of Okomba, Lucario 52500, Wakanda.
- Pablo Macro, Barry University, Millet Department, Dublin DD 0562, Ireland.
date: "19 June 2023"
output:
  pdf_document:
    number_sections: yes
  word_document: default
  html_document:
    df_print: paged
---

这是相应的输出:

我想添加 ORCiD 链接并使用编号对从属关系进行分组。像这样的东西:

latex r-markdown pandoc author orcid
2个回答
0
投票

对于 pdf 输出,要使用 orcid 链接和隶属关系格式化作者姓名,您可以尝试

authblk
orcidlink
Latex 包。

现在为了包含每个作者的从属关系,我使用了 yaml 键

name
affil-id
id
affiliations
。这些将充当 pandoc 模板的插值变量。因此,将 pandoc template for Latex 的内容复制到文件
default.tex
中,然后将
default.tex
文件
\author{$for(author)$$author$$sep$ \and $endfor$}
中的行替换为以下内容,

\usepackage{authblk}
\usepackage{orcidlink}
\renewcommand\Affilfont{\small}

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

$if(affiliations)$
$for(affiliations)$
\affil[$it.id$]{$it.name$}
$endfor$
$endif$

然后使用

template
yaml 键在 rmarkdown 文件中使用此模板。

---
title: 'Research on the use of mirrors on rooftops to focus on Starlink satellites to burn them down because they interfere with amateur astronomy'
author:
  - name: Heinz Doof \orcidlink{0000-0000-0000-0001}
    affil-id: 1,3
  - name: Phenias Krill \orcidlink{0000-0000-0000-0002}
    affil-id: 2
  - name: Ferb Mayo \orcidlink{0000-0000-0000-0003}
    affil-id: 1
  - name: Pablo Macro \orcidlink{0000-0000-0000-0004}
    affil-id: 1
affiliations: 
  - id: 1
    name: University of Okomba, Lucario 52500, Wakanda.
  - id: 2
    name: Barry University, Millet Department, Dublin DD 0562, Ireland.
  - id: 3
    name: University of Ubuntu, some address.
date: July 6, 2023
geometry:
- margin=1in
output:
  pdf_document:
    number_sections: yes
    template: default.tex
---

编织上面的 rmarkdown 文件会生成以下内容,


0
投票

这是一个完美的答案我想知道为什么没有评论

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