rstudio / rticles

LaTeX Journal Article Templates for R Markdown
https://pkgs.rstudio.com/rticles/
1.47k stars 519 forks source link

Citations not working? #54

Closed zkamvar closed 8 years ago

zkamvar commented 8 years ago

I've noticed that the examples are not adding the citations correctly. I can't tell whether or not this is stemming from rticles, rmarkdown, or pandoc. Pandoc used to render these and add the bibliography as plain text, but now it's simply leaving the latex citations alone. Does anyone have any insight on this?

Note, I'm using MacTeX 2015.

Here's my sessioninfo:

devtools::session_info()

Session info --------------------------------------------------------------

 setting  value                       
 version  R version 3.2.3 (2015-12-10)
 system   x86_64, darwin13.4.0        
 ui       X11                         
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/Los_Angeles         
 date     2015-12-14                  

Packages ------------------------------------------------------------------

 package    * version date       source                            
 colorspace   1.2-6   2015-03-11 CRAN (R 3.2.0)                    
 devtools     1.9.1   2015-09-11 CRAN (R 3.2.0)                    
 digest       0.6.8   2014-12-31 CRAN (R 3.2.0)                    
 evaluate     0.8     2015-09-18 CRAN (R 3.2.0)                    
 formatR      1.2.1   2015-09-18 CRAN (R 3.2.0)                    
 ggplot2    * 2.0.0   2015-12-15 Github (hadley/ggplot2@a6494bf)   
 gtable       0.1.2   2012-12-05 CRAN (R 3.2.0)                    
 htmltools    0.2.6   2014-09-08 CRAN (R 3.2.0)                    
 knitr        1.11    2015-08-14 CRAN (R 3.2.2)                    
 labeling     0.3     2014-08-23 CRAN (R 3.2.0)                    
 magrittr     1.5     2014-11-22 CRAN (R 3.2.0)                    
 memoise      0.2.1   2014-04-22 CRAN (R 3.2.0)                    
 munsell      0.4.2   2013-07-11 CRAN (R 3.2.0)                    
 plyr         1.8.3   2015-06-12 CRAN (R 3.2.0)                    
 Rcpp         0.12.2  2015-11-15 CRAN (R 3.2.2)                    
 rmarkdown    0.8.3   2015-12-15 Github (rstudio/rmarkdown@558e380)
 rticles      1.0     2015-12-15 Github (rstudio/rticles@a4f3dbe)  
 scales       0.3.0   2015-08-25 CRAN (R 3.2.0)                    
 stringi      1.0-1   2015-10-22 CRAN (R 3.2.0)                    
 stringr      1.0.0   2015-04-30 CRAN (R 3.2.0)                    
 yaml         2.1.13  2014-06-12 CRAN (R 3.2.0)                    

Here's the output for the FrontiersTemplate:


processing file: deleteme.Rmd
  |.........                                                        |  14%
  ordinary text without R code

  |...................                                              |  29%
label: graph (with options) 
List of 3
 $ echo    : logi TRUE
 $ message : logi FALSE
 $ fig.show: chr "hide"

Loading required package: ggplot2
cropping deleteme_files/figure-latex/graph-1.pdf
PDFCROP 1.38, 2012/11/02 - Copyright (c) 2002-2012 by Heiko Oberdiek.
==> 1 page written on `deleteme_files/figure-latex/graph-1.pdf'.
  |............................                                     |  43%
  ordinary text without R code

  |.....................................                            |  57%
label: sessioninfo
  |..............................................                   |  71%
  ordinary text without R code

  |........................................................         |  86%
label: Figure-1 (with options) 
List of 10
 $ ref.label : chr "graph"
 $ results   : chr "hide"
 $ echo      : logi FALSE
 $ message   : logi FALSE
 $ fig.height: num 4
 $ fig.width : num 4
 $ fig.align : chr "center"
 $ fig.cap   : chr "Figure caption"
 $ out.width : chr "85mm"
 $ out.height: chr "85mm"

cropping deleteme_files/figure-latex/Figure-1-1.pdf
PDFCROP 1.38, 2012/11/02 - Copyright (c) 2002-2012 by Heiko Oberdiek.
==> 1 page written on `deleteme_files/figure-latex/Figure-1-1.pdf'.
  |.................................................................| 100%
  ordinary text without R code

/usr/local/bin/pandoc +RTS -K512m -RTS deleteme.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output deleteme.tex --template /Users/zhian/R/rticles/rmarkdown/templates/frontiers_article/resources/template.tex --highlight-style tango --latex-engine /Library/TeX/texbin/pdflatex --natbib --bibliography test.BIB 
output file: deleteme.knit.md

Latexmk: This is Latexmk, John Collins, 5 February 2015, version: 4.43a.

Output created: deleteme.pdf
yihui commented 8 years ago

Could you provide or point to a reproducible example?

zkamvar commented 8 years ago

Reproducible R script:

mwe.R

#!/usr/bin/env R
devtools::install_github(c("rstudio/rmarkdown", "rstudio/rticles"))
rmarkdown::draft("mwe.Rmd", template = "frontiers_article", package = "rticles", edit = FALSE)
rmarkdown::render("mwe/mwe.Rmd")

Run environment

Running in the rocker/hadleyverse (latest):

docker run --rm -ti -v $(pwd):/MWE rocker/hadleyverse:b6zbrvoigyzstla9sdaocb8 /bin/bash
cd MWE
Rscript mwe.R &> out.txt
exit

PDF output: mwe.pdf

Pandoc

pandoc 1.13.1
Compiled with texmath 0.8.0.1, highlighting-kate 0.5.11.1.
Syntax highlighting is supported for the following languages:
    abc, actionscript, ada, agda, apache, asn1, asp, awk, bash, bibtex, boo, c,
    changelog, clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css,
    curry, d, diff, djangotemplate, dockerfile, dot, doxygen, doxygenlua, dtd,
    eiffel, email, erlang, fasm, fortran, fsharp, gcc, glsl, gnuassembler, go,
    haskell, haxe, html, ini, isocpp, java, javadoc, javascript, json, jsp,
    julia, latex, lex, lilypond, literatecurry, literatehaskell, lua, m4,
    makefile, mandoc, markdown, mathematica, matlab, maxima, mediawiki,
    metafont, mips, modelines, modula2, modula3, monobasic, nasm, noweb,
    objectivec, objectivecpp, ocaml, octave, opencl, pascal, perl, php, pike,
    postscript, prolog, pure, python, r, relaxng, relaxngcompact, rest, rhtml,
    roff, ruby, rust, scala, scheme, sci, sed, sgml, sql, sqlmysql,
    sqlpostgresql, tcl, tcsh, texinfo, verilog, vhdl, xml, xorg, xslt, xul,
    yacc, yaml, zsh
Default user data directory: /root/.pandoc
Copyright (C) 2006-2014 John MacFarlane
Web:  http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

LaTeX

pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian)
kpathsea version 6.2.1
Copyright 2015 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.17; using libpng 1.6.17
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.38.0
yihui commented 8 years ago

Should be fixed via rstudio/rmarkdown#578. Sorry.

github-actions[bot] commented 3 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.