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

background colours appear to be broken #81

Closed chiphogg closed 5 years ago

chiphogg commented 5 years ago

I am following the README instructions based on an install_github() version of posterdown (and rmarkdown). The background is pure white, which makes the text unreadable.

Peeking at HTML source, I see a lot of things that look like this:

<!--
Here are the required style attributes for css to make this poster work :)
-->
<style>
@page {
size: 46in 32in;
margin: 0;
padding: 0;
background-color: <h1 id="ffffff">FFFFFF</h1>;
}
body {
margin: 0px;
padding: 0px;
width: 46in;
height: 32in;
text-align: justify;
font-size: 45px;
background-color: <h1 id="ffffff">FFFFFF</h1>;
color: <h1 id="section">000000</h1>;
}

So, I manually edited the HTML file, like so:

<!--
Here are the required style attributes for css to make this poster work :)
-->
<style>
@page {
size: 46in 32in;
margin: 0;
padding: 0;
background-color: #FFFFFF;
}
body {
margin: 0px;
padding: 0px;
width: 46in;
height: 32in;
text-align: justify;
font-size: 45px;
background-color: #FFFFFF;
color: #000000;
}

When I reload the page, everything looks like the demo.

Maybe something in the chain from .Rmd to .html is treating the colour codes like markdown headers?

This might be useful information:

$ pandoc --version
pandoc 1.19.2.4
Compiled with pandoc-types 1.17.0.5, texmath 0.9.4.4, skylighting 0.3.3.1
Default user data directory: /home/chogg/.pandoc
Copyright (C) 2006-2016 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
brentthorne commented 5 years ago

Hello @chiphogg thanks for using posterdown!

I think this may be a pandoc issue indeed. Could you try updating to pandoc >= 2.2.3 as mentioned in the readme install and let me know if that helps?

Cheers

remlapmot commented 5 years ago

Just to say I recently installed RStudio 1.2 and it includes pandoc 2.3.1.

brentthorne commented 5 years ago

@remlapmot are you having the same issue or are you not experiencing this and just suggesting an rstudio download? I am not able to reproduce the issue when pandoc is >=2.2.3 installed myself so I am curious if other are. Thanks

remlapmot commented 5 years ago

My PhD student had the old RStudio (version 1.0 or 0.99 something) and he had the colour problem. When he updated to RStudio 1.2 the problem went away (presumably because of the later version of pandoc bundled with it).

remlapmot commented 5 years ago

Just to add, I have tried knitting a poster using some previous versions of pandoc, which are available here https://github.com/jgm/pandoc/tags .

So I think you that you could say that you need pandoc >= 2.0 for this to be fixed.

chiphogg commented 5 years ago

Thanks; that makes sense.

In my case, installing a new version of pandoc was tremendously difficult. (I had done this before a bunch of times over the past 5+ years or so, but something on Ubuntu 18.04 seems to make it extra challenging to compile from cabal---I observed this on both my home and work machines. The specific error had something to do with dependency resolution.)

FWIW, I was able to work around this even with the old version of pandoc, by escaping the # character in the colour specifications. I'm away from my work computer, but it was something to the effect of color: \#ffffff.

benjaminrobinson commented 5 years ago

Thank you @brentthorne for this package and thatnk you @chiphogg and @remlapmot for your discussion here. It helped me solve an issue that I was having with the colors option. Thank you again!