quarto-journals / elsevier

Quarto template for Elsevier Journals
https://quarto-journals.github.io/elsevier/
MIT License
45 stars 19 forks source link

References are not rendering correctly in the template #25

Closed luifrancgom closed 1 month ago

luifrancgom commented 1 month ago

Description

I am using the template with the command quarto use template quarto-journals/elsevier where I can render the template but the two sample references, @Feynman1963118 and @Dirac1953888, are not rendering in the pdf file correctly

Actual result

Screenshot 2024-05-15 124726

Expected result or something similar

Screenshot 2024-05-15 125408

Possible problem and what I try

See Why do I get (author?) when I use \citet with natbib? on StackExchange

Also I was not able to render the document using the option natbiboptions with the following options:

format:
  elsevier-pdf:
    keep-tex: true
    natbiboptions: longnamesfirst
    journal:
      name: Journal Name
      formatting: preprint
      model: 3p
      cite-style: super
format:
  elsevier-pdf:
    keep-tex: true
    natbiboptions: 
      - longnamesfirst
      - angle
      - semicolon
    journal:
      name: Journal Name
      formatting: preprint
      model: 3p
      cite-style: super
format:
  elsevier-pdf:
    keep-tex: true
    natbiboptions: longnamesfirst,angle,semicolon
    journal:
      name: Journal Name
      formatting: preprint
      model: 3p
      cite-style: super

Or adding the biblio-style option:

biblio-style: model1-num-names
format:
  elsevier-pdf:
    keep-tex: true
    natbiboptions: longnamesfirst,angle,semicolon
    journal:
      name: Journal Name
      formatting: preprint
      model: 3p
      cite-style: super

Tree of the project using the template from quarto

📦test
 ┣ 📂_extensions
 ┣ 📂.quarto
 ┣ 📂.Rproj.user
 ┣ 📂style-guide
 ┣ 📂test_files
 ┣ 📜bibliography.bib
 ┣ 📜elsarticle-num.bst
 ┣ 📜elsarticle.cls
 ┣ 📜placeholder.png
 ┣ 📜test.pdf
 ┣ 📜test.qmd
 ┣ 📜test.Rproj
 ┣ 📜test.spl
 ┗ 📜test.tex

qmd file used

---
title: Short Paper
subtitle: A Short Subtitle
author:
  - name: Alice Anonymous
    email: alice@example.com
    affiliations: 
        - id: some-tech
          name: Some Institute of Technology
          department: Department Name
          address: Street Address
          city: City
          state: State
          postal-code: Postal Code
    attributes:
        corresponding: true
    note: This is the first author footnote.
  - name: Bob Security
    email: bob@example.com
    affiliations:
        - id: another-u
          name: Another University
          department: Department Name
          address: Street Address
          city: City
          state: State
          postal-code: Postal Code
    note: |
      Another author footnote, this is a very long footnote and it should be a really long footnote. But this footnote is not yet sufficiently long enough to make two lines of footnote text.
  - name: Cat Memes
    email: cat@example.com
    affiliations:
        - ref: another-u
    note: Yet another author footnote.
  - name: Derek Zoolander
    email: derek@example.com
    affilations:
        - ref: some-tech
abstract: |
  This is the abstract. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum augue turpis, dictum non malesuada a, volutpat eget velit. Nam placerat turpis purus, eu tristique ex tincidunt et. Mauris sed augue eget turpis ultrices tincidunt. Sed et mi in leo porta egestas. Aliquam non laoreet velit. Nunc quis ex vitae eros aliquet auctor nec ac libero. Duis laoreet sapien eu mi luctus, in bibendum leo molestie. Sed hendrerit diam diam, ac dapibus nisl volutpat vitae. Aliquam bibendum varius libero, eu efficitur justo rutrum at. Sed at tempus elit.
keywords: 
  - keyword1
  - keyword2
date: last-modified
bibliography: bibliography.bib
format:
  elsevier-pdf:
    keep-tex: true
    journal:
      name: Journal Name
      formatting: preprint
      model: 3p
      cite-style: super
---

Please make sure that your manuscript follows the guidelines in the 
Guide for Authors of the relevant journal. It is not necessary to 
typeset your manuscript in exactly the same way as an article, 
unless you are submitting to a camera-ready copy (CRC) journal.

For detailed instructions regarding the elsevier article class, see   <https://www.elsevier.com/authors/policies-and-guidelines/latex-instructions>

# Bibliography styles

Here are two sample references:  @Feynman1963118 @Dirac1953888.

By default, natbib will be used with the `authoryear` style, set in `classoption` variable in YAML. 
You can sets extra options with `natbiboptions` variable in YAML header. Example 

natbiboptions: longnamesfirst,angle,semicolon


There are various more specific bibliography styles available at
<https://support.stmdocs.in/wiki/index.php?title=Model-wise_bibliographic_style_files>. 
To use one of these, add it in the header using, for example, `biblio-style: model1-num-names`.

## Using CSL 

If `cite-method` is set to `citeproc` in `elsevier_article()`, then pandoc is used for citations instead of `natbib`. In this case, the `csl` option is used to format the references. By default, this template will provide an appropriate style, but alternative `csl` files are available from <https://www.zotero.org/styles?q=elsevier>. These can be downloaded
and stored locally, or the url can be used as in the example header.

# Equations

Here is an equation:
$$ 
  f_{X}(x) = \left(\frac{\alpha}{\beta}\right)
  \left(\frac{x}{\beta}\right)^{\alpha-1}
  e^{-\left(\frac{x}{\beta}\right)^{\alpha}}; 
  \alpha,\beta,x > 0 .
$$

Inline equations work as well: $\sum_{i = 2}^\infty\{\alpha_i^\beta\}$

# Figures and tables

@fig-meaningless is generated using an R chunk.

```{r}
#| label: fig-meaningless
#| fig-cap: A meaningless scatterplot
#| fig-width: 5
#| fig-height: 5
#| fig-align: center
#| out-width: 50%
#| echo: false
plot(runif(25), runif(25))

Tables coming from R

Tables can also be generated using R chunks, as shown in @tbl-simple example.

#| label: tbl-simple
#| tbl-cap: Caption centered above table
#| echo: true
knitr::kable(head(mtcars)[,1:4])

References {-}


## Environment 

- OS: Windows 11 Pro
- IDE: RStudio 2024.04.1+748 "Chocolate Cosmos" 

## Quarto check

```bash
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.13: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.5.31
      Path: C:\Users\Usuario\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: 869685

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\Usuario\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2024

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.11.8 (Conda)
      Path: C:/Users/Usuario/anaconda3/python.exe
      Jupyter: 5.7.1
      Kernels: ir, julia-1.9, python3

[>] Checking Jupyter engine render....OK

[>] Checking R installation...........OK
      Version: 4.4.0
      Path: C:/PROGRA~1/R/R-44~1.0
      LibPaths:
        - C:/Users/Usuario/AppData/Local/R/win-library/4.4
        - C:/Program Files/R/R-4.4.0/library
      knitr: 1.46
      rmarkdown: 2.26

[>] Checking Knitr engine render......OK
luifrancgom commented 1 month ago

Sorry for posting this as an issue. I didn't understand initially the documentarion. Now I understand the problem in relation to the cite-style option and the super value.