pagedown icon indicating copy to clipboard operation
pagedown copied to clipboard

How can I eliminate the sidebar for page 2 onwards in the resume template? (no information after page 1)

Open maibennett opened this issue 4 years ago • 6 comments

Hi, sorry if this is not the place to post this, but I want to remove the sidebar from the resume after the first page (the 2nd and 3rd page have no information on the sidebar). Is this possible?

maibennett avatar Oct 24 '19 17:10 maibennett

Hi,

There is a hacky way to eliminate the grey background of the sidebar. You can use this CSS rule:

.pagedjs_page:not(:first-of-type) {
  background: white;
}

You can use the CSS chunk engine to insert this rule in your Rmd file:

---
title: "Lijia Yu's resume"
author: Lijia Yu
date: "`r Sys.Date()`"
output:
  pagedown::html_resume:
    self_contained: false
---

```{css, echo=FALSE}
.pagedjs_page:not(:first-of-type) {
  background: white;
}
```

Aside
================================================================================


![Lijia Yu](https://avatars1.githubusercontent.com/u/895125?s=400&v=4){width=80%}

RLesur avatar Oct 24 '19 19:10 RLesur

Is there a way to extend the text on the 2nd page (without the sidebar) so that the text fits the width of the page? Without the gray bar the text looks squished

Screen Shot 2019-11-10 at 5 08 04 PM

tjbencomo avatar Nov 11 '19 01:11 tjbencomo

Using @RLesur's approach, I included this on my .css file, and it did the trick.

.pagedjs_page:not(:first-of-type) {
  --sidebar-width: 0rem;
  --sidebar-background-color: #ffffff;
  --main-width: calc(var(--content-width) - var(--sidebar-width));
  --decorator-horizontal-margin: 0.2in;
}

maibennett avatar Nov 11 '19 01:11 maibennett

Works great, thanks!

tjbencomo avatar Nov 11 '19 01:11 tjbencomo

For reference, this question on RStudio Community explains that @maibennett's solution was broken by pagedown 0.14 (thanks, @wjakethompson).

This is related to #211.

We can still use @maibennett's solution if we include the CSS rules in a CSS chunk and not in a CSS file (sorry for that).
See my answer on RStudio Community.

RLesur avatar May 01 '21 16:05 RLesur

.pagedjs_page:

What if I want to resume the sidebar in specific page ?

gyanmishra avatar Jul 09 '22 07:07 gyanmishra