-
Notifications
You must be signed in to change notification settings - Fork 522
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
Add template for the MNRAS (Monthly Notices of the Royal Astronomical Society) article. #175
Conversation
R/mnras_article.R
Outdated
md_extensions = md_extensions, | ||
format = "mnras_article", | ||
template = "template.tex", | ||
csl = "mnras.csl") |
There was a problem hiding this comment.
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 |
You should also run the tests locally (you can do this with 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 |
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 ( I'll change the way figure is rendered in the skeleton (it's my understanding that including figures through Sorry it keeps failing, the test has passed successfully for me. |
There was a problem hiding this comment.
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!
8023cbf
to
928d6cd
Compare
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.
Appendices need to be positioned below references, hence the slightly hacky div positioning. See: https://stackoverflow.com/q/16427637
The build fails for the same reason as previously:
I have checked other templates, and for instance |
% 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} |
There was a problem hiding this comment.
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.
The tests have passed! Thank you for all your help -- let me know if there is anything else that needs fixing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Thanks a lot!
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.