ulyngs / oxforddown

Template for writing an Oxford University thesis in R Markdown; uses the OxThesis LaTeX template and was inspired by thesisdown.
https://ulyngs.github.io/oxforddown/
MIT License
220 stars 81 forks source link

References using CSL #54

Closed gladymarperez closed 2 years ago

gladymarperez commented 2 years ago

Hi Ulrik,

Thanks for maintaining this package! It makes my life easier.

I would like to specify a specific citation style using CSL - as you've recommended here -https://ulyngs.github.io/oxforddown/cites-and-refs.html#citation-appearance-

I have written that file here:

output:
  bookdown::pdf_book:
    citation_package: biblatex
    template: templates/template.tex
    keep_tex: true
    pandoc_args: "--lua-filter=scripts_and_filters/colour_and_highlight.lua"
  bookdown::bs4_book: 
    css: 
      - templates/bs4_style.css
      - templates/corrections.css # remove to stop highlighting corrections
    theme:
      primary: "#6D1919"
    repo: https://github.com/ulyngs/oxforddown
    pandoc_args: "--lua-filter=scripts_and_filters/colour_and_highlight.lua"
  bookdown::gitbook:
    css: templates/style.css
    config:
      sharing:
        facebook: false
        twitter: yes
        all: false
  bookdown::word_document2:
    toc: true   
csl: bibliography/vancouver.csl
link-citations: true
documentclass: book
always_allow_html: true #this allows html stuff in word (.docx) output

I also have this:

citation and bibliography style

bibliography-heading-in-pdf: References

biblatex options

unless you run into 'biber' error messages, use biblatex as it lets you customise your bibliography directly

use-biblatex: true bib-latex-options: "style=numeric-comp, sorting=none, backend=biber, maxcitenames=2, useprefix, doi=true, isbn=false, uniquename=false" #for science, you might want style=numeric-comp, sorting=none for numerical in-text citation with references in order of appearance

However the reference style that I get is not what I anticipated, it looks like the standard LaTeX references? I was wondering if you can help me with this?

Best regards,

Gladymar

ulyngs commented 2 years ago

It seems like you're using an older version of oxforddown -- try downloading a copy of the latest version, and move your content into there, then it should use CSL references.

(I see in your index.Rmd shown, it says "citation_package: biblatex", which will make R Markdown use biblatex)

gladymarperez commented 2 years ago

Brilliant! It works! Thank you so much @ulyngs Best regards, Gladymar