amueller / scipy-2016-sklearn

Scikit-learn tutorial at SciPy2016
Creative Commons Zero v1.0 Universal
515 stars 516 forks source link

update media links to make it work with latex / pdf renderer #84

Closed robert-zaremba closed 7 years ago

robert-zaremba commented 7 years ago

png is not rendered in the browser: https://github.com/amueller/scipy-2016-sklearn/pull/84#discussion_r99842325

amueller commented 7 years ago

Sorry I don't understand the last comment. PNG is rendered in the browser and in latex, PDF is not rendered in the brower, SVG is not rendered in latex. Converting all SVG to PNG is a quick work-around - though I feel like there should be a way to make latex accept SVG, but I remember it was tricky.

rasbt commented 7 years ago

Hm, it may be different now, but I think you'd need external tools (like inkscape) to export/prepSVGs so that they can be embedded in latex. I remember struggling with that one once. Since then, I am just using eps or PDF for latex specifically, and PNG for everything else.

robert-zaremba commented 7 years ago

@rasbt - correct, I had problems with svg. @amueller - with PNG you loose quality.

amueller commented 7 years ago

@robert-zaremba I know, it's a horrible workaround to convert vector graphics to raster images, but I don't know another way without using the inkscape conversion.

amueller commented 7 years ago

One way is actually to render it using maplotlib because then you can embed multiple mime-types but that seems like a weird thing to do...

rasbt commented 7 years ago

with PNG you loose quality.

yeah, that's the unfortunate compromise. However, I think for typical web media, it's probably more important to have it compatible for most people (and one can save the vector graphics to generate higher res versions later if needed, i.e., if everyone has 4k monitors one day or so :P)