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

setting the date manually #63

Closed
ikashnitsky opened this issue Jan 8, 2019 · 18 comments
Closed

setting the date manually #63

ikashnitsky opened this issue Jan 8, 2019 · 18 comments

Comments

@ikashnitsky
Copy link
Contributor

It would be very useful to have an option to set the date of the document (running in the footer throughout the document) rather than hard-coded default of \today. It seems that {pinp} ingnores date: "..." in YAML.

Also, it seems very nice to use custom text for the line "This version was compiled on ...". One use case that I see super attractive is to give full bibliographic info for the published post-prints.
Any ideas?

@eddelbuettel
Copy link
Owner

Hm. Interesting. I guess right now we only have Author, Title, Affiliation. I am sure something can be worked out -- similarly we could offer an override text for 'This version ...'. Do you want to try to work out a PR?

@ikashnitsky
Copy link
Contributor Author

ikashnitsky commented Jan 8, 2019

I will try. Can you give me a hint where to dig?
Ok, got it: ...\pinp\inst\rmarkdown\templates\pdf\resources\template.tex

@eddelbuettel
Copy link
Owner

Ah. Sorry. Was/am tied up. That is one of two steps, the other is how to pick up a value from YAML and pass it down to the template. You may be able to infer how it's done (and I have three related markdown packages so you could search in all three).

@ikashnitsky
Copy link
Contributor Author

Yes, the implementation (maybe very crude one) of a custom "This version..." line was easy. Basically, I followed the suggestion from @coatless, provided in a comment here #60.

in ...\pinp\inst\rmarkdown\templates\pdf\resources\template.tex I changed the line 64 for

$if(infoline)$
\dates{$infoline$}
$else$
\dates{This version was compiled on \today} 
$endif$

Any preferences for the name of the YAML option (infoline) if I PR?

@ikashnitsky
Copy link
Contributor Author

I cannot figure out where to specify the compilation date that goes in the running footer. I guess, it sits somewhere in \pinpfootercontents

@coatless
Copy link
Collaborator

coatless commented Jan 8, 2019

@ikashnitsky feel free to submit a PR for infoline change. Please include the new YAML key under options in the pinp vignette. c.f. https://github.com/eddelbuettel/pinp/blob/master/vignettes/pinp.Rmd#L157

@eddelbuettel
Copy link
Owner

Yes, infoline is a bad name. "vintage"? "compilationdate"? "productiondate"? "datestamp"? "datefooter"?

@coatless
Copy link
Collaborator

coatless commented Jan 8, 2019

How about subtitle_date?

I make this suggestion since it isn't influencing the date in the footer. Plus, we already have footer_contents. (hence the _)

@eddelbuettel
Copy link
Owner

Uggh. Evil underscores. Is date_subtitle better?

@ikashnitsky
Copy link
Contributor Author

ikashnitsky commented Jan 8, 2019

Uggh. Evil underscores. Is date_subtitle better?

I'll use date_subtitle then, will PR soon.

I haven't found the solution for the footer date yet

@eddelbuettel
Copy link
Owner

I haven't found the solution for the footer date yet

I have vague memories of hardcoding this / thinking it works like watermark: "built on x-y-z". I am sure we can generalize if need be. One brick at a time.

@eddelbuettel
Copy link
Owner

Fixed in #64.

@ikashnitsky
Copy link
Contributor Author

Hi! It's me again =)
How about allowing a custom date in the footer?
My use case is compiling the PhD thesis book, and it would be nice to set the footer date to the planned date of the defense.
What do you think @eddelbuettel @coatless?

@eddelbuettel
Copy link
Owner

Could do though I am a little wary that pinp already converges towards "too many options". Isn't the field on the lower left (of dual pages) already free form as a generalization of the DOI/URI/... ?

@ikashnitsky
Copy link
Contributor Author

That's a very valid concern. But it seems there is no way of removing the footer date, in order to provide a custom date in the DOI/URL field

@eddelbuettel
Copy link
Owner

Now, your dissertation is a one-off. How about you locally fork pinp and do what you need to do?

Otherwise, if you have the urge to spend time on this, maybe a new option to be used if set and otherwise the current date format comes back in?

@ikashnitsky
Copy link
Contributor Author

Yes, the behaviour that you outlined sounds perfect. I'll try to implement it.

A more general use case: for pre/post-prints set the date of the actual publication

@eddelbuettel
Copy link
Owner

Yep, that's a good feature to have.

ikashnitsky added a commit to ikashnitsky/pinp that referenced this issue Sep 9, 2020
Started from scratch
re eddelbuettel#63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants