rstudio / rticles

LaTeX Journal Article Templates for R Markdown
https://pkgs.rstudio.com/rticles/
1.47k stars 518 forks source link

Add cross-references to `mdpi_article` template. #327

Closed etiennebr closed 3 years ago

etiennebr commented 3 years ago

@dleutnant I only see upsides to change the default template, but I'm completely new to this, so maybe it's not a good idea. I'm following the advice from https://github.com/rstudio/rticles/pull/208#pullrequestreview-214734427.

close #326

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

cderv commented 3 years ago

I believe the user itself should choose it one want to use bookdown features with one of the rticles format.

The aim is here is to document that it works with bookdown ?

Maybe we could just add a second output format to the skeleton and not replace it completely ? Otherwise we should do that for all formats in rticles.

Let's note that rticles is also Tex/PDF only output so the referencing mechanism from latex works

This is an equation
\begin{equation} \label{eq:1}
c = a \cdot b
\end{equation}

see \ref{eq:1}
etiennebr commented 3 years ago

Thanks for clarifying @cderv. I must say not having the references for scientific paper confused me initially. And from my experience, the \label does not work with all outputs (let's say to share a Word pre-print).

Otherwise we should do that for all formats in rticles. Indeed, being new to this, I wonder why not because cross-references working out-of-the-box seems like a solid benefit for writing scientific papers. Just so I understand, is it to avoid an additional dependency (which I can understand)?

I think adding a second output would help, and maybe if the syntax was changed for consistency?

output:
  rmarkdown::pdf_document:
    base_format: rticles::mdpi_article
  bookdown::pdf_book: 
    base_format: rticles::mdpi_article

This indeed could apply to all rticles, no? I'll close this PR, and open an other issue for discussion.

etiennebr commented 3 years ago

closing for #328

cderv commented 3 years ago

And from my experience, the \label does not work with all outputs (let's say to share a Word pre-print).

That is exactly the purpose of bookdown's implementation: offer it for several output.

I understand you would output a word document from a document designed for mdpi article from example ? rticles output format and template are not designed for other type of output than pdf for now.

and maybe if the syntax was changed for consistency?

This would be

output:
  rticles::mdpi_article: default
  bookdown::pdf_book: 
    base_format: rticles::mdpi_article

rticles::mdpi_article already is basically calling pdf_document with a custom template