1

I want to insert references prior to appendix in my rmarkdown latex document using <div id = "refs"></div> (source: R Markdown: place an Appendix after the "References" section?). But my reference section keeps showing up at the end. Could you find any error in my rmarkdown setting or text? Is there anyway to reduce my lengthy rmarkdown yaml header?

---
title: "Paper"   
thanks: 
author: |
  | \normalfont Joe
output: 
  pdf_document:
    number_sections: true
    citation_package: natbib
    fig_caption: true
    fig_height: 4.5
    fig_width: 8
link-citations: yes
toc: false
bibliography: /Users/references02.bib
biblio-style: apalike    
in_header: preamble.tex
keep_tex: yes
fontsize: 11pt
linestretch: 1.3
subparagraph: true
number_sections: true
geometry: margin=1in
header-includes:
- \usepackage{amsmath}
- \usepackage{amsthm}
- \numberwithin{equation}{section}
- \usepackage{makecell}
- \usepackage{geometry}
- \usepackage{graphicx}
- \usepackage{tikz}
- \usepackage{verbatim}
- \usepackage{chronosys}
- \usepackage{stackengine}
- \usepackage{booktabs, colortbl, xcolor}
- \usepackage{babel}
- \usetikzlibrary{arrows.meta,calc}
- \usepackage[font=small]{caption}
- \usepackage{adjustbox}
- \usepackage{tabularx}
- \usepackage{pgfplots}
- \usepackage[makeroom]{cancel}
- \usetikzlibrary{arrows,decorations.markings}
- \usetikzlibrary{intersections}
- \usepackage[nottoc]{tocbibind}
- \usepackage{filecontents}
- \newtheorem{prop}{Proposition}
- \newtheorem{definition}{Definition}
- \newtheorem{algorithem}{Algorithm}
- \usepackage[T1]{fontenc}
- \usepackage[toc,page]{appendix}
- \usepackage{tabularx,ragged2e,booktabs,caption}
- \newenvironment{rcases}
  {\left.\begin{aligned}}
  {\end{aligned}\right\rbrace}
- \renewcommand{\refname}{References}
- \UseRawInputEncoding
- \usepackage[utf8]{inputenc}
- \usepackage{hyperref}
- \hypersetup{
     colorlinks=true,
     linkcolor=black,
     filecolor=blue,
     citecolor = blue,      
     urlcolor=blue,
     }
- \usepackage{subcaption}
- \usepackage[font=small,labelfont=bf]{caption}
- \usepackage{float}
- \usepackage{flafter}
- \floatstyle{plaintop}
- \restylefloat{table}
- \setlength{\parindent}{2em}
- \setlength{\parskip}{0em}
- \usepackage{adjustbox}
- \usepackage[style=english]{csquotes} 
- \usepackage[nameinlink,capitalize,noabbrev]{cleveref}
- \creflabelformat{equation}{#2\textup{(\textcolor{red}{#1})}#3}
- \creflabelformat{figure}{#2\textcolor{red}{#1}#3}
- \creflabelformat{table}{#2\textcolor{red}{#1}#3}
- \creflabelformat{section}{#2\textcolor{red}{#1}#3}
- \usepackage{dcolumn}
- \usepackage{rotating}
- \usepackage{siunitx}
---


blah blah

\pagebreak

<div id = "refs"></div>

\pagebreak
\begin{appendices}
jck21
  • 751
  • 4
  • 16
  • 1
    https://stackoverflow.com/questions/51335125/adding-figures-and-tables-after-bibliography-in-rmarkdown **Look this:** "Note: this will only work if you use pandoc's built-in citation package and **won't work** if you set citation_package: **natbib** in the YAML" – manro Dec 21 '21 at 22:25
  • usually in RMarkdown, HTML code doesn't render properly when the output document is PDF – Daniel_j_iii Dec 22 '21 at 00:09
  • @manro, do you think I should use another citation package like `biblatex`? – jck21 Dec 22 '21 at 12:57
  • 1
    @joe I think, yes. Look: https://tex.stackexchange.com/questions/33099/references-before-appendix – manro Dec 22 '21 at 13:17

0 Answers0