Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add template for the MNRAS (Monthly Notices of the Royal Astronomical Society) article.#175

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
yihui merged 11 commits intorstudio:masterfromoleskiewicz:master
Jul 5, 2018

Conversation

@oleskiewicz
Copy link
Contributor

@oleskiewiczoleskiewicz commentedJun 21, 2018
edited
Loading

This creates a template for a submission to MNRAS journal, based on their LaTeX template file. I've added most of the housekeeping as outlinedhere, but wasn't sure what more is there to be done.

md_extensions = md_extensions,
format = "mnras_article",
template = "template.tex",
csl = "mnras.csl")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You need to usesystem.file() to refer to these (as the current code assumes they are in the current working directory)

@oleskiewicz
Copy link
ContributorAuthor

Thanks@jjallaire, I'm just starting learning R so this is all a bit new to me!

I have changed thetemplate andcsl references using thefind_resource helper function, just asplos_articledoes it, I hope this is better now?

@jjallaire
Copy link
Member

You should also run the tests locally (you can do this withdevtools::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:302: create_output_format(output_format$name,output_format$options)3: do.call(output_format_func,options)

I think you want to callpdf_document_format() rather thanpdf_document()

@jjallaire
Copy link
Member

I am still unable to get this article format to actually work. Here is the error I get:

processingfile:Untitled.Rmdoutputfile:Untitled.knit.mdtlmgrsearch--file--global'/example'!LaTeXError: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 exampleExecution halted

@oleskiewicz
Copy link
ContributorAuthor

oleskiewicz commentedJun 22, 2018
edited
Loading

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 throughknitr is preferred anyway?), hopefully this will fix it.

Sorry it keeps failing, the test has passed successfully for me.

Copy link
Contributor

@yihuiyihui left a 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!

@yihuiyihuiforce-pushed themaster branch 3 times, most recently from8023cbf to928d6cdCompareJuly 3, 2018 16:11
Piotr Oleskiewicz added9 commitsJuly 4, 2018 14:32
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 figurebefore finding the .png one.
Appendices need to be positioned below references, hence the slightlyhacky div positioning.  See:https://stackoverflow.com/q/16427637
@oleskiewicz
Copy link
ContributorAuthor

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 instanceamq_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 theexample.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}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You includedexample.png here but the file is not included in the PR. You should either include a real file, or comment out this line.

@oleskiewicz
Copy link
ContributorAuthor

The tests have passed! Thank you for all your help -- let me know if there is anything else that needs fixing.

Copy link
Contributor

@yihuiyihui left a 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!

@yihuiyihui merged commit629b074 intorstudio:masterJul 5, 2018
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsNov 2, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@jjallairejjallairejjallaire left review comments

@yihuiyihuiyihui approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@oleskiewicz@jjallaire@yihui

[8]ページ先頭

©2009-2025 Movatter.jp