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

Provide pinp.cls if not present #23

Closed
eddelbuettel opened this issue Sep 17, 2017 · 2 comments
Closed

Provide pinp.cls if not present #23

eddelbuettel opened this issue Sep 17, 2017 · 2 comments
Assignees

Comments

@eddelbuettel
Copy link
Owner

I am a little non-plus'ed that adding pinp as the vignette driver leads to two extra files.

I already figured out how to get rid of one---we can just include the content of the Bibtex-rendered .blg file directly in the source Rmd, which frees us from adding a foo.bib file. Down one. (Of course, you want it while you still edit the document. Once done, and included as a more static vignette you do not and the extra file is line noise.)

And I realized that we have a code hook to just copy in pinp.cls from the pinp skeleton directory if it is not present in the current working directory---and tada we also get rid of pinp.cls.

Good idea? Methinks it is.

@eddelbuettel eddelbuettel self-assigned this Sep 17, 2017
@eddelbuettel eddelbuettel changed the title Provide pinp.cls Provide pinp.cls if not present Sep 17, 2017
@coatless
Copy link
Collaborator

Yeah, I was actually toying around with this in: illinois-r/uiucthemes#4

Basically, the pinp function can call system.file() and create the appropriate linking path. Though, I think some of my earlier tests ran afoul with Windows and spaces in the Program Files path. I'll need to set up a parallel session to test now as the windows box is fried...

@eddelbuettel
Copy link
Owner Author

It is trivial, and I will commit it:

    if (!file.exists("pinp.cls"))
        file.copy(system.file("rmarkdown", "templates", "pdf", "skeleton", "pinp.cls",
                              package="pinp"),
                  ".")

Has the advantage of copyinig a current pinp.cls in too (if you do a quick rm pre-rendering) when you are making changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants