eddelbuettel / pinp

Pinp Is Not PNAS -- Two-Column PDF Template
147 stars 25 forks source link

Pinpbluetext is Red-ish; shouldn't it be blue? #90

Closed sam217pa closed 3 years ago

sam217pa commented 3 years ago

Hi,

By default links are colored in RGB{101,0,0} (or #650000), which is crimson red or something. Shouldn't it be blueish ? The color name is pinpbluetext. I've changed it locally to RGB{0,0,101} (or #000065) and it looks nice, and seems to reflect PNAS color codes.

https://github.com/eddelbuettel/pinp/blob/62fef2babdbcaf2223c52fd238a3067ebc3c2c2a/inst/rmarkdown/templates/pdf/resources/template.tex#L29

Many thanks for pinp; I use it almost daily!

(EDIT: I realize that github automatically adds a little color next to the HTML color code, which is pretty cool.)

eddelbuettel commented 3 years ago

Hm. When I do (per the package README.md, and all on one line her broken)

Rscript -e 'library(rmarkdown); \
                 draft("quickcheck.Rmd", template="pdf", package="pinp", edit=FALSE);  \
                 render("quickcheck.Rmd")

the indeed links are red. I think they always have been per the style we inherited from PNAS. Do you remember, @coatless ?

Yet:

edd@rob:/tmp/pinptest$ grep pnasbluetext *
pinp.cls:\definecolor{pnasbluetext}{RGB}{0,101,165} %
pinp.cls:\RequirePackage[colorlinks=true, allcolors=pnasbluetext]{hyperref}
pinp.cls:\renewcommand\UrlFont{\color{pnasbluetext}\sffamily}
pinp.cls:%\definecolor{pnasbluetext}{RGB}{0,101,165} %
pinp.cls:%\definecolor{pnasbluetext}{RGB}{0,115,209} % Not used
pinp.cls:\mdfdefinestyle{pnassigstyle}{linewidth=0.7pt,backgroundcolor=pnasblueback,linecolor=pnasbluetext,fontcolor=pnasbluetext,innertopmargin=6pt,innerrightmargin=6pt,innerbottommargin=6pt,innerleftmargin=6pt}
grep: quickcheck_cache: Is a directory
grep: quickcheck_files: Is a directory
quickcheck.tex:\definecolor{pnasbluetext}{RGB}{101,0,0} %
edd@rob:/tmp/pinptest$ 

it seems we want a value from the cls file to win but we loose to something that comes from the template file.

Looking at template.tex the full segment is actually

https://github.com/eddelbuettel/pinp/blob/62fef2babdbcaf2223c52fd238a3067ebc3c2c2a/inst/rmarkdown/templates/pdf/resources/template.tex#L26-L30

so the key is to have linkcolor defined. So when I add

 linkcolor: 000065

to the YAML header it works (and that is what the manual page suggests).

So I think you convinced that the code (I just quoted) is wrong and needs a different alternate value.

And yes that GitHub shows the color is very cool :)

eddelbuettel commented 3 years ago

So I just fixed that in the commit referenced above. Comments welcome: @coatless @ikashnitsky

sam217pa commented 3 years ago

Well thanks, that was fast ;)

eddelbuettel commented 3 years ago

Hitting me at first morning coffee is apparently an effective strategy :)