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

:::concise doesn't play nice with chrome_print #303

Open
simeond opened this issue Dec 30, 2022 · 7 comments
Open

:::concise doesn't play nice with chrome_print #303

simeond opened this issue Dec 30, 2022 · 7 comments
Assignees
Labels
reprex needs a minimal reproducible example

Comments

@simeond
Copy link

simeond commented Dec 30, 2022

When I add a concise fence to a pagedown resume, it seems to conflict with chrome_print. See below for a reproducible example.

It works fine in infinite moon reader, but with chrome_print it breaks the page. Everything seemed to work fine last year (I don't update my cv too often)

---
title: "Lijia Yu's resume"
author: Lijia Yu
date: "`r Sys.Date()`"
output:
  pagedown::html_resume:
    # set it to true for a self-contained HTML page but it'll take longer to render
    self_contained: false
# uncomment this line to produce HTML and PDF in RStudio:
knit: pagedown::chrome_print
---

# Main

## Lijia Yu {#title}

### Currently searching for a PhD student position

Please note that this is a *real* resume, and I'm really looking for a PhD student position at the moment. I made this resume because Yihui asked me if I'd like to test the **pagedown** package with my resume. If you are interested in my background and skills, please feel free to contact me.

## Education {data-icon="graduation-cap"}

### Beijing University of Chemical Technology

B.S. in Information and Computing Sciences

Beijing, China

2010

Thesis: Dyadic wavelet and its application in edge detection

::: concise
- get dyadic wavelet
- apply to edge detection
- insert into thesis
- bob is your uncle.
:::
@cderv
Copy link
Collaborator

cderv commented Jan 3, 2023

but with chrome_print it breaks the page.

What is the breakage ?

This is what I got in PDF by chrome_print()
image

it seems fine compated to the HTML

image

Did I miss something or just can't reproduce ?

Using pagedown 0.20.1 and Chrome browser Version 108.0.5359.125

@cderv cderv added the reprex needs a minimal reproducible example label Jan 3, 2023
@simeond
Copy link
Author

simeond commented Jan 5, 2023

that's really odd. I still get two pages with chrome_print() but one with infinite moon reader (see below). I'm using chrome 108.0.5359.124 and pagedown 0.20.0

chrome_print_cv.pdf

Screenshot 2023-01-05 at 17 10 36

@cderv
Copy link
Collaborator

cderv commented Jan 5, 2023

Can you share a reprex as a full github repo maybe so that I could clone and reproduce ? Or a zip file ?

It seems copy pasting from github is not enough. Maybe a config, or some versions differences.

Sharing session info could help know we are on the same page;

Can you try pagedown the dev version just in case ?

@simeond
Copy link
Author

simeond commented Jan 6, 2023

Thanks Christophe.

I've created a repo here and added the session info. I'm still getting the same problem even after upgraded to the new dev version of pagedown

https://github.com/simeond/pagedown_cv_test

@cderv
Copy link
Collaborator

cderv commented Jan 6, 2023

Thanks a lot.

I can't reproduce on Windows after cloning the repo on rstudio daily version.

Details
==> pagedown::chrome_print('C:/Users/chris/Documents/DEV_OTHER/ISSUES/pagedown/pagedown_cv_test/pagedown_print_test.Rmd',  encoding = 'UTF-8');
++ Activating rlang global_entrace

++ Setting QUARTO_PYTHON

Using the browser "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
Trying to find headless Chrome in 20 attempts
Headless Chrome found at attempt 1
Browser version: HeadlessChrome/108.0.5359.125
  |......................................................................| 100%
   inline R code fragments


"C:/Users/chris/scoop/apps/rstudio-daily/current/resources/app/bin/quarto/bin/tools/pandoc" +RTS -K512m -RTS pagedown_print_test.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash-implicit_figures --output pagedown_print_test.html --lua-filter "C:\Users\chris\AppData\Local\R\win-library\4.2\bookdown\rmarkdown\lua\custom-environment.lua" --lua-filter "C:\Users\chris\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\chris\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\latex-div.lua" --wrap preserve --metadata newpage_html_class="page-break-after" --standalone --section-divs --template "C:\Users\chris\AppData\Local\R\win-library\4.2\pagedown\resources\html\resume.html" --highlight-style pygments "--mathjax=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --include-in-header "C:\Users\chris\AppData\Local\Temp\RtmpiAn464\rmarkdown-str1092872642fc8.html" 
DEBUG (from custom-environment.lua): Div classes -> id:1 val:concise
DEBUG (from custom-environment.lua): Not a bookdown supported custom class nil
Serving the directory C:\Users\chris\Documents\DEV_OTHER\ISSUES\pagedown\pagedown_cv_test at http://127.0.0.1:4951/pagedown_print_test.html
Rendered 1 pages in 62.5 milliseconds.
Receiving PDF from a stream
    stream chunk received
    stream chunk received
No more stream chunk to read
    closing stream

Output created: pagedown_print_test.pdf
Closing websocket connection
Closing browser
Cleaning browser working directory
Closing local webserver

It seems you are working on Mac. @yihui could try to on your side to see if you can reproduce ?
Thanks

@yihui
Copy link
Member

yihui commented Jan 6, 2023

I can't reproduce on my macOS with exactly the same version of Google Chrome.

> xfun::session_info('pagedown')
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.6.2, RStudio 2022.12.0.353

Comparing with @simeond's session info, my R version is higher and OS version is lower, but they shouldn't matter.

@simeond If you open the web page in your Chrome and print it via Cmd + P, do you get one or two pages?

servr::httd(initpath = 'pagedown_print_test.html')

@simeond
Copy link
Author

simeond commented Jan 6, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

3 participants