rstudio / rticles

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

Formatting questions in `jss_article()` #230

Closed phargarten2 closed 5 years ago

phargarten2 commented 5 years ago

I promise that

I am preparing my manuscript based on the JSS Template in R Studio. Thank you for allowing me to do this without leaving the R Markdown environment. Following the instructions for journal submission, I got my article ready by using precise LaTex commands as mentioned in the JSS template. I am using jss_article() from the rticles package. However, I ran into the following formatting questions.

[ ] I would like jss_article() to execute inline code commands like r print(x). Left unaltered, it fails to compile as in Rmarkdown error #385 (along with others). Following the solution, I put dollar signs around it. However, the inline code was not executed but printed to the screen. In the JSS format, are inline commands not executed in rticles::jss_article()? [ ] Frequently, I would like to use inline code to extract an element from a list, like r print(x$B). Since "$" is a LaTex symbol, I need to use the escape character "\". Executing $r print(x\$B)$ leads to enter image description here which makes sense, as \$ is not a valid R command. Should I avoid using the dollar notation, and instead used the name notation x[["B"]]?

[ ] Long names run off the page like # Example 4: Interval-Censored data with univariate Bayesian multivariate imputation . The JSS Template seems to ignore the tidy and tidy.opts options of knitr.

[ ] The knitr::kable() capability does not seem to be supported in jss_article(). Can you recommended a function to construct publication-worthy tables (similar to the output from kable())?

Please see cross-reference at https://stackoverflow.com/questions/56434067/formatting-questions-in-jss-article-of-rticles-package.

jss_article_formatting_questions.zip

Thank you for your help.

XiangyunHuang commented 5 years ago

@phargarten2 Please replace your Rmd file with mine

fixed.zip

phargarten2 commented 5 years ago

Ah, ha. Thank you. I noticed that the questions were solved using the booktabs LaTex package and the booktabs::pdf_book output option.

yihui commented 5 years ago

@XiangyunHuang Thanks a lot!

@phargarten2 Feel free to answer your own question on SO.

phargarten2 commented 5 years ago

This question came from the need to format a JSS-style article appropriately for submission. I recommend that the template is adjusted to reflect these formatting concerns. At the bottom of the header, please consider adding:

preamble: >
  \usepackage{amsmath}
  \usepackage{booktabs}
output: 
  bookdown::pdf_book: 
    base_format: rticles::jss_article
    citation_package: natbib
bibliography: sample.bib

I realized that using the primary header # , long titles still run off the page. It is only when using the secondary headers ## that everything remains on the line.

yihui commented 5 years ago

I guess there isn't much we could do about the long headers. The behavior is defined by the journal document class (jss.cls), and we don't have control over it. That said, I'm not sure if our jss.cls needs to be updated; you may try to get a copy from the JSS website and see if it works any better. If it doesn't, I'd recommend that you avoid using too long first-level headers.

phargarten2 commented 5 years ago

@yihui : Thank you. I didn't think that you could do anything about it; I just wanted to mention it for the record. I can't do second-level headers because JSS articles have section numbers. An easy and simple solution is just to have short headers, as you have mentioned. Thank you for allowing me to submit a LaTex-style manuscript without leaving the Rmarkdown environment!

github-actions[bot] commented 4 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.