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

add an exemple about how to add a logo in header or footer #73

Closed
cderv opened this issue Oct 8, 2018 · 5 comments
Closed

add an exemple about how to add a logo in header or footer #73

cderv opened this issue Oct 8, 2018 · 5 comments

Comments

@cderv
Copy link
Collaborator

cderv commented Oct 8, 2018

Based on this SO question, this could be a good complement to this chapter
https://dr-harper.github.io/rmarkdown-cookbook/add-custom-headers-and-fsooters.html

@cderv
Copy link
Collaborator Author

cderv commented Oct 9, 2018

Related :
https://stackoverflow.com/questions/43009788/insert-a-logo-in-upper-right-corner-of-r-markdown-html-document

uses html in code and css styling.

```{r, echo=FALSE}
htmltools::img(src = knitr::image_uri(file.path(R.home("doc"), "html", "logo.jpg")), 
               alt = 'logo', 
               style = 'position:absolute; top:0; right:0; padding:10px;')
```

@cderv
Copy link
Collaborator Author

cderv commented Oct 20, 2018

Related:
https://stackoverflow.com/questions/29389149/add-image-in-title-page-of-rmarkdown-pdf

uses the titling latex package

header-includes:
- \usepackage{titling}
- \pretitle{\begin{center}\LARGE\includegraphics[width=12cm]{my_graphic.png}\\[\bigskipamount]}
- \posttitle{\end{center}}

@cderv
Copy link
Collaborator Author

cderv commented Oct 27, 2018

@dr-harper
Copy link
Contributor

Related:
https://stackoverflow.com/questions/29389149/add-image-in-title-page-of-rmarkdown-pdf

uses the titling latex package

header-includes:
- \usepackage{titling}
- \pretitle{\begin{center}\LARGE\includegraphics[width=12cm]{my_graphic.png}\\[\bigskipamount]}
- \posttitle{\end{center}}

This example is slightly different to the other examples, in that it is only for the cover page. But I have added it in e8693bd.

I am starting to see limitations in the way I am structuring the chapters. There are going to be some shorter sections like this where there is not a lot to really say. I will stick with the current format for now, but I was thinking that it might be an idea to start each chapter with a section of "10 quick tips" or something for people to quickly jump into, and then having longer sections for some of the ore complicated ideas.

@yihui yihui closed this as completed in 2650283 Apr 29, 2020
@nmolanog
Copy link

nmolanog commented Jun 8, 2020

in the html answer, logo overlaps with header, in deed the logo has its own div an is not nested in header div.

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