eddelbuettel / pinp

Pinp Is Not PNAS -- Two-Column PDF Template
147 stars 25 forks source link

setting the date manually #63

Closed ikashnitsky closed 5 years ago

ikashnitsky commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

eddelbuettel commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

coatless commented 5 years ago

@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 commented 5 years ago

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

coatless commented 5 years ago

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 commented 5 years ago

Uggh. Evil underscores. Is date_subtitle better?

ikashnitsky commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

Fixed in #64.

ikashnitsky commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Yep, that's a good feature to have.