notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Color printing should be an option (or should be the default?)

Open aroberge opened this issue 10 years ago • 41 comments

Buried in the css files are various @media print configurations which prevent color printing. They can be edited by hand if one has access to the installation directories, but there should be a way to have color printing be done without this type of editing.

aroberge avatar Dec 11 '15 16:12 aroberge

@aroberge Thanks for the suggestion. Personally, I never noticed that printing defaults to B&W whether from the Print Preview menu option or the browser print menu (at least on Firefox).

@carreau @ellisonbg Is there a setting that can be easily changed to enable color printing? If so, it would seem reasonable to document here and the user docs.

willingc avatar Dec 12 '15 11:12 willingc

Hmm, I don't think we set anything that makes it BW. We will have to look into this.

On Sat, Dec 12, 2015 at 3:54 AM, Carol Willing [email protected] wrote:

@aroberge https://github.com/aroberge Thanks for the suggestion. Personally, I never noticed that printing defaults to B&W whether from the Print Preview menu option or the browser print menu (at least on Firefox).

@carreau https://github.com/carreau @ellisonbg https://github.com/ellisonbg Is there a setting that can be easily changed to enable color printing? If so, it would seem reasonable to document here and the user docs.

— Reply to this email directly or view it on GitHub https://github.com/jupyter/notebook/issues/840#issuecomment-164142268.

Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub [email protected] and [email protected]

ellisonbg avatar Dec 12 '15 18:12 ellisonbg

I've installed Jupyter + IPython using the Anaconda Python distribution. In my system, the relevant css file is (if I am not mistaken): Anaconda3/pkgs/notebook-4.06-py34_0/Lib/site-packages/notebook/static/style/style.min.css

Edit: from memory, there were two places where I removed code from the css file to print everything in color. The first place was near the @media print declaration; the second was a setting for html tables if I recall correctly.

aroberge avatar Dec 12 '15 18:12 aroberge

This is a bootstrap thing that include a print.less with !important. It's not easy to get rid of, but we can try.

Carreau avatar Dec 12 '15 21:12 Carreau

Any progress on this? Let me bump this one - it's really important to me.

I'm using Jupyter (+bash_kernel) to create some labs (Docker) where I use Jupyter to create the lab and then create a PDF to distribute to the students-*.

Those documents would be much more readable in colour.

Thanks for a great tool !

    • Putting Jupyter/bash_kernel combination into the hands of students would be confusing and unworkable due to long-running or interactive commands, so I use it just as my preparation tool - and it's fantastic for that.

    https://github.com/mjbright/jupyter_notebooks/tree/master/2016-Feb_Docker_Build_Lab

mjbright avatar Feb 04 '16 05:02 mjbright

@mjbright have you tried the conversion to PDF via latex ? ~~(it likely fail because of some ansi escape sequence but that's a bug that should be opened)~~(opened as https://github.com/jupyter/nbconvert/issues/228)

Are you afraid of a custom IPython build ? Basically set-up a dev environment, modify <repo root>/notebook/static/components/bootstrap/less, to remove line 13 @import "print.less";, and recompile CSS (python setup.py css)

That should be enough (understand it works for me locally), unfortunately that something that make the build process extremely inconvenient for downstream (like Debian) as then we use a modified version of our dependencies.

Carreau avatar Feb 04 '16 06:02 Carreau

Hi Matthias,

I did try briefly PDF via latex (quite a week I don't even remember if it was under RHEL7, Ubuntu-trusty or Win8 that I tried) but without early installation success I abandoned - because of soe lab setup constraints. I'll try again with my Ubuntu (a Vagrant box) ... when I have time (?).

Afraid of a custom IPython build? A little (time wise) but i'll consider that also. Mind you why are we talking about IPython?

Thanks for the suggestions, Mike.

On 4 February 2016 at 07:21, Matthias Bussonnier [email protected] wrote:

@mjbright https://github.com/mjbright have you tried the conversion to PDF via latex ? (it likely fail because of some ansi escape sequence but that's a bug that should be opened)

Are you afraid of a custom IPython build ? Basically set-up a dev environment, modify /notebook/static/components/bootstrap/less, to remove line 13 @import "print.less";, and recompile CSS (python setup.py css)

That should be enough (understand it works for me locally), unfortunately that something that make the build process extremely inconvenient for downstream (like Debian) as then we use a modified version of our dependencies.

— Reply to this email directly or view it on GitHub https://github.com/jupyter/notebook/issues/840#issuecomment-179667017.

mjbright avatar Feb 04 '16 16:02 mjbright

Hi, following a suggestion somewhere on StackOverflow, I think, I modified that equivalent path on my Ubuntu system.

The following context diff shows what I tried (out of informed ignorance). Restarting Jupyter didn't improve the situation.

Just in case someone has a quick hack to suggest ...

---

/home/vagrant/anaconda3/pkgs/notebook-4.1.0-py35_0/lib/python3.5/site-packages/notebook/static/style/style.min.
css     2016-02-04 05:37:14.921859360 +0000

---

/home/vagrant/anaconda3/pkgs/notebook-4.1.0-py35_0/lib/python3.5/site-packages/notebook/static/style/style.min.
css.orig        2016-02-04 05:35:56.893856260 +0000

---

**\* 192,198 ****

*:before,

*:after {

background: transparent !important;


!     /\* To allow colour printing: color: #000 !important;*/

box-shadow: none !important;

text-shadow: none !important;

}


--- 192,198 ----

*:before,

*:after {

background: transparent !important;


!     color: #000 !important;

box-shadow: none !important;

text-shadow: none !important;

}


---

**\* 242,252 ****

.dropup > .btn > .caret {

border-top-color: #000 !important;

}

-   /\* To allow colour printing:
  
  .label {
  
    border: 1px solid #000;
  
  }
-   */
  
  .table {
  
    border-collapse: collapse !important;
  
  }

--- 242,250 ----

On 12 December 2015 at 19:45, André Roberge [email protected] wrote:

I've installed Jupyter + IPython using the Anaconda Python distribution. In my system, the relevant css file is (if I am not mistaken):

Anaconda3/pkgs/notebook-4.06-py34_0/Lib/site-packages/notebook/static/style/style.min.css

— Reply to this email directly or view it on GitHub https://github.com/jupyter/notebook/issues/840#issuecomment-164175466.

mjbright avatar Feb 04 '16 16:02 mjbright

Mind you why are we talking about IPython?

gah, old habits and it was late at night, I was of course trying to say Jupyter Notebook

Hi, following a suggestion somewhere on StackOverflow, I think, I modified that equivalent path on my Ubuntu system.

Force reload the page (Ctrl-Shift-R, likely) the browsers can have agressive caching.

Carreau avatar Feb 04 '16 17:02 Carreau

La honte (duh!) for Ctrl-Shift-R ! Thanks Matthieu, I have colour printing now !!

On 4 February 2016 at 18:15, Matthias Bussonnier [email protected] wrote:

Mind you why are we talking about IPython?

gah, old habits and it was late at night, I was of course trying to say Jupyter Notebook

Hi, following a suggestion somewhere on StackOverflow, I think, I modified that equivalent path on my Ubuntu system.

Force reload the page (Ctrl-Shift-R, likely) the browsers can have agressive cahing.

— Reply to this email directly or view it on GitHub https://github.com/jupyter/notebook/issues/840#issuecomment-179952484.

mjbright avatar Feb 04 '16 21:02 mjbright

That's wonderful! :sunrise:

Thanks @Carreau :+1:

willingc avatar Feb 04 '16 21:02 willingc

I am curious as to why has this just been closed? It still requires custom editing of one file in the distribution if I am not mistaken. If I understand correctly, the Ctrl-Shift-R was just done so that the browser would use the file edited by hand but the underlying problem is still there.

aroberge avatar Feb 04 '16 21:02 aroberge

I am curious as to why has this just been closed?

This was likely a mistake, it happen when you get notification by mail, and only see the last few messages.

Carreau avatar Feb 04 '16 21:02 Carreau

(reopened)

Carreau avatar Feb 04 '16 21:02 Carreau

My apologies for not reading to the top of the message list @aroberge. Thanks @Carreau for reopening.

willingc avatar Feb 04 '16 21:02 willingc

Could someone explain this to me - I, too, am interested in printing in color. I am able to generate .html files of my notebook that look correct, but when I print them or save as .pdf when printing, only the inline figures show color. This is the case whether or not I comment the lines that @Carreau suggested, above.

AGS-Knight avatar Feb 09 '16 11:02 AGS-Knight

@AGS-Knight if you're modifying the LESS files, you'll need to recompile them to CSS, reinstall the notebook, and convince your browser to clear the cache before you'll see any effect.

It should absolutely be possible to print in colour without going through this.

takluyver avatar Feb 09 '16 12:02 takluyver

Yeah, I'm pretty sure any BW print settings are not intended. A LESS PR fixing this would be welcome.

minrk avatar Feb 09 '16 13:02 minrk

A LESS PR fixing this would be welcome.

It was like that before, but it requires a modified version of bootstrap. We were removing code.less and print.less, though it required too much maintenance at each update, and completely screw up packaging by thongs like debian.

Carreau avatar Feb 09 '16 17:02 Carreau

Is the intent still to fix this issue? Any estimate on when it might be fixed?

Printing notebooks to PDF is one of my favorite features, but black and white really reduces the usefulness.

lia-simeone avatar May 06 '16 19:05 lia-simeone