Coder Social home page Coder Social logo

rstudio / rticles Goto Github PK

View Code? Open in Web Editor NEW
1.4K 42.0 516.0 9.91 MB

LaTeX Journal Article Templates for R Markdown

Home Page: https://pkgs.rstudio.com/rticles/

R 2.28% TeX 83.12% Makefile 0.05% Lua 0.03% JavaScript 0.02% HTML 0.02% PostScript 14.48%
r journal paper article rmarkdown r-package

rticles's Introduction

R-CMD-check Downloads from the RStudio CRAN mirror CRAN status Codecov test coverage

rticles

The rticles package provides a suite of custom R Markdown LaTeX formats and templates for various formats. Most of the templates are provided and maintained by the community, and anyone can contribute a new template. See How to contribute below.

Book

R Markdown: The Definitive Guide

Installation

You can install and use rticles from CRAN as follows:

install.packages("rticles")

If you wish to install the development version from GitHub (which often contains new article formats), you can do this:

# install.packages("pak")
pak::pak("rstudio/rticles")

Using rticles

To use rticles from RStudio, you can access the templates through File -> New File -> R Markdown. This will open the dialog box where you can select from one of the available templates:

New R Markdown

New R Markdown

If you are not using RStudio, you’ll also need to install Pandoc following these instructions. Then, use the rmarkdown::draft() function to create articles:

rmarkdown::draft(
    "MyJSSArticle.Rmd", template = "jss", package = "rticles"
)
rmarkdown::draft(
    "MyRJournalArticle", template = "rjournal", package = "rticles"
)

This will create a folder containing a Rmd file using the corresponding output format and all the assets required by this format.

Templates

Currently included templates and their contributors are the following:

Journal Contributors Pull request Output format
ACM: Association for Computings Machinery @ramnathv #8 acm_article()
ACS https://pubs.acs.org @yufree #15 acs_article()
AEA: American Economic Association @sboysel #86 aea_articles()
AGU https://agupubs.onlinelibrary.wiley.com/ @eliocamp #199 agu_article()
AJS: Austrian Journal of Statistics @matthias-da #437 ajs_article()
AMS: American Meteorological Society @yufree #96 ams_article()
ASA: American Statistical Association https://www.amstat.org/ #111 asa_article()
arXiv pre-prints based on George Kour’s template @alexpghayes #236 arxiv_article()
Bioinformatics @ShixiangWang #297 bioinformatics_article()
Biometrics @daltonhance #170 biometrics_article()
Bulletin de l’AMQ (https://www.amq.math.ca/bulletin/) @desautm #145 amq_article()
Copernicus Publications @nuest, @RLumSK #172, #342 copernicus_article()
CTeX ctex()
Elsevier @cboettig, @robjhyndman #27, #467 elsevier_article()
Frontiers @muschellij2 #211 frontiers_article()
Glossa @stefanocoretta #361 glossa_article()
IEEE Transaction @Emaasit, @espinielli, @nathanweeks, @DunLug #97, #169, #227, #263, #264, #265 ieee_article()
IMS: Institute of Mathematical Statistics AoAS: Annals of Applied Statistics @auzaheta #372 ims_article()
INFORMS: Institute for Operations Research and the Management Sciences @robjhyndman #460 informs_article()
ISBA: International Society for Bayesian Analysis @dmi3nko #461 isba_article()
IOP: Institute of Physics (https://iopscience.iop.org) @robjhyndman #462 iop_article()
JASA: Journal of the Acoustical Society of America @stefanocoretta #364 jasa_article()
Journal of Educational Data Mining journal submissions @jooyoungseo #251 jedm_article()
JOSS: Journal of Open Source Software JOSE: Journal of Open Source Education @noamross #229 joss_article()
JSS: Journal of Statistical Software jss_article()
LIPIcs @nuest #288 lipics_article()
MDPI @dleutnant, @mps9506 #147, #515 mdpi_article()
MNRAS: Monthly Notices of the Royal Astronomical Society @oleskiewicz #175 mnras_article()
OUP: Oxford University Press @dmkaplan #284 oup_articles()
PeerJ: Journal of Life and Environmental Sciences @zkamvar #127 peerj_article()
PiHPh: Papers in Historical Phonology @stefanocoretta #362 pihph_article()
PLOS @sjmgarnier #12 plos_article()
PNAS: Proceedings of the National Academy of Sciences (https://www.pnas.org/) @cboettig #72 pnas_article()
RSOS: Royal Society Open Science https://www.royalsocietypublishing.org/journal/rsos @ThierryO #135 rsos_article()
RSS: Royal Statistical Society @carlganz #110 rss_article()
Sage @oguzhanogreden #181 sage_article()
Springer @strakaps #164 springer_article()
Springer Lecture Notes in Computer Science (LCNS) @eliocamp #445 lncs_article()
SIM: Statistics in Medicine https://onlinelibrary.wiley.com/journal/10970258) @ellessenne #231 sim_article()
Taylor & Francis (https://www.tandfonline.com/) @dleutnant #218 tf_article()
The R Journal Use rjtools package now. rjournal_article() is deprecated.
TRB @gregmacfarlane #427 trb_article()
Wellcome Open Research @arnold-c #436 wellcomeor_article()

You can also get the list of available journal names with rticles::journals().

rticles::journals()
#>  [1] "acm"            "acs"            "aea"            "agu"           
#>  [5] "ajs"            "amq"            "ams"            "arxiv"         
#>  [9] "asa"            "bioinformatics" "biometrics"     "copernicus"    
#> [13] "ctex"           "elsevier"       "frontiers"      "glossa"        
#> [17] "ieee"           "ims"            "informs"        "iop"           
#> [21] "isba"           "jasa"           "jedm"           "joss"          
#> [25] "jss"            "lipics"         "lncs"           "mdpi"          
#> [29] "mnras"          "oup_v0"         "oup_v1"         "peerj"         
#> [33] "pihph"          "plos"           "pnas"           "rjournal"      
#> [37] "rsos"           "rss"            "sage"           "sim"           
#> [41] "springer"       "tf"             "trb"            "wellcomeor"

Those are the values to use within rmarkdown::draft().

Under the hood, LaTeX templates are used to ensure that documents conform precisely to submission standards. At the same time, composition and formatting can be done using lightweight markdown syntax, and R code and its output can be seamlessly included using knitr.

Getting help

There are two main places to get help:

  1. The RStudio community is a friendly place to ask any questions about rticles. Be sure to use the rticles tag.

  2. Stack Overflow is a great source of answers to common bookdown questions. Use the tags [r][rticles] if you ask a question.

Code of Conduct

Please note that the rticles project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

How to contribute?

Most of the templates are contributed directly by the users in the community. If you want rticles to offer a new journal format, you can contribute by the following way.

Suggest an idea for new format opening an issue.

You may not feel confident enough or may not have time to contribute a new format. By opening a new issue, you can share the idea for this format, and see if someone in the community can help on it.
This is not the best way to quickly get your format included but at least it is a great way to see if others are interested too.

To see the existing suggested formats, just filter issues with the help wanted :heart: label. You can then add a 👍 or help to add the template 😉.

Contribute a new template format opening a pull request.

To contribute a new format, you need to open a new pull request (PR). When opening the PR, you’ll see the PR template explaining how to proceed and what is important to check. Please follow it.
Even if you are just starting or you are not finished, you share your work by creating a draft PR. It is a great way to let us know that you are still working on it (like these opened ones), and it is also a great way to ask for help from the community.
When you are ready, you can submit the PR for review, and we will iterate until it is merged.

Technical resources helpful to contribute a template

The best way to get started is to look at the previous examples of submitted PR. You’ll find links to them in the table above.

All the rticles format are build similarly by providing a new pandoc tex template to replace the default one. You’ll learn more about pandoc templates in these places:

You can study existing formats to see how all this works.

rticles's People

Contributors

blackedder avatar carlganz avatar cboettig avatar cderv avatar coatless avatar dleutnant avatar dmkaplan2000 avatar dunlug avatar elbamos avatar eliocamp avatar emaasit avatar espinielli avatar gregmacfarlane avatar hadley avatar jjallaire avatar kbroman avatar krivit avatar nuest avatar ramnathv avatar rlumsk avatar robjhyndman avatar sboysel avatar sjmgarnier avatar stefanocoretta avatar swhaat avatar thierryo avatar xiangyunhuang avatar yihui avatar yufree avatar zkamvar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rticles's Issues

Unable to indent second line of references

Using the YAML bibliography specification and pandoc, I'm unable to indent the non-first lines of bibliography entries (aka hanging indent). I've tried to set \bibhang but this does nothing to the resulting PDF document. The only way I can get the non-first lines to indent is to not include the YAML bibliography specification and have biblatex take over the bibliography process in the template.tex file. Unfortunately, this requires me to Compile PDF on the resulting .tex since RMarkdown doesn't appear to compile the bibliography when I Knit.

Miscellaneous Issues

  1. 'DESCRIPTION' file still has skeleton data for Title, Author, Maintainer, etc.
  2. Trying to knit "tufte_ebook" template crashes because "papeR" is no longer in CRAN.
  3. Building from the tufte_ebook requires xelatex and a few texlive (on Linux) packages that aren't installed by default. I haven't tried this on Windows with MikTeX.

Spaces in R Journal Submission Template Cannot Knit

R version 3.1.1 RStudio Version 0.98.981 on Darwin 13.3.0 (OSX 10.9.4 build 13E28) appears to have problems with spaces and underscores in Rmd file names. Creating files without spaces or underscores yields no issues.

  • Example with "Untitled 2.Rmd" and "Untitled_2.Rmd":

    Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  : 
    Running 'texi2dvi' on 'RJwrapper.tex' failed.
    LaTeX errors:
    ! LaTeX Error: File `Untitled\T1\textunderscore2.tex' not found.
    
    Type X to quit or <RETURN> to proceed,
    or enter new name. (Default extension: tex)
    
    ! Emergency stop.
    <read *> 
    
     l.21   \input{Untitled\_2}
                            ^^M
    !  ==> Fatal error occurred, no output PDF file produced!
    Calls: <Anonymous> -> <Anonymous> -> <Anonymous> -> texi2dvi
    Execution halted
    

JSS template: Appendix not possible after references

Whenever I try to place a chapter after the references, the references are not displayed. Though the JSS (as most journals I know) have the appendix in the very back. Is there a way to cure this? So far, I only saw modifying the .tex and rendering it again, but I suppose this generates other troubles, plus it is against RR.

RJournal doesn't like `^` or `%` or `$` in R code chunks

Thanks for putting this package together, it's super cool!

I'm working on submitting an Article to the R Journal, and am using the R Journal template from rticles.

I've got it here on my github: https://github.com/njtierney/A-Simple-Guide-to-S3-Methods

When I render the article, I random sections of it render into text, and then the R comments get treated as first level headers. When I changed the R programming code from ^ to use ** instead, there were fewer problems, but it now seems that when I call something like x$residuals in the .Rmd, LaTeX has trouble parsing it, as well as %in%

This is particularly on pages 4, 5, and 6 of the PDF.

I'll probably just change the .tex file to get it to render well in the end, but just thought you guys would like to know!

Citations not working?

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

Dollar sign ($) and RJournal style

Hi.

When using the dollar sign ($) in a code chunk, knitting as rticles::rjournal_article doesn't parse the code. Using html or pdf_document as output doesn't show the issue.

Accordingly to http://meta.stats.stackexchange.com/questions/1384/markdown-r-code-and-dollar-sign, it seems an old bug of rmarkdown that still keep in rticles.

As described at the link above, putting a $ in the same line, after the comment sign, workaround the issue.

A minimal example of the problem is here: https://github.com/nicolasturaro/R-misc/tree/master/rjournal_issue

Thank you.

The PLoS template is now out of date (I think)

It changed in January 2015, there's some notes on it here, and the .tex file and associated bits are here.

The example .pdf they provide looks very different to what the example produces. Looking at the timeline for commits, I'm guessing that rticles is now out of date. Here's the new look:

newplos

I'd offer a pull request, only I have no idea what that might entail! Apologies.

In ctex template "number_sections: no" doesn't remove section number from header

Steps to reproduce:

  1. Create a new document using the included skeleton file
  2. change "number_sections: yes" to "number_sections: no"
  3. knit
  4. look at the header on pages 2-4 of the output pdf

Expected behaviour:

Section numbers will not be displayed in the header.

Actual behaviour:

"0" is displayed for the section number on the left-hand side of each page's header
Example

Comments

Unfortunately, I'm not familiar enough with 'tex or pandoc to do much more troubleshooting. Big thanks to @yihui et al. for creating a more or less plug and play template (and associated packages) for rendering CJK text!

Templates for CTeX

Just a note to myself: it will be nice if we have some templates for the ctex package, so that we can compile Chinese documents to PDF (preferably using XeTeX). I guess the major challenge is the fonts. Will experiment later.

Download failed.

devtools::install_github('rstudio/rticles@feature/ctex')

Downloading github repo rstudio/rticles@feature/ctex
Error in download(dest, src, auth) : client error: (404) Not Found

JSS template fails in rmarkdown 0.7

The template worked recently, but I may have had an old version of R Markdown. Now the tempalte returns the following error when run as is.

! Undefined control sequence.
l.48 \tightlist

pandoc: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
Execution halted

Accent in rticles packages

Hi, I would like to write some examples in spanish. I have some problems with accents. For example when I write "análisis" my output is like this
image

I think it's related to encoding in latex (or maybe YALM?).

Thank in advance

Author addresses in Elsevier

The Elsevier skeleton should probably be updated to include the proper YAML for setting different addresses:

address:
  - code: University 1
    address: Department, Street, City, State, Zip
  - code: University 2
    address: Department, Street, City, State, Zip

This isn't clear from the RMarkdown provided skeleton unless one digs into the accompanying skeleton.tex for the document class.

Additional tufte ebook error

After installing the rticles package I tried to make an example tufte ebook using the template. After installing the dependencies (note: those were not automatically installed upon loading the rticles package) I got the following error (a different one from the one reported by AmitRohanty)

pandoc-citeproc.exe: Cannot decode byte '\xf3': Data.Text.Internal.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream
pandoc.exe: Error running filter pandoc-citeproc
Error: pandoc document conversion failed with error 83

The complete log is:


processing file: Mytitle.Rmd
|.. | 5%
ordinary text without R code

|.... | 11%
label: setup (with options)
List of 4
$ echo : logi FALSE
$ message: logi FALSE
$ cache : logi FALSE
$ include: logi TRUE

|...... | 16%
ordinary text without R code

|....... | 21%
label: unnamed-chunk-1 (with options)
List of 2
$ fig.margin: logi TRUE
$ fig.cap : chr "Sepal length vs. petal length, colored by species"

|......... | 26%
ordinary text without R code

|........... | 32%
label: unnamed-chunk-2 (with options)
List of 4
$ fig.width : num 10
$ fig.height : num 2
$ fig.fullwidth: logi TRUE
$ fig.cap : chr "Full width figure"

|............. | 37%
ordinary text without R code

|............... | 42%
label: unnamed-chunk-3 (with options)
List of 1
$ fig.cap: chr "Another figure"

|................. | 47%
ordinary text without R code

|.................. | 53%
label: unnamed-chunk-4 (with options)
List of 1
$ results: chr "asis"

|.................... | 58%
ordinary text without R code

|...................... | 63%
label: amargintable (with options)
List of 2
$ results: chr "latex"
$ echo : logi FALSE

|........................ | 68%
inline R code fragments

|.......................... | 74%
label: pandocDemo2 (with options)
List of 1
$ results: chr "asis"

|............................ | 79%
inline R code fragments

|............................. | 84%
label: kable (with options)
List of 1
$ results: chr "asis"

|............................... | 89%
inline R code fragments

|................................. | 95%
label: fullwidthxtable (with options)
List of 2
$ results: chr "asis"
$ echo : logi FALSE

|...................................| 100%
inline R code fragments

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS Mytitle.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output Mytitle.tex --filter pandoc-citeproc --table-of-contents --toc-depth 3 --template "D:\bin\R\R-3.2.2\library\rticles\rmarkdown\templates\tufte_ebook\resources\tufte-ebook.tex" --number-sections --highlight-style pygments --latex-engine xelatex --bibliography knitcitations.bib
Writing 8 Bibtex entries ... OK
Results written to file 'knitcitations.bib'
output file: Mytitle.knit.md

pandoc-citeproc.exe: Cannot decode byte '\xf3': Data.Text.Internal.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream
pandoc.exe: Error running filter pandoc-citeproc
Error: pandoc document conversion failed with error 83
In addition: Warning message:
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS Mytitle.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output Mytitle.tex --filter pandoc-citeproc --table-of-contents --toc-depth 3 --template "D:\bin\R\R-3.2.2\library\rticles\rmarkdown\templates\tufte_ebook\resources\tufte-ebook.tex" --number-sections --highlight-style pygments --latex-engine xelatex --bibliography knitcitations.bib' had status 83

Execution halted

pnas reference encoding

Hi @cboettig and the rstudio team,

When using the PNAS template, the references in the output .tex file are encoded using \hypertarget and not using \bibitem (as required in the submission guidelines).

Could this please be fixed? It seems like the conversion from .Rmd to .md to .tex to .pdf occurs in a single run of pandoc.

At the moment, I'm trying to use an R script to modify the .tex file output during this process, and then rerunning pandoc to generate the pdf.

rjournal_article doesn't work with rmarkdown::render() with defined output folder or file

Hello, I just came across this weird bug with rjournal_article that if you use rmarkdown::render("your_rmd_file.Rmd", output_dir = "something_else/"), the final pdf file will not be copied to the output directory.

I assume this bug happens because the name of the pdf file has been changed to "RJwrapper.pdf" by default so the output_dir option cannot recognize it?

A reproducible sample (it will create some files in your pkg folder.... )
(you will need to create a "test" folder under your working directory)

file_location <- try(
  render(
    system.file("rmarkdown/templates/rjournal_article/skeleton/skeleton.Rmd", package = "rticles"), 
    output_dir = "test/"
  )
)

file_location

If you want to use it with output_file it will throw an error message like

! Undefined control sequence.
l.5 \maketitle

pandoc: Error producing PDF
Error : pandoc document conversion failed with error 43

I'm using Rstudio Priview and the CRAN version of rticles (0.2) and rmarkdown (0.9.6.14) but the problem still exist in the github version of rticles (just tried it).

PS: Everything else in rticles works fine.

如何使用中文?

CTeX能够正常使用中文,需要在其他模板如 Journal of Statistical Software中使用中文,改如何做?


---
author:
  - name: FirstName LastName
    affiliation: University/Company
    address: >
      First line
      Second line
    email: [email protected]
    url: http://rstudio.com
  - name: Second Author
    affiliation: Affiliation
title:
  formatted: "A Capitalized Title: Something about a Package \\pkg{foo}"
  # If you use tex in the formatted title, also supply version without
  plain:     "A Capitalized Title: Something about a Package foo"
  # For running headers, if needed
  short:     "\\pkg{foo}: A Capitalized Title"
abstract: >
  The abstract of the article.
keywords:
  # at least one keyword must be supplied
  formatted: [keywords, not capitalized, "\\proglang{Java}"]
  plain:     [keywords, not capitalized, Java]
preamble: >
  \usepackage{amsmath}
output: rticles::jss_article
documentclass: ctexart

---

# 中文 Introduction

提示:
! Undefined control sequence.
\GenericError  ...                                
                                                    #4  \errhelp \@err@     ...
l.42 \section{中文 Introduction}

pandoc: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
Execution halted

templates for other journals?

Awesome package- I was wondering if anyone was working on templates for computational biology journals (i.e Bioinformatics)?

Thanks!

PNAS template - rendering materials and methods

Thanks for the template - it's very useful! It's not clear from the template or instructions how to use the "materials and methods" section, though. Minimally, it'd be nice to document that \matmethods{ABC} produces that section. But this functionality is hard to use because markdown syntax doesn't render within \matmethods, e.g. citations are not possible.

Download failed.

devtools::install_github('rstudio/rticles@feature/ctex')

Downloading github repo rstudio/rticles@feature/ctex
Error in download(dest, src, auth) : client error: (404) Not Found

Default tufte book fails in current RStudio Preview under Ubuntu 14.10

At the end of knitting (having installed the required packages), I get

/usr/lib/rstudio-server/bin/pandoc/pandoc Test_Tufte_Book.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output Test_Tufte_Book.tex --filter /usr/lib/rstudio-server/bin/pandoc/pandoc-citeproc --table-of-contents --toc-depth 3 --template /usr/local/lib/R/site-library/rticles/rmarkdown/templates/tufte_ebook/resources/tufte-ebook.tex --number-sections --highlight-style pygments --latex-engine xelatex --bibliography knitcitations.bib 
Writing 9 Bibtex entries ... OK
Results written to file 'knitcitations.bib'
output file: Test_Tufte_Book.knit.md

pandoc-citeproc: could not find locale data for C-UTF-8
pandoc: Error running filter /usr/lib/rstudio-server/bin/pandoc/pandoc-citeproc
Error: pandoc document conversion failed with error 83
Execution halted

Ubuntu 14.10, current, RStudio Server Version 0.99.315

JSS template auto knit to slides format with raw codes

I tried to create and knit a default JSS template, but the output is slides format with raw codes. Kindly look into this?

**A Capitalized Title: Something about a Package \pkg{foo},A Capitalized Title: Something about a Package foo,\pkg{foo}: A Capitalized Title**

list(name = "FirstName LastName", affiliation = "University/Company", address = "First line Second line\n", email = "[email protected]", url = "http://rstudio.com"),list(name = "Second Author", affiliation = "Affiliation")

JSS article doesn't show prompt

The prompt for the JSS article is not showing.

I added

knitr::opts_chunk$set(prompt = TRUE)
options(prompt = 'R> ')

to the top of my document. But this does not give the prompt.

However, building via

rmarkdown::render('ms.Rmd', rmarkdown::md_document())
rmarkdown::render('ms.md', rmarkdown::pdf_document())

works.

I think this has something to to how RStudio builds the pdf.
Nevertheless,

options(prompt = 'R> ')

might be also added to jss_article/skeleton/skeleton.Rmd

Something weird with JSS template

Dear rticles users, something weird happens to me when using JSS template. It seems that the template works fine with the logo, authors, etc. but not with others things:

  1. prompt 'R>' inside the code according to JSS style guidelines.
  2. volume number in bibliography style is not in bold formart, again according to the style guidelines.
  3. In the affiliation, "first line" and "second line" are placed side-by-side.

I appreciate any help.
Thanks!

test.zip

My session

> sessionInfo()
R version 3.3.1 RC (2016-06-17 r70798)
Platform: x86_64-suse-linux-gnu (64-bit)
Running under: openSUSE Leap 42.1 (x86_64)

locale:
 [1] LC_CTYPE=es_ES.UTF-8       LC_NUMERIC=C               LC_TIME=es_ES.UTF-8        LC_COLLATE=es_ES.UTF-8     LC_MONETARY=es_ES.UTF-8   
 [6] LC_MESSAGES=es_ES.UTF-8    LC_PAPER=es_ES.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rticles_0.2     knitr_1.13      rmarkdown_0.9.6

loaded via a namespace (and not attached):
[1] htmltools_0.3.5 tools_3.3.1     Rcpp_0.12.4     digest_0.6.9   

Abstract in different file

Instead of having the abstract be inline in something like the R Journal template like this:

abstract: >
An abstract of less than 150 words.

Is there a way to have the abstract be read in from an R Markdown file in a way like this?

abstract: abstract.Rmd

I understand that the LaTeX template files would need to be tweaked a bit if this is possible, but I'm not sure how to go about it.

How to generate tex file when output?

we can set the attribute keep_tex: true in rmarkdown package. But in rticles package,how can I set this attribute to generate a tex file for the output?

Change chunk options, e.g. fig.width

I'm preparing a JSS article, and want some figures to be at the same width as the text body, i.e. 6.125 inch.

I tried the following, but without desired result. I used the jss_article template.

# Default figure size

```{r}
plot(1:10)
```

# Wide figure

```{r fig.width=6.125}
plot(10:1)
```

Also setting global options didn't work:

```{r global_options, include=FALSE}
knitr::opts_chunk$set(fig.width=6.125) #doesn't seem to work
```

Any ideas how to do this?

tufte ebook error

I installed RStudio/rticles and trying to "knit" the default template for "tufte e_book". I am getting the following error. Anyone has seen anything like this and if yes, did you get a work around?


processing file: Hello.Rmd
|.. | 5%
ordinary text without R code

|.... | 11%
label: setup (with options)
List of 4
$ echo : logi FALSE
$ message: logi FALSE
$ cache : logi FALSE
$ include: logi TRUE

|...... | 16%
ordinary text without R code

|....... | 21%
label: unnamed-chunk-1 (with options)
List of 2
$ fig.margin: logi TRUE
$ fig.cap : chr "Sepal length vs. petal length, colored by species"

|......... | 26%
ordinary text without R code

|........... | 32%
label: unnamed-chunk-2 (with options)
List of 4
$ fig.width : num 10
$ fig.height : num 2
$ fig.fullwidth: logi TRUE
$ fig.cap : chr "Full width figure"

|............. | 37%
ordinary text without R code

|............... | 42%
label: unnamed-chunk-3 (with options)
List of 1
$ fig.cap: chr "Another figure"

|................. | 47%
ordinary text without R code

|.................. | 53%
label: unnamed-chunk-4 (with options)
List of 1
$ results: chr "asis"

|.................... | 58%
ordinary text without R code

|...................... | 63%
label: amargintable (with options)
List of 2
$ results: chr "latex"
$ echo : logi FALSE

|........................ | 68%
inline R code fragments

|.......................... | 74%
label: pandocDemo2 (with options)
List of 1
$ results: chr "asis"

|............................ | 79%
inline R code fragments

|............................. | 84%
label: kable (with options)
List of 1
$ results: chr "asis"

|............................... | 89%
inline R code fragments

|................................. | 95%
label: fullwidthxtable (with options)
List of 2
$ results: chr "asis"
$ echo : logi FALSE

|...................................| 100%
inline R code fragments

Writing 8 Bibtex entries ... Quitting from lines 252-296 (Hello.Rmd)
Error in utf8ToInt(x) : invalid UTF-8 string
Calls: ... encoded_text_to_latex -> as.vector -> sapply -> lapply -> FUN -> utf8ToInt
Execution halted

References on jss template show a ? Sign

Hello:

I have problems adding References to the jss template. I have use the elsevier template with no problem. I also tried changin the @reference to \cite{references} or \citep{references} but a ? Sign appears where the references should be. I feel I am not pointing to the .bib file in the right way. Any idea of what I am doing wrong?

RJournal template can't handle some characters in R chunks

Most notably, $ and ^ fail because of how knitr, pandoc, and latex interact with the RJournal requirement that code and output be placed in Sinput and Soutput environments.

See jgm/pandoc#2493 for more discussion.

For many uses, this will be a blocking failure that will preclude authors from being able to use this template easily.

No graphics in JSS-articles

Inserting

plot(sin)

in the JSS Rmd-template and compiling the document results in an error. The corresponding tex file contains markdown code for images.

! Package inputenc Error: Unicode char \u8:γ not set up for use with LaTeX.


---
author:
  - name: ®γσ Lian Hu, ENG
    affiliation: Coursera/Scibrokes®
    address: >
      43300 Seri Kembangan
      Selangor, Malaysia.
    email: [email protected]/[email protected]
    url: https://github.com/scibrokes/owner
title:
  formatted: "A Capitalized Title: Something about a Package \\pkg{Rmodel}"
  # If you use tex in the formatted title, also supply version without
  plain:     "A Capitalized Title: Something about a Package foo"
  # For running headers, if needed
  short:     "\\pkg{Rmodel}: A Capitalized Title"
abstract: >
  The abstract of the article.
keywords:
  # at least one keyword must be supplied
  formatted: [keywords, not capitalized, "\\proglang{Java}"]
  plain:     [keywords, not capitalized, Java]
preamble: >
  \usepackage{amsmath}
output: rticles::jss_article

---

Below error prompted me when I knitted.

output file: Odds_Modelling_and_Testing_Inefficiency_of_Sports-Bookmakers.knit.md

- ! Package inputenc Error: Unicode char \u8:γ not set up for use with LaTeX.

- See the inputenc package documentation for explanation.
- Type  H <return>  for immediate help.
 ...                                              

- l.40 \begin{document}

- Try running pandoc with --latex-engine=xelatex.
- pandoc: Error producing PDF from TeX source
- Error: pandoc document conversion failed with error 43
- Execution halted

When I check the tex file and tried to look at the structure and the process of knit2pdf..

\documentclass[article]{jss}
\usepackage[utf8]{inputenc}

\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

\author{
®γσ Lian Hu, ENG\\Coursera/Scibrokes®
}
\title{A Capitalized Title: Something about a Package \pkg{foo}}
\Keywords{keywords, not capitalized, \proglang{Java}}

\Abstract{
The abstract of the article.
}

\Plainauthor{®γσ Lian Hu, ENG}
\Plaintitle{A Capitalized Title: Something about a Package foo}
\Shorttitle{\pkg{foo}: A Capitalized Title}
\Plainkeywords{keywords, not capitalized, Java}

ov3ut4m 1

How to make my own template?

HI, I am in search of template for Journal of Biomolecular NMR, J.BIOMOL NMR. Can someone tell me where to find more template or how to make my own.

RJournal template ignores preamble

Extending the preamble in the .Rmd file by \newcommand{\doesnotwork}{\textbf{does not work}} and using \doesnotwork in the text yields an error:

---
title: Capitalized Title Here
author:
  - name: Author One
    affiliation: Affiliation
    address:
    - line 1
    - line 2
    email:  author1@work
  - name: Author Two
    affiliation: Affiliation
    address:
    - line 1
    - line 2
    email:  author2@work
abstract: >
  An abstract of less than 150 words.
preamble: >
  \newcommand{\doesnotwork}{\textbf{does not work}}
output: rticles::rjournal_article

---

## Introduction

Introductory section which may include references in parentheses
\citep{R}, or cite a reference such as \citet{R} in the text. \doesnotwork

yields the error

Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  : 
  Running 'texi2dvi' on 'RJwrapper.tex' failed.
LaTeX errors:
! Undefined control sequence.
l.15 \doesnotwork

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
Calls: <Anonymous> -> <Anonymous> -> <Anonymous> -> texi2dvi
Execution halted

PLoS template mfailing with \citep

I tried to knit the PLoS template in RStudio, but it failed with the following error in the R Markdown output console:

output file: Untitled.knit.md
! Undefined control sequence.
l.114 Cite fancy references \citep     
                                       {Garnier2007}.

I think it is because there should be \usepackage{natbib} in the template.tex, but there is none.
When adding this line to template.tex, it compiles and produces the expected result.

Why do the templates not take the optional arguments of `pdf_document()`?

It seems that the current templates all define themselves without any of the arguments that are supported as arguments to the pdf_document(). (e.g. https://github.com/rstudio/rticles/blob/master/R/acm_article.R#L2)

I'm not really clear on the reason for this. For instance, surely it would still be useful to be able to set a fig.width other than the default, or keep_tex=TRUE for an ACM article where the author will be submitting the tex file anyway? Or are these options somehow still available even though they are not function arguments to things like acm_article()?

JSS bibliography style not honoured

When using rticles::jss_article to create an Article for the Jounral of Statistical Software, there are a few problems with how the contents of the bibliography appear.

Firstly, uses of \pkg and \proglang in the bibliography style don't have an effect on the style of the resulting text.

Secondly, JSS reference styling isn't quite right (possibly completely ignored?). For example, in JSS style, the URL to an R package should be prefixed with "URL", but this isn't the case.

Thirdly, in the main text, the citation should be a hyperlink to the reference at the end of the article. These hyperlinks don't occur.

Reproducible example atttached:

biblio-problem.zip

ACM template

First of all thanks for providing us such a good package. I just want to know how can i affiliate an author to a more than one institute. Sorry if my queation is silly because i am new in this field.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.