rstudio / rticles

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

Differences from `rjournal_article()` to R Journal Instructions. #287

Closed phargarten2 closed 4 years ago

phargarten2 commented 4 years ago

Greetings! Thank you for allowing me to produce an article to fit the R Journal without leaving the R Markdown environment. Indeed, I used rticles::rjournal_article() on my markdown document and sent it off to the journal, as I thought that the function will take care of the formatting details. Again, thank you for this! Unfortunately, my article got rejected because it didn't conform to the submission standards provided in https://journal.r-project.org/submissions.html.

So, I investigated further. I think that the rjournal_article() function already accomplishes these tasks for me in the instructions to the authors of the R Journal (p. 2).

However, rjournal_article() is different from the submission requirements in that the following required items are not done: [ ] The RJreferences.bib needs to be the same name as the R file. [ ] The Rlogo5.png is used, not Rlogo.png [ ] The RJournal.sty may be out of date. I am unsure -- but that was one of the requirements. [ ] There is no R Script that is produced, but a R script is required in the journal. To produce a R Script from Rmarkdown, I have been using r knitr::purl( Rmd, documentation = 1) where Rmd is the location of Rmarkdown file. The documentation=1 ensures that chunk headers are added to the code and the R file looks readable.
[ ] by two authors should be "Author 1 and Author 2", not "Author 1, Author 2". [ ] The preamble used from the journal is different than the one used inrjournal_article().

Upon investigating, I noticed that the preamble.tex and *.tex created using rticles

\documentclass[10pt]{article}
\usepackage[usenames]{color} %used for font color
\usepackage{amssymb} %maths
\usepackage{amsmath} %maths
\usepackage[utf8]{inputenc} %useful to type directly diacritic characters

does not match up with the default R Journal template (RJwrapper.tex):

