cheatsheets icon indicating copy to clipboard operation
cheatsheets copied to clipboard

Grey text of the Cheastsheets is hard to read when printed

Open jypeter opened this issue 2 years ago • 6 comments

Thanks a lot for the nice cheatsheets!

I have followed a link to this GH page to get a pdf version (for printing)

  • The 3 handouts (Beginner, Intermediate and Tips) are perfectly readable
  • Unfortunately, the 2-page Cheatsheets itself is harder to read, not so much because the text is smaller, but because the grey on white parts of the text are not contrasted enough when printed. Would it be possible to use only black text (and possibly use bold characters for the current black text)?

jypeter avatar Sep 27 '23 12:09 jypeter

Thanks. Which part exactly are you referring to?

rougier avatar Oct 13 '23 10:10 rougier

Maybe an example will help

As an example, I have put 3 jpg below, based on the cheatsheets.pdf and the beginner handout files

  • a jpg taken directly from a screenshot of the pdf open in Acrobat: quite readable!
  • a jpg from a picture of the printed pdf: the picture looks even worse than what the eye can see on the printed version. Note: it's printed on reasonably white paper (that is, not grey looking recycled paper), and a heavy duty professional printer. The actual printed page is white, not the dirty grey of the picture, but the printed grey text is hard to read
  • a jpg from a picture of the printed pdf of the beginner handout: same paper/printer and camera. Characters are bigger, but I think that the style used (black on light grey) is more readable (when printed)

Acrobat

mpl_cheatsheets_from_pdf

Printed

mpl_cheatsheets_from_printer_and_picture

Printed beginner handout

mpl_handout-beginner_from_printer_and_picture

jypeter avatar Oct 31 '23 16:10 jypeter

Thanks, I see your point now. We could have a different set of colors with higher contrast for printed cheets or we could a post-processing on the PDF to enhance contrast. I imagine there are some tools to do that but I don't know them.

rougier avatar Nov 16 '23 15:11 rougier

We could have a different set of colors with higher contrast for printed cheets

I think a "printed" stylesheet is the better route in terms of accessibility, cause we might also want a high contrast web version too.

story645 avatar Nov 16 '23 16:11 story645

So this means working on the cheatsheet.tex file and removing any harcoded color in favor of variables such that we can have a switch to choose one specific set of color. It's not too difficult to do but I'm a bit busy until mid december. If anyone want to give a try...

rougier avatar Nov 16 '23 18:11 rougier

. If anyone want to give a try...

I won't have time 'til December either, but if anyone else wants to take a stab, I've been doing this in a paper so I have a style file notation.sty with a whole bunch of definitions:

\definecolor{total}{HTML}{248EA6}
\definecolor{fiber}{HTML}{E30B5C}
\definecolor{base}{HTML}{7924AB}
\definecolor{section}{HTML}{03C04A}

and then use the following to parse my file to build a python dict to keep my colors in sync between latex and python

import re

sub = re.compile(r"\\definecolor\{(?P<name>.*)\}\{HTML\}\{(?P<color>.*)\}")

def build_colors(filepath = '../notation.sty'):
    colordict = {}
    with open(filepath) as f:
        for line in f.readlines():
            if groups := sub.match(line):
                colordict[groups.group('name')] = "#"+ groups.group('color')
    return colordict

story645 avatar Nov 17 '23 04:11 story645