Add nucleotide acid research template
I'll work on the NAR template. this issue serves as a record.
By filing an issue to this repo, I promise that
- [x] I have fully read the issue guide at https://yihui.name/issue/.
- [x] I have provided the necessary information about my issue.
- If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
- If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included
xfun::session_info('rticles'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/rticles'). - If I have posted the same issue elsewhere, I have also mentioned it in this issue.
- [x] I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
Basically working. Some issues:
-
The skeleton is quite bulky as I copied&pasted the original draft from
nar-sample.tex. -
The bibliography is a bit strange without using natbib in pandoc(nar-sample.tex doesn't use natbib) but I can't get the non-natbib bibliography to work at the moment:
- NAR.cls from https://github.com/dcjones/quip-paper/blob/master/NAR.cls
- nar.bst from https://github.com/dcjones/quip-paper/blob/master/nar.bst Now the bibliography and style are consistent with the nar-sample.
-
longtable(pandoc's default) doesn't work in this template because nar is 2-column, similar to #72. So I provided a table example using
knitr::kable(format="latex") -
Figures are fine. and I figured out the
fig.env="figure*"trick. for two-column figure. -
I noticed that the syntax for cross-reference from bookdown::pdf_document2() is different from the default
rmarkdown::pdf_document()
hyperlinks likehttps://github.com/sokrypton/GREMLIN_CPP in rmd will be translated into\url{https://github.com/sokrypton/GREMLIN_CPP} and failed to compile investigating.
~~bibliography seems broken.I can use latexmk -pdf xxx.tex to generate the correct bibliography, but the knit button won't generate the desired bib.~~
Seems that \usepackage{hyperref} is not included in the original nar.cls. This package is required for \url{} to which pandoc convert all links.
List items will report an undefined control sequence error.
add the following command seems to fix the issue.
\def\tightlist{}
source https://tex.stackexchange.com/questions/257418/error-tightlist-converting-md-file-into-pdf-using-pandoc/408474
Strange behaviour on natbib:
if there's \label{xxx} in the rmd, the natbib bibliography will appear in the final pdf as expected.
deleting \label{xxx}, all references are gone and report undefined references:
Package natbib Warning: There were undefined citations.
But the generated test.tex can be correctly compiled with bibliography with
latexmk -pdf test.tex
So the issue is narrowed down to how rmarkdown calls the latex engine AFTER the .tex file is generated.
MRE:
devtools::install_github("tcgriffith/rticles", ref="nar_dev")
rmarkdown::render("./test.Rmd")
test.Rmd, delete \label{aaa} will remove bibliography
---
title: Template for preparing your research report submission to NAR using RMarkdown
bibliography: NAR-sample.bib
output: rticles::nar_article
---
# Introduction
\label{aaa}
[@NovikovaSizinglongnoncoding2012]
NAR-sample.bib
@Article{NovikovaSizinglongnoncoding2012,
title = {Sizing up Long Non-Coding {{RNAs}}: {{Do lncRNAs}} Have Secondary and Tertiary Structure?},
volume = {2},
issn = {1949-0992},
shorttitle = {Sizing up Long Non-Coding {{RNAs}}},
number = {6},
journal = {BioArchitecture},
doi = {10.4161/bioa.22592},
author = {Irina V. Novikova and Scott P. Hennelly and Karissa Y. Sanbonmatsu},
month = {nov},
year = {2012},
keywords = {cancer,epigenetics,RNA structure,hormone receptor,HOTAIR,lincRNA,lncRNA,long noncoding RNA,MALAT,non-coding,RNA,secondary structure,structural biology},
pages = {189-199},
file = {/home/tc/.mozilla/firefox/wh762y60.default/zotero/storage/H9MYM9JS/Novikova et al. - 2012 - Sizing up long non-coding RNAs Do lncRNAs have se.pdf;/home/tc/.mozilla/firefox/wh762y60.default/zotero/storage/EVMVWMGZ/bioa.html},
pmid = {23267412},
}
This is still open. The first PR has been close because it needs a rework. It can be used as base for a new one. If anyone is willing to help @tcgriffith on this one, feel free to join ! Thanks.