Cross-referencing in rticles

隐身守侯 提交于 2020-01-13 20:37:21

问题


The bookdown offers great cross-referencing options for equations, figures, tables and sections: https://bookdown.org/yihui/bookdown/cross-references.html

However, they seems to not work when I set as an output 'rticles::elsevier_article'.

What are the available options for cross-referencing in rticles?


回答1:


I haven't tried, but there is a possible solution here: https://bookdown.org/yihui/bookdown/a-single-document.html

Particularly, specify in your YAML metadata:

output:
  bookdown::pdf_book:
    base_format: rticles::elsevier_article



回答2:


Since I am new using R Markdown I have decided to post this answer as some people may incur in the same mistake. I have tried myself F Rodriguez-Sanchez answer but it did not work. I got the following message:

! LaTeX Error: File `elsarticle.cls' not found.

! Emergency stop.
<read *> 

Erro: Failed to compile report.tex. See report.log for more info.

It did not work because I was making a rookie mistake since I was trying to add the suggested answer choosing New Markdownand then choosing Document.

I have then tried to open a New R Markdown choosing From Template and Elsevier Journal Article from rticles package. After that, I have used F Rodriguez-Sanchez suggested answer and it worked!

The final yaml header was:

---
title: Short Paper
author:
  - name: Alice Anonymous
    email: alice@example.com
    affiliation: Some Institute of Technology
    footnote: Corresponding Author
  - name: Bob Security
    email: bob@example.com
    affiliation: Another University
address:
  - code: Some Institute of Technology
    address: Department, Street, City, State, Zip
  - code: Another University
    address: Department, Street, City, State, Zip
abstract: |
  This is the abstract.

  It consists of two paragraphs.

journal: "An awesome journal"
date: "`r Sys.Date()`"
bibliography: mybibfile.bib
output:
  bookdown::pdf_book:
    base_format: rticles::elsevier_article
---


来源:https://stackoverflow.com/questions/42331136/cross-referencing-in-rticles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!