Add template for the MNRAS (Monthly Notices of the Royal Astronomical Society) article. by oleskiewicz · Pull Request #175 · rstudio/rticles (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation10 Commits11 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
This creates a template for a submission to MNRAS journal, based on their LaTeX template file. I've added most of the housekeeping as outlined here, but wasn't sure what more is there to be done.
md_extensions = md_extensions, |
---|
format = "mnras_article", |
template = "template.tex", |
csl = "mnras.csl") |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to use system.file()
to refer to these (as the current code assumes they are in the current working directory)
Thanks @jjallaire, I'm just starting learning R so this is all a bit new to me!
I have changed the template
and csl
references using the find_resource
helper function, just as plos_article
does it, I hope this is better now?
You should also run the tests locally (you can do this with devtools::test()
). When I run your test I get this failure:
unused argument (csl = "/Users/jjallaire/packages/rticles/inst/rmarkdown/templates/mnras_article/resources/mnras.csl") 1: rmarkdown::render(testdoc) at /Users/jjallaire/packages/rticles/tests/testthat/test_formats.R:30 2: create_output_format(output_format$name, output_format$options) 3: do.call(output_format_func, options)
I think you want to call pdf_document_format()
rather than pdf_document()
I am still unable to get this article format to actually work. Here is the error I get:
processing file: Untitled.Rmd output file: Untitled.knit.md
tlmgr search --file --global '/example' ! LaTeX Error: File `example' not found.
Error: Failed to compile Untitled.tex. See Untitled.log for more info. In addition: Warning message: In parse_packages(logfile, quiet = c(TRUE, FALSE, FALSE)) : Failed to find a package that contains example Execution halted
Oh I see -- it seems like the LaTeX environment is trying to pick up the example figure (example.png
), but it assumes the .tex
extension and fails due to some relative path.
I'll change the way figure is rendered in the skeleton (it's my understanding that including figures through knitr
is preferred anyway?), hopefully this will fix it.
Sorry it keeps failing, the test has passed successfully for me.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase against the current master branch here, resolve conflicts, and force push. Then your format will be automatically check on Travis. Thanks!
Piotr Oleskiewicz added 9 commits
I couldn't find official MNRAS CSL file so just this one for now.
inherit_pdf_document was changed to pdf_document_format
LaTeX in the testing environment appears to be looking for .tex figure before finding the .png one.
The build fails for the same reason as previously:
Package pdftex.def Error: File `example.png' not found: using draft setting.
I have checked other templates, and for instance amq_article
passes the Travis build while including figures from external files in skeleton. Similarly, there are no issues with the template locally. How do I include the example.png
in the test render?
% To include a figure from a file named example.* |
---|
% Allowable file formats are eps or ps if compiling using latex |
% or pdf, png, jpg if compiling using pdflatex |
\includegraphics[width=\columnwidth]{example.png} |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You included example.png
here but the file is not included in the PR. You should either include a real file, or comment out this line.
Piotr Oleskiewicz added 2 commits
The tests have passed! Thank you for all your help -- let me know if there is anything else that needs fixing.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Thanks a lot!
github-actions bot locked as resolved and limited conversation to collaborators