brentthorne / posterdown

Use RMarkdown to generate PDF Conference Posters via HTML
https://brentthorne.github.io/posterdown_html_showcase/
Other
843 stars 131 forks source link

failure to knit #42

Closed higgi13425 closed 5 years ago

higgi13425 commented 5 years ago

When I use the default posterdown template, I get knit failure, with the following message:

Error: package or namespace load failed for ‘Cairo’: .onLoad failed in loadNamespace() for 'Cairo', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Cairo/libs/Cairo.so': dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Cairo/libs/Cairo.so Reason: Incompatible library version: Cairo.so requires version 19.0.0 or later, but libfreetype.6.dylib provides version 18.0.0

Then re-installed Cairo, then when trying to call library(Cairo) from the console, I get the following error:

library(Cairo) Error: package or namespace load failed for ‘Cairo’: .onLoad failed in loadNamespace() for 'Cairo', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Cairo/libs/Cairo.so': dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Cairo/libs/Cairo.so Reason: Incompatible library version: Cairo.so requires version 19.0.0 or later, but libfreetype.6.dylib provides version 18.0.0

Appears to be some kind of conflict in Cairo - not sure why.

Not sure if this is directly the cause of failure to knit.

brentthorne commented 5 years ago

Hmm, off the top of my head I think it may be a need to update the latex packages you have. Try using the tinytex method to update all packages:

library(tinytex)
tlmgr_update()   

Try that and let me know if it works or not!

higgi13425 commented 5 years ago

Unfortunately, no luck with that intervention. Error when knitting: Quitting from lines 79-92 (test_kable.Rmd) Error in dev.control(displaylist = if (record) "enable" else "inhibit") : dev.control() called without an open graphics device Calls: ... call_block -> block_exec -> chunk_device -> dev.control In addition: Warning messages: 1: In (function (filename = if (onefile) "Rplots.pdf" else "Rplot%03d.pdf", : unable to load shared object '/Library/Frameworks/R.framework/Resources/library/grDevices/libs//cairo.so': dlopen(/Library/Frameworks/R.framework/Resources/library/grDevices/libs//cairo.so, 6): Library not loaded: /opt/X11/lib/libcairo.2.dylib Referenced from: /Library/Frameworks/R.framework/Resources/library/grDevices/libs//cairo.so Reason: Incompatible library version: cairo.so requires version 11403.0.0 or later, but libcairo.2.dylib provides version 11203.0.0 2: In (function (filename = if (onefile) "Rplots.pdf" else "Rplot%03d.pdf", : failed to load cairo DLL Execution halted On Sunday, January 27, 2019, 11:09:28 AM EST, Brent Thorne notifications@github.com wrote:

Hmm, off the top of my head I think it may be a need to update the latex packages you have. Try using the tinytex method to update all packages: library(tinytex) tlmgr_update()
Try that and let me know if it works or not!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

brentthorne commented 5 years ago

Alright, this appears to be a macOS specific issue, if you can confirm you are using macOS that ould be great. A few test options that could narrow it down:

1) Are you able to try knitting the document without any r chunks / no figures ? 2) Use capabilities() to see if your install of R allows for cairo = TRUE

higgi13425 commented 5 years ago

More data:1. Yes, a Mac desktop, though knitting works fine on my mac laptop (previously addresses issues with posterdown on that one). Seems like individual setup on Macs matters.1.a. removed figure chunks - able to knit.2. capabilities does say cairo=TRUE3. installed R 3.5.2 from CRAN, still knits fine if no figures, fails if even one figure added back.- reinstalled posterdown from GitHub - reinstalled tidy text4. Possibly a deficiency of Xquartz on the Mac - XQuartz

|

XQuartz

|

|

|

appears to be required for Cairo. Can knit other Rmd documents to pdf on this Mac Then downloaded/installed XQuartz 2.7.11, and restarted Mac, now everything knits.Will add as an issue for the readme.

On Sunday, January 27, 2019, 1:31:35 PM EST, Brent Thorne <notifications@github.com> wrote:  

Alright, this appears to be a macOS specific issue, if you can confirm you are using macOS that ould be great. A few test options that could narrow it down:

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

higgi13425 commented 5 years ago

Looks like it might be worth adding Mac-specific instructions for setup XQuartz was the missing piece for Cairo, even though capabilities() for cairo = true

For Mac setup,

  1. Download Quartz X11 at https://www.xquartz.org , install, restart your Mac
  2. install.packages("Cairo")
  3. Test library(Cairo) - if this fails, start over (the rest is the same)
  4. install or update devtools
  5. install posterdown from GitHub
  6. install tinytex
brentthorne commented 5 years ago

Yes this would be useful to Mac users! I'll add this soon. Glad it worked :smile:

higgi13425 commented 5 years ago

Hi Brent, Glad I got that sorted - it took me two separate Mac installs to find the patternto that problem (and remember the separate issues with Xquartz, tinytex, and competing tex installs).

Unrelated questions about fonts:

  1. what controls which font appears between backticks in text,i.e. Welcome to posterdown ! what controls the font for posterdown ??
  2. I can control the font of title by inserting\fontfamily{qhv}\selectfontat the beginning of the text of the font, just after the quotation, and before the actual text.This is great.
  3. However, this does not seem to work for authors or institutions.Puzzling - is there a way to do this? I just want these to be in the same font as the title.Or does this have to do with the hacky way needed to make multiple authors work?(If so, can you borrow code from the rticles package?) What is currently controlling the font family for authors or institutions?
  4. I can control the font of body text by inserting\fontfamily{qag}\selectfont before the first chunk of body text - and it carries forward to all of the other body text (excepting that surrounded by backticks). This is great.
  5. However, if I change the first sectitle font by inserting\fontfamily{bch}\selectfont before the text starts, this only affects the first sectitle, and does not carry forward. Any way to make this carry forward? BTW, I am finding the font codes at the link below.
  6. I am puzzled by what the font_family parameter in the YAML header does control.Does it control some font somewhere?What am I missing?
  7. Also, any way to adjust the spacing between words?When I use\fontfamily{qhv}\selectfont in the title, the words are a bit too close together.Other fonts are usually OK, but not always. I can do it in a hacky way with \space where needed. thanks,Peter Font typefaces

|

Font typefaces

An online LaTeX editor that's easy to use. No installation, real-time collaboration, version control, hundreds o... |

|

|

On Sunday, January 27, 2019, 5:40:44 PM EST, Brent Thorne <notifications@github.com> wrote:  

Yes this would be useful to Mac users! I'll add this soon. Glad it worked 😄

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

kgalyen commented 3 years ago

Looks like it might be worth adding Mac-specific instructions for setup XQuartz was the missing piece for Cairo, even though capabilities() for cairo = true

For Mac setup,

  1. Download Quartz X11 at https://www.xquartz.org , install, restart your Mac
  2. install.packages("Cairo")
  3. Test library(Cairo) - if this fails, start over (the rest is the same)
  4. install or update devtools
  5. install posterdown from GitHub
  6. install tinytex

Thank you for this! I followed your instructions and it worked like a charm. 👍

xiangrkong commented 4 months ago

it is useful. in the same time, I need instead pandoc_args: -- chapter using --top-level-division=chapter