Search code examples
rlatexr-markdown

biblatex for the unsrt style with super-compact-numeric in square brackets in latex or rmarkdown


My problem arises from here, with the help of @shafee and @samcarter_is_at_topanswers.xyz, where the demo .tex and .rmd are also supplied therein.

My idea is that I want to use biblatex other than natbib to get the same goals. There are several obstacles, since the default biblatex doesn't hold for the unsrt style with super-compact-numeric in square brackets. I try my best to solve them one by one.

the unsrt style (bibstyle)

From https://tex.stackexchange.com/questions/58152/ , we resort to style=trad-unsrt in biblatex-trad, i.e.

\usepackage[backend=bibtex,style=trad-unsrt]{biblatex}

the compact numeric (citestyle)

From https://tex.stackexchange.com/questions/61524, we resort to citestyle=numeric-comp in biblatex, i.e.

\usepackage[backend=bibtex,style=trad-unsrt,citestyle=numeric-comp]{biblatex}

the super style (citestyle; position-of-citation)

From https://tex.stackexchange.com/questions/355111/, we resort to autocite=superscript in biblatex, i.e.

\usepackage[backend=bibtex,style=trad-unsrt,citestyle=numeric-comp,autocite=superscript]{biblatex}

finally; current .tex and .rmd files

tex

\documentclass{article}

\usepackage[hidelinks]{hyperref}
\usepackage[backend=bibtex,style=trad-unsrt,citestyle=numeric-comp,autocite=superscript]{biblatex}
\addbibresource{ref.bib}

\newcommand{\citep}[1]{\autocite{#1}}

\begin{document}

statistics \citep{anderson2003introduction,efron2004least,hastie2009elements}

\printbibliography[heading=bibliography,title=References]
\nocite{*}

\end{document} 

rmd

---
output: 
  pdf_document:
    keep_tex: yes
    citation_package: biblatex
bibliography: ref.bib
biblatexoptions:
  - backend=biber
  - style=trad-unsrt
  - citestyle=numeric-comp
  - autocite=superscript
link-citations: yes
colorlinks: no
header-includes:
  - \newcommand{\citep}[1]{\autocite{#1}}
---

statistics [@anderson2003introduction; @efron2004least; @hastie2009elements]

\nocite{*}

question?

Both .tex and .rmd can compile smoothly and it is nearly successful, while the remaining one thing is that I don't know how to add square brackets to the super-compact-numeric citation. Btw, I also search for similar issues such as here, where the biblatex-ext therein maybe helpful. However, I don't know how to make compatible between biblatex-ext and biblatex-trad. Any other ways?


Solution

  • You could use the chem-angew style:

    \documentclass{article}
    
    \usepackage[hidelinks]{hyperref}
    \usepackage[style=chem-angew,autocite=superscript]{biblatex}
    \addbibresource{ref.bib}
    
    \newcommand{\citep}[1]{\autocite{#1}}
    
    
    \begin{document}
    
    statistics \citep{anderson2003introduction,efron2004least,hastie2009elements}
    
    \printbibliography[heading=bibliography,title=References]
    \nocite{*}
    
    \end{document} 
    

    enter image description here