\documentclass[a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{RJournal}
\usepackage{amsmath} 
\usepackage{amssymb}
\usepackage{array}
\usepackage{booktabs}

The reproducible example came from creating a template in RStudio using rticles and executing the resulting markdown file, located here:. I then compared these files to a download of the template files from the R Journal website: https://journal.r-project.org/submissions.html.

I am using these packages after executing xfun::session_info('rticles').

R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6, RStudio 1.2.1335

Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8

Package version:
  base64enc_0.1.3 digest_0.6.25   evaluate_0.14   glue_1.4.0      graphics_3.5.2  grDevices_3.5.2 highr_0.8      
  htmltools_0.4.0 jsonlite_1.6.1  knitr_1.28      magrittr_1.5    markdown_1.1    methods_3.5.2   mime_0.9       
  Rcpp_1.0.4      rlang_0.4.5     rmarkdown_2.1   rticles_0.10    stats_3.5.2     stringi_1.4.6   stringr_1.4.0  
  tinytex_0.16    tools_3.5.2     utils_3.5.2     xfun_0.12       yaml_2.2.1   

By filing an issue to this repo, I promise that

I understand that my issue may be closed if I don't fulfill my promises.

RLumSK commented 4 years ago

@phargarten2 I had a look into the issue:

For the rest, I will create a pull request addressing the points you raised.

phargarten2 commented 4 years ago

@ramnathv, thank you for looking into this. I took another look at the *.tex file by the template. It is indeed different from the one uploaded to the journal.

RLumSK commented 4 years ago

@phargarten2 Sorry, I guess I still don't get it. The author's guide says

You should have only one ‘.bib’ file, and only two‘. tex’ files, one of which is ‘RJwrapper.tex’.

There is no preamble.tex to upload, and if I run the example shipped with the package I get two *.tex files:

  1. RJwrapper.tex
  2. Untitled.tex

The latter can have any other name. If I compare the first lines of RJwrapper.tex (shown only everything before \begin{document}

From: https://journal.r-project.org/

\documentclass[a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{RJournal}
\usepackage{amsmath,amssymb,array}
\usepackage{booktabs}

%% load any required packages FOLLOWING this line

From: 'rticles'

\documentclass[a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{RJournal}
\usepackage{amsmath,amssymb,array}
\usepackage{booktabs}

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

% Any extra LaTeX you need in the preamble

I admit there is a small difference, however, it is not something you have shown above, and it should not be a problem.

RLumSK commented 4 years ago

@phargarten2

[ ] by two authors is "Author 1 and Author 2", not "Author 1, Author 2".

I see the point, but I guess this is something that needs to be changed manually. The corresponding template.tex for rjournal_article() reads:

\author{by $for(author)$$author.name$$sep$, $endfor$}

I cannot see how this can be changed via pandoc conditionals to

\author{by Author One, Author Two and Author Three}

My understanding is that this is something that should have been integrated into the *.sty file in the first place. But maybe someone else has a better idea?

phargarten2 commented 4 years ago

For some reason, when I updated rticles yesterday before I wrote the post, the version was not updated to rticles_0.14.1. Now, I updated rticles again to the current version, v. 0.14.1. Now, I do see that preambles are the same. So the difference must have been fixed in subsequent versions of rticles or tinytex.

The following packages are the latest ones downloaded on my computer:

> xfun::session_info('rticles')
R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6, RStudio 1.2.1335

Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8

Package version:
  base64enc_0.1.3 digest_0.6.25   evaluate_0.14   glue_1.4.0      graphics_3.5.2 
  grDevices_3.5.2 highr_0.8       htmltools_0.4.0 jsonlite_1.6.1  knitr_1.28     
  magrittr_1.5    markdown_1.1    methods_3.5.2   mime_0.9        Rcpp_1.0.4.6   
  rlang_0.4.5     rmarkdown_2.1   rticles_0.14.1  stats_3.5.2     stringi_1.4.6  
  stringr_1.4.0   tinytex_0.21    tools_3.5.2     utils_3.5.2     xfun_0.13      
  yaml_2.2.1     

@phargarten2 Sorry, I guess I still don't get it. The author's guide says ...

RLumSK commented 4 years ago

Ok, then, at least this part is fixed.

phargarten2 commented 4 years ago

With much thanks to @RLumSK, I want to give an update on where things stand in this issue. The rjournal_article() is different from the journal submission requirements in that the following required items are not done: [X] The RJreferences.bib needs to be the same name as the R file.

Added by @RLumSK in a commit to RLumSK/rticles that referenced this issue.

[X] The Rlogo5.png is used, not Rlogo.png

this should not be an issue because it is nothing that gets uploaded to the journal (https://journal.r-project.org/share/author-guide.pdf)

[X] The RJournal.sty may be out of date. I am unsure -- but that was one of the requirements.

RJournal.sty is the latest available version (2013/08/27 v0.13)

[X] There is no R Script that is produced, but an R script is required in the journal. To produce an R Script from Rmarkdown, I have been using r knitr::purl( Rmd, documentation = 1) where Rmd is the location of the Rmarkdown file. The documentation=1 ensures that chunk headers are added to the code and the R file looks readable.

Added by @RLumSK in a commit to RLumSK/rticles that referenced this issue.

[ ] by two authors should be "Author 1 and Author 2", not "Author 1, Author 2".

I see the point, but I guess this is something that needs to be changed manually. The corresponding template.tex for rjournal_article() reads:

\author{by $for(author)$$author.name$$sep$, $endfor$}

I cannot see how this can be changed via pandoc conditionals to

\author{by Author One, Author Two and Author Three}

My understanding is that this is something that should have been integrated into the *.sty file in the first place. But maybe someone else has a better idea?

[X] The preamble used from the journal is different than the one used in rjournal_article().

Now, I do see that preambles are the same. So the difference must have been fixed in subsequent versions of rticles or tinytex.

A new reason [ ] Lastly, The R Journal may have declined to review my article because they were unable to compile the LaTex document, RJwrapper.tex, to generate RJwrapper.pdf. I ran the example that came with the package, which created the modified RJwrapper.tex. Attempting to recompile the pdf document using the LaTeX file, RJwrapper.tex, I was unable to do so.

Screen Shot 2020-04-20 at 2 50 34 PM

Two main issues stand out for me was that the RJwrapper.tex

RLumSK commented 4 years ago

@phargarten2 I tried to reproduce what you described, I had no problem to build the tex-files without RStudio (but after I first set it with RStudio). You have to typeset the RJwrapper.tex, which includes the Untilted.tex file (if this is really the name of the file). In the example above you miss certain headers (e.g., \documentclass etc.). And I am not sure whether 'LaTeXiT' finds the files correctly.

RLumSK commented 4 years ago

@phargarten2 Regarding:

[ ] The RJreferences.bib needs to be the same name as the R file.

This would be fixed if my pull request gets accepted.

phargarten2 commented 4 years ago

Thank you. Regarding:

@phargarten2 I tried to reproduce what you described, I had no problem to build the tex-files without RStudio (but after I first set it with RStudio). You have to typeset the RJwrapper.tex, which includes the Untilted.tex file (if this is really the name of the file). In the example above you miss certain headers (e.g., \documentclass etc.). And I am not sure whether 'LaTeXiT' finds the files correctly.

What TeX editor did you use, @RLumSK? Based on your response, LaTeXiT may not be finding these files. LaTeXiT includes a preamble that includes the document class. I have edited the example to include this.

RLumSK commented 4 years ago

@phargarten2 I am using TeXShop. Usually, I use LaTeXit only for short tests, so I cannot tell why it does not work, but to me so far it looks good (I might be wrong).

phargarten2 commented 4 years ago

I really have no idea why LaTeXiT did not work for me. But I used TeXShop, and I was able to re-compile the pdf document from the tex file. TeXShop processed the citations and even section titles (that I added to the Rmarkdown file). That is, after I ran the LaTex document in the following sequence (in TeXShop):

Typeset LaTeX
Typeset BibTeX
Typeset LaTeX
Typeset LaTeX

it compiled.

Regarding

[ ] by two authors should be "Author 1 and Author 2", not "Author 1, Author 2".

a fix may eventually come, but a manual edit in the LaTeX document was able to produce the change in the resulting pdf document.

yihui commented 4 years ago

Sounds like some issues have been resolved and some have not. If someone could give us a summary of this thread so that it's clearer to us what we need to fix/improve, I'll really appreciate it.

phargarten2 commented 4 years ago

@yihui, an updated checklist is given below. The remaining issues have been resolved in the pull request referenced in #287. With much thanks to @RLumSK, I want to give an update on where things stand in this issue. The rjournal_article() is different from the journal submission requirements in that the following required items are not done: [ ] The RJreferences.bib needs to be the same name as the R file.

Added by @RLumSK in a commit to RLumSK/rticles that referenced this issue. This would be fixed if my pull request gets accepted.

[X] The Rlogo5.png is used, not Rlogo.png

this should not be an issue because it is nothing that gets uploaded to the journal (https://journal.r-project.org/share/author-guide.pdf)

[X] The RJournal.sty may be out of date. I am unsure -- but that was one of the requirements.

RJournal.sty is the latest available version (2013/08/27 v0.13)

[ ] There is no R Script that is produced, but an R script is required in the journal. To produce an R Script from Rmarkdown, I have been using r knitr::purl( Rmd, documentation = 1) where Rmd is the location of the Rmarkdown file. The documentation=1 ensures that chunk headers are added to the code and the R file looks readable.

Added by @RLumSK in a commit to RLumSK/rticles that referenced this issue.

[ ] by two authors should be "Author 1 and Author 2", not "Author 1, Author 2".

I see the point, but I guess this is something that needs to be changed manually. The corresponding template.tex for rjournal_article() reads:

\author{by $for(author)$$author.name$$sep$, $endfor$}

I cannot see how this can be changed via pandoc conditionals to

\author{by Author One, Author Two and Author Three}

My understanding is that this is something that should have been integrated into the *.sty file in the first place. But maybe someone else has a better idea? a fix may eventually come, but a manual edit in the LaTeX document was able to produce the change in the resulting pdf document.

[X] The preamble used from the journal is different than the one used in rjournal_article().

Now, I do see that preambles are the same. So the difference must have been fixed in subsequent versions of rticles or tinytex.

[X] Lastly, The R Journal may have declined to review my article because they were unable to compile the LaTex document, RJwrapper.tex, to generate RJwrapper.pdf. I ran the example that came with the package, which created the modified RJwrapper.tex. Attempting to recompile the pdf document using the LaTeX file, RJwrapper.tex, I was unable to do so.

cderv commented 4 years ago

Some thoughts on this as I was working on #286

The RJreferences.bib needs to be the same name as the R file.

Isn't it something that the writer should take care about to fullfill the requirement ? RJreferences.bib is shipped to give examples, but the user needs to modify it anyway, so one could rename accordingly. I find it a bit too much to modify this bib file once it has been copied into the user's directory. At least we could document in the skeleton Rmd that this needs to be modified.

Best scenario would have been to change the name of this file when copied from the skeleton directory, when the template folder is created. Currently, rmarkdown::draft does not allow that.

Anyway, I am not sure about renaming the file for the user. What about better documentation and maybe a warning if we detect that the naming convention is not respected ?

There is no R Script that is produced, but an R script is required in the journal.

Using knitr::purl is a good idea to easily produc an R file from the Rmd document.

by two authors should be "Author 1 and Author 2", not "Author 1, Author 2".

I'll look into it.

RLumSK commented 4 years ago

Sorry for the late reply and thanks to @cderv for the thoughtful comments (#286). For the moment I did not touch the

by two authors should be "Author 1 and Author 2", not "Author 1, Author 2".

issue. To get this done, pandoc macros do not work (my understanding) but the template needs to be corrected before the PDF gets built depending on the number of authors. At least this was my conclusion when I wrote this would be something for the STY-file (or in rticles for the preprocessing).

cderv commented 4 years ago

I don't see any solution with pandoc right now. Maybe using the new allbutlast template pipes could be helpful, but not until RStudio upgrade to new pandoc.

I think the best shot we have currently it to post process the tex file in the post_processor step of the rendering. We could parse the \author line content, split by , and trim left /right white space and use knitr::combine_words to rewrite the content with a and for last sep.

Could you add that in the PR ?

I asked for this in pandoc-discuss mailing list and also there is an old SO question on that with no answer...

RLumSK commented 4 years ago

@cderv Sure, I will add this to the PR as suggested.

RLumSK commented 4 years ago

@cderv and @phargarten2 Now the author separator issue is solved following the suggestion by @cderv

cderv commented 4 years ago

@phargarten2 I think everything as been covered in #286. Thanks to @RLumSK for all the work !

I close this issue, but please open a new one if there are some differences we missed.

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.