rfortherestofus / omni

RMarkdown template, ggplot2 theme, and table function for OMNI Institute
https://rfortherestofus.github.io/omni/
Other
21 stars 4 forks source link

Revamping the OMNI pdf template #50

Closed OskaratOmni closed 8 months ago

OskaratOmni commented 9 months ago

Hey @dgkeyes , We were just look at the one of the templates in the OMNI package called OMNI RMarkdown template. This seems like it was built for a particular report. I have not used it before today. One of our team members was trying to use and had a hard time making simple edits - like removing the cover page and adding page numbers. The css files are in the package files so they are kind of hard to edit. I'm not sure how we would with this setup.

So I have a few thoughts on resolution. One is to have two different pdf templates. One that is for reports (the 'OMNI RMarkdown Template' with a few modifications). The second is maybe called 'memo' and would have no cover page at all, just formatted headers. Both of them should have page numbers though.

The question is how to make them editable? Should the css files download to a folder called 'css' each time the template is loaded so they can be customized to fit a particular deliverable? Is there another way?

Thanks!

tvroylandt commented 9 months ago

I agree this template is a bit old. I would have done that differently by now.

One way to make them editable is to use CSS variables in the CSS that are then overwritten in R during the process.

OskaratOmni commented 9 months ago

Oh that sounds interesting and promising but I am not familiar with it at all. Can we please try this fairly soon? I think some on our team would use it right away.

tvroylandt commented 9 months ago

That's more or less the principles of the pagedreport package we wrote with David : https://github.com/rfortherestofus/pagedreport

I'm on my way to do a revamping of this package too, on Quarto instead of Rmd and that's what I use. Should be ready for the beginning of the year (not having the option to do a good sleep at night makes it difficult to work long hours on the day unfortunately)

Changing colors and such things isn't too complicated. It's more difficult when we have to deal with margins and so on.

OskaratOmni commented 9 months ago

For our needs we are fine with just a simple template. I think that the 'memo version' would get more use. I could find an example of what I mean if that would be helpful.

dgkeyes commented 9 months ago

Sounds like this is a good plan! Just for context, I believe there are two templates because someone on your team (I don't remember who) wanted to add another one. Does that sound familiar to you @OskaratOmni?

OskaratOmni commented 9 months ago

Hey David, are there two now? I thought we only had one to pdf, but I could be mistaken. We might want to think about a few context-specific ones tho

OskaratOmni commented 9 months ago

David you were right, there are two already! Sorry, if it seems weird I didn't know that its bc I actually haven't done much in pdf in a long time, lol.

dgkeyes commented 9 months ago

Ok, just let us know which one you want us to keep.

OskaratOmni commented 9 months ago

David, we would like two (or potentially more) pdf templates, one for a report and one for a memo. We don't have a 'memo' style one yet. A memo would not have a cover page at all but just start with the level one header at the top of the first page.

tvroylandt commented 9 months ago

I added a omni_pdf_memo format where you can change main color, main and header fonts. We can think to add more if needed

See https://github.com/rfortherestofus/omni/commit/e37de0304a63690ee06ae51176b5c59acf2453f7#diff-1219cbfa9cc330bea7bb46522599a1870f73b285563943f097583c4d539e5d9fR5 for an example

For the moment this doesn't change like the tables color (they are hardcoded) or the graph color.

tvroylandt commented 9 months ago

As you can see, I also really simplified the CSS file

tvroylandt commented 9 months ago

On my side, this one is ok.

OskaratOmni commented 9 months ago

@tvroylandt , thanks for making a draft of the pdf memo. I made a few changes but I messed up the pull request. I hope you can see the rmd and associated pdf here? https://github.com/OMNI-Institute-QuantBPT/OMNI-R-Resources/tree/datacleaning_obupdates/pdf%20memo%20template

Basically I am making it more of a general template and adding more of the OMNI defaults.

OskaratOmni commented 9 months ago

One thing I couldn't figure out is that in the knitted pdf the gridlines in the table are white instead of black. Can you please make them black?

tvroylandt commented 9 months ago

@OskaratOmni thanks for the feedback. FYI, I created the report in this repo (please see https://github.com/rfortherestofus/omni/blob/main/inst/assets/omni_pdf_memo.css). I'll work on that soon to adapt to your changes and for the tables.

tvroylandt commented 9 months ago

@OskaratOmni I tried to put this in the new format but I'm unsure to have everything since I've deeply changed the original CSS). Please tell me if that's ok for you.

tvroylandt commented 8 months ago

@OskaratOmni just a quick update on this one, is everything ok ?

OskaratOmni commented 8 months ago

Thanks for checking @tvroylandt - My intention is to change the text in the pdf memo version - I thought I did that already but I cannot find it now. I will update that and send and updated version soon. Let's please keep open for now.

OskaratOmni commented 8 months ago

@tvroylandt - I looked at the pdf memo version and I am not sure if the edits you made above were pushed? The header color is still red and those changes linked in the comment above (I just added eyes to it) don't seem to be there. Am I misunderstanding something on my end? Sorry if so.

dgkeyes commented 8 months ago

@OskaratOmni just to make sure, did you reinstall the package?

OskaratOmni commented 8 months ago

@OskaratOmni just to make sure, did you reinstall the package?

Yes.

OskaratOmni commented 8 months ago

This memo still needs to be updated. I think @tvroylandt said he worked on the css as well. The version that is in the project, and shown in the video, is quite out of date - you can see I sent a new version back on December 14th and after that Thomas had made those changes and worked on the css file.

OskaratOmni commented 8 months ago

Here's the rmd in case you didn't see the link above: https://github.com/OMNI-Institute-QuantBPT/OMNI-R-Resources/blob/datacleaning_obupdates/pdf%20memo%20template/memo_example_update.Rmd

tvroylandt commented 8 months ago

skeleton

I think that should be ok now ? @OskaratOmni @dgkeyes

OskaratOmni commented 8 months ago

Yes - this seems to be working perfectly, thanks!