jtleek / dataanalysis

The lecture slides for Coursera's Data Analysis class
761 stars 720 forks source link

Links in PDF #3

Closed ramnathv closed 11 years ago

ramnathv commented 11 years ago

I saw a couple of students raise the issue of links not being clickable in the pdf version. I am investigating how to modify the print css so that links are clickable (I am not even sure if it is possible).

In the mean-time a quick fix is to include the following css in assets/css/custom.css

@media print {
  a:after {
   content: " (" attr(href) ")";
   font-size: 10px;
  }
}

This would print the link along with the title in the pdf print version so that users can copy-paste the link. This is sub-optimal, but a viable solution at this stage.

ramnathv commented 11 years ago

Here is some code to update all your custom.css files in one go. You need to run this from the root directory.

files_ = list.files(pattern = 'custom.css', recursive = TRUE)
extra_css = '@media print {
  a:after {
   content: " (" attr(href) ")";
   font-size: 10px;
  }
}'

lapply(files_, function(f){
  content = slidify:::read_file(f, warn = F)
  content = paste(content, extra_css, collapse = '\n')
  cat(content, file = f)
})

The pdf files will have to be printed manually from chrome. I am investigating an automated routed to achieve that and will keep you posted if I succeed :-)

ramnathv commented 11 years ago

A simpler solution is to print the slides using Safari which retains the html links.

jtleek commented 11 years ago

I'll try to fix this this afternoon and resubmit the pdf files. Hopefully that will fix the problem. Thanks for all your support during this process!

On Tue, Jan 22, 2013 at 12:37 PM, Ramnath Vaidyanathan < notifications@github.com> wrote:

I saw a couple of students raise the issue of links not being clickable in the pdf version. I am investigating how to modify the print css so that links are clickable (I am not even sure if it is possible).

In the mean-time a quick fix is to include the following css in assets/css/custom.css

@media print { a:after { content: " (" attr(href) ")"; font-size: 10px; }}

This would print the link along with the title in the pdf print version so that users can copy-paste the link. This is sub-optimal, but a viable solution at this stage.

— Reply to this email directly or view it on GitHubhttps://github.com/jtleek/dataanalysis/issues/3.

jtleek commented 11 years ago

ok i'll do that now and see if it works!

On Tue, Jan 22, 2013 at 1:57 PM, Ramnath Vaidyanathan < notifications@github.com> wrote:

A simpler solution is to print the slides using Safari which retains the html links.

— Reply to this email directly or view it on GitHubhttps://github.com/jtleek/dataanalysis/issues/3#issuecomment-12559952.

ramnathv commented 11 years ago

Jeff, the links on Coursera (served from cloudfront) have not updated. Just wanted to give you a heads up.