clojure-cheatsheets icon indicating copy to clipboard operation
clojure-cheatsheets copied to clipboard

Single column per page version?

Open sogaiu opened this issue 6 years ago • 5 comments

The pdf versions when printed on A4 / US Letter paper can be a bit hard on the eyes for some of us.

Any chance of a single-column per page version?

Tried tweaking the code, but it seems like 2-column-ness is woven in.

Created something using the freely available krop program manually (result is 8 pages), but don't relish doing this by hand again.

At any rate, thanks for maintaining the cheatsheets :)

sogaiu avatar Jan 14 '19 15:01 sogaiu

I do not know if this is what you are hoping for, but it is a very small change to increase the font size, but keep two columns per page. The total length will go over 2 pages, which I had been keeping at some people's requests, by reducing the font size gradually over the years :-) I always use the HTML version myself.

Look for the fontsize= declarations, and experiment with different larger numbers than exist in the checked-in code after that, in the file src/clj-jvm/src/generator/core.clj - the particular lines of code are linked below.

https://github.com/jafingerhut/clojure-cheatsheets/blob/master/src/clj-jvm/src/generator/core.clj#L1619-L1627

jafingerhut avatar Jan 14 '19 17:01 jafingerhut

Thanks for the hints.

I tried changing the fontsize to around 10, 12, 14, and 24, but unfortunately the columns seem to move out of alignment.

It looks like modifying the html to be a single column and single page (not printed, but in a single page div) would be pretty straight-forward. Then perhaps a browser's printing capability might be used to export the result as PDF...

Is there an easy way to get those nice colors for the html versions?

sogaiu avatar Jan 15 '19 04:01 sogaiu

I tried fontsize 8.5pt, and the usletter version went from 2 to 4 pages. The spacing between some boxes had some big whitespace between them, but it wasn't terrible. Try that and see what you think.

Yes, modifying the generated LaTeX so it no longer used two-column mode should be straightforward, I would think. I will let you know if I do try it, but my guess is that you are probably significantly more motivated than I am, and perhaps less constrained for time. Google is your friend.

jafingerhut avatar Jan 15 '19 07:01 jafingerhut

I did some quick experimenting, and found that if in the first line of the .tex files that the Clojure program generates, you delete "twocolumn," (delete the comma immediately before or after that word, too), evreything goes in one column. You can also tweak the fontsize on that same line, simply re-running latex <filename>.tex and dvipdfm <filename> after each edit you make to the .tex file to see the results.

jafingerhut avatar Jan 15 '19 07:01 jafingerhut

Modifying the .tex files as suggested and running the results through latex and dvipdfm produced some promising results. I've tried fontsizes of 8.5, 10, and 12.

I'm relieved that it's likely I'll be able to enjoy the cheatsheets in future incarnations :)

Thanks for all of your help!

sogaiu avatar Jan 15 '19 10:01 sogaiu