Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting questions in `jss_article()` #230

Closed
phargarten2 opened this issue Jun 6, 2019 · 6 comments

Comments

Projects
None yet
3 participants
@phargarten2
Copy link

commented Jun 6, 2019


I promise that

  • I have fully read the issue guide at https://yihui.name/issue/.
  • 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.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

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

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2019

@phargarten2 Please replace your Rmd file with mine

fixed.zip

@phargarten2

This comment has been minimized.

Copy link
Author

commented Jun 7, 2019

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

@phargarten2 phargarten2 closed this Jun 7, 2019

@yihui

This comment has been minimized.

Copy link
Member

commented Jun 7, 2019

@XiangyunHuang Thanks a lot!

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

@yihui yihui added this to the v0.8 milestone Jun 7, 2019

@yihui yihui added the question label Jun 7, 2019

@phargarten2

This comment has been minimized.

Copy link
Author

commented Jun 7, 2019

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

This comment has been minimized.

Copy link
Member

commented Jun 7, 2019

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

This comment has been minimized.

Copy link
Author

commented Jun 8, 2019

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.