Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

Multi-column articles

A multi-column, multi-page viewer for long web articles, inspired by the New York Times Reader software. (Last updated June 17, 2008)

This script provides a multi-column, multi-page viewer for long web articles from several web sites. Here's a screenshot:



The currently supported sites are: For most sites, using the script simply requires navigating to the printer-friendly version of an article (the original article is modified for sites like nybooks.com that don't provide printer-friendly pages). To get the original printer-friendly page, simply disable Greasemonkey and re-load.

Supporting more sites should be fairly straightforward. Patches are welcome :). See the script homepage for more details.

Here's a changelog:

  • 0.5.0: Added hyphenation, via the hyphenator script (requires Firefox 3). Support for SFGate and The Economist. Also, support for BBC News, ABC News, Newsweek, and Time, contributed by ihq. Fixes for Wall Street Journal and Washington Post.
  • 0.4.1: Fixed Washington Post.
  • 0.4.0: Added ability to use custom style for paragraphs. Added outer margin, as suggested by neetij. Other small fixes.
  • 0.3.5: Fixed bugs in calculating height of column text. Hopefully, columns will now be appropriately sized to avoid vertical scrolling. Also, added initial support for Wikipedia.
  • 0.3.0: Overhaul of scrolling implementation. Various bugs like text slightly off the page or too few pages should be (mostly) fixed. Occasionally, there will now be an extra blank page; this is a known issue. Also, fixed Boston Review.
  • 0.2.1: Added support for The Guardian. Small fix for The Atlantic.
  • 0.2: Add option to disable smooth scrolling. Disable prev and next buttons when appropriate. Minor fixes for sites.
  • 0.1.8: Support for Foreign Affairs. Small fix for Mac.
  • 0.1.7: Support for Wall Street Journal.
  • 0.1.6.1: Small fix for Washington Post.
  • 0.1.6: Support for Wired, contributed by Liam.
  • 0.1.5: Support for Slate and The Seattle Times
  • 0.1.4: Support for San Jose Mercury News, contributed by Tracy Logan.
  • 0.1.3: Improved aesthetics, contributed by Dave.
  • 0.1.2: Added support for New York Magazine.
  • 0.1.1: Made text justified, which looks better to me for narrow columns. I may change this back if anyone complains.
  • 0.1: Initial release.

Finally, here are some other scripts that work well with this one:




Jul 10, 2008
Raking Leaves Script's author

Hi Margot,

Glad you like the script! Wikipedia works fine for me. To get the multi-column layout, just click on the "Printable version" link in the box labeled "toolbox" in the left column on any article. Pictures don't appear in the multi-column view since they are often removed from printer-friendly versions of articles. Beyond that, I'm not sure the column layout in Firefox is advanced enough yet to add pictures to multi-column text in a nice way. But, when that happens, I'll think about how I can include them.

 
Jul 7, 2008
Margot User

It doesn't work on wikipedia unless I remove the "printable=yes*" from the url (Included Pages), but I guess it was there for some reason. Also I can't see any pictures in the multi-column view.

Besides that it's great!

 
Jun 18, 2008
Raking Leaves Script's author

I've just released version 0.5.0, coinciding with the release of Firefox 3. The big new feature is automatic hyphenation via Firefox 3's soft hyphen support and the hyphenator script (see http://code.google.com/p/hyphenator/). The script still works with Firefox 2, but hyphenation won't work. There's also support for a bunch more sites, mostly thanks to ihq (see comment below). I've also noticed that smooth scrolling performance seems to be much improved in Firefox 3, at least on Mac. Enjoy!

 
Jun 16, 2008
Raking Leaves Script's author

Sweet, thanks for the patch, ihq! I will include it in the next release, along with the hyphenation feature. I'll try to get it out soon after the Firefox 3 release this Tuesday.

 
Jun 15, 2008
ihq User

BBC News:

// @include http://*.bbc.co.uk/*/pagetools/print/*

else if (theURL.match(/bbc\.co\.uk/)) {
        return getTextBBCNews();
}

function getTextBBCNews() {
    addGlobalStyle("body { padding-left: 0; padding-right: 0; }");
    addGlobalStyle("div.headline { text-align: left; }");
    removeAll(getElementsByClass('ibox',null,null));
    return addChildrenToNewDiv(document.body);
}

ABC News:

// @include *abcnews.go.com/print?id=*

else if (theURL.match(/abcnews\.go\.com/)) {
        return getTextABCNews();
}

function getTextABCNews() {
    addGlobalStyle("h1,h2,h3,h4 { font-family: sans-serif; text-align: left; }");
    return document.getElementById('content');
}

Newsweek:

// @include http://*.newsweek.com/*/output/print

else if (theURL.match(/newsweek\.com/)) {
        return getTextNewsweek();
}

function getTextNewsweek() {
    addGlobalStyle("img {margin: 0 0 0 0;}");  
    // TO DO: remove p tag from deck div (subtitle) so the style isn't overwritten
    addGlobalStyle(".author { padding: 5px 0 0 0; }");
    addGlobalStyle(".articleUpdated { margin: 0 0 0 0; }");
    addGlobalStyle(".contentWrapper { margin: 0 0 0 0; width: 100%; padding-top:0 }");
    removeAll(getElementsByClass('copyright'));
    removeAll(getElementsByClass('hr'));
    removeAll(getElementsByClass('URL'));
    return getElementsByClass('body', document.body, 'div')[0];
}

Time:

// @include http://*.time.com/*/printout/*

else if (theURL.match(/time\.com/)) {
        return getTextTime();
}

function getTextTime() {
    removeIfNotNull(document.getElementById('topBannerWrap'));
    removeAll(getElementsByClass('button',null,null));
    addGlobalStyle('.contentMain { padding: 0 0 0 0; }');
    addGlobalStyle('.tout1 p { line-height:1.3em ! important; }');
    addGlobalStyle('h1 { text-align:left; }');
    addGlobalStyle('.tout1 { border:0; }');
    addGlobalStyle('#footer { margin-top:0; }');
    removeAll(getElementsByClass('find'));
    return getElementsByClass('tout1',null,null)[0]
}

 
Apr 14, 2008
Raking Leaves Script's author

Hi everyone, thanks for all the comments. First, some good news: I have an initial implementation of hyphenation! It was done mostly via the wonderful hyphenator script:

http://code.google.com/p/hyphenator/

Thanks to ihq for the initial pointer. In my preliminary tests, readability is sometimes dramatically improved. The only issue is that automatic hyphenation relies on soft hyphen support, which is implemented in Firefox 3 but not Firefox 2. Since Firefox 3 should be released relatively soon, I am going to hold off on a new release until I can fully test it with Firefox 3. I'll also add support for a couple more sites in the next release.

Regarding printing of articles in multi-column format, it sounds like there are some good ideas out there, but I think it would require some significant changes over what is implemented now. It took a long time to get the notion of "pages" working decently with the script as-is. Firefox doesn't really tell you exactly how wide a column is or how many columns are currently being displayed, and calculating that information wasn't very easy. My guess is that trying to determine what should go on a "printed page" will be even harder. I don't have time to work on this, but if anyone is interested in taking charge, I'm glad to try and help.

Marc Savoy: not sure what happened in your case. Do other scripts work? My guess is your problem isn't with this script in particular, but with Greasemonkey in general.

 
Apr 12, 2008
Marc Savoy User

This worked when I initially installed it yesterday but even after uninstalling and re-installing, it doesn't work anymore. :-(

 
Apr 6, 2008
orrorin User

Can we have this working for San Francisco Chronicle (sfgate.com)? They have verbose articles as well.

Also, instead of creating a multi-page output, can we have a single page or pseudo-pagination (where the entire article is on a single web page, but the next and prev buttons are pointing to (pseudo-)page based anchors on it)? This will make it easier to print in multi-column format.

Thanks for the good work!

 
Apr 5, 2008
Raking Leaves Script's author

I just posted an update (first in a while!) that hopefully fixes the Washington Post. Hopefully more soon...

 
Mar 31, 2008
Raking Leaves Script's author

Hi everyone, sorry for being somewhat unresponsive here. I have a real job now, and hence less time to work on the script :). I'll try to fix the washingtonpost issue soon. I'll also try to get Firefox 3 support going soon after it's released. But, because of other commitments, I can't make any promises about timely releases. As always, I welcome patches, and I'm glad to answer any questions ppl have about the code.

 
Mar 22, 2008
ihq User

The script isn't working for me on washingtonpost.com. I get the error

Error: theText has no properties
Source File: file:///C:/Users/Me/AppData/Roaming/Mozilla/Firefox/Profiles/default/gm_scripts/multicolumnarticles.user.js
Line: 668

 
Mar 21, 2008
ihq User

These settings make pages look a little more like a printed newspaper:


padding-top: 0pt ! important;
padding-bottom: 0pt ! important;
text-indent: 1em ! important;

Is there a way to include hyphenation? Here is a starting point: http://www.mnn.ch/hyph/hyphenation2.html.

 
Mar 17, 2008
mmcc User

Great script! I'm trying to figure out how to use this to print out long web articles in multiple columns. I've changed the script a bit so the entire article is drawn with a scroll bar at the bottom of the browser instead of having the nav bar. However, when I try to print, the article is either shrunk down to fit on one page, or only one page is generated with the rest of the article cut off.

I'd love to somehow say that two or three columns should be printed per page. Any ideas?

 
Oct 30, 2007
Raking Leaves Script's author

I just uploaded version 0.4.0, which adds the ability to use a custom style for article text. I hope people find this feature handy; I think the default custom style is a big improvement over the style for most printer-friendly pages. Note that I haven't thoroughly tested modifying different parts of the custom style; some changes may have adverse affects on script functionality. Changing fonts and font sizes should be fine, though.

neetij: I added the margin as you suggested; thanks. Re: the access keys, I couldn't get the suggested code to actually do anything, as far as I could tell. I also read this web page, which suggests that access key support can be quite tricky. If someone can explain to me what benefits the access keys provide in Firefox, I'll add the code.

Still thinking about Eoin's issue with printer-friendly links; I may write a separate script to address them.

 
Oct 17, 2007
neetij User

I must say this is a wonderful script. Thanks for taking the time to write this up.
You might want to add a margin to the body for the Wired print view - it sticks to the edges.

document.body.setAttribute("style", "margin: 10px; width:auto;");

I think introducing access keys for the pagination would be a welcome addition.

prevButton.setAttribute("accesskey", "p");
nextButton.setAttribute("accesskey", "n");

Cheers.

 
Sep 17, 2007
Raking Leaves Script's author

I just posted a new version with a revamped implementation of scrolling that should hopefully fix several minor bugs. Note that now, there may be an extra blank page on some articles; this is a known issue. Post a comment if you see problems with text being cut off or too few pages for an article.

In the next version, I hope to allow user formatting of articles (text font, size, etc.), and I'm still thinking about a good way to address Eoin's issue.

 
Sep 13, 2007
Eoin Jones User

Hey thanks, look forward to the update, its already very handy, but I guess us greasemonkey users by nature are always looking for the ideal scenario.

 
Sep 12, 2007
Raking Leaves Script's author

Hey, sorry for being so slow in responding; I just completed a move. Eoin, you're right, being able to go directly to printer-friendly pages would be a great feature. There are already separate scripts that take you directly to printer-friendly pages for certain sites (e.g., http://userscripts.org/scripts/show/10855). As you suggest, I would like to be able to choose printer-friendly vs. standard on a per-article basis, as sometimes there are interesting pictures or multimedia features linked from the standard article view. I'll keep thinking about an unobtrusive way to make navigating to the multi-column view easier.

I'm working on some other minor improvements; hopefully a new version will be released soon.

 
Aug 26, 2007
Eoin Jones User

sorry, maybe something other than ctrl+click as that is the shortcut to open the link in a new tab.

 
Aug 26, 2007
Eoin Jones User

It would be very handy if link redirection was added to this script so you could ctrl+click on headlines to go directly to the printable page without needing to go through the standard article page first, but I guess that might be tricky.

 
Aug 23, 2007
Eoin Jones User

Hey, thanks a million, that's great.

 
Aug 22, 2007
Raking Leaves Script's author

Eoin: I just added support for The Guardian in version 0.2.1.

mat46: BBC News looks a little tough. I'll see what I can do, but I may not have time to add support soon.

 
Aug 20, 2007
Eoin Jones User

Great Script! Makes web reading of newspapers much more pleasant. I know most of the papers here are American, but I would love if you added support for guardian.co.uk. They have print friendly pages so I guess it wouldn't be that hard to port would it?

 
Jul 20, 2007
mat46 Scriptwright

Great script, I love it! I think BBC News would be a nice addition to the supported sites too - I took a quick try at adding it myself but couldn't quite figure it out... I'll let you know if I do get it working though.

 
Jul 6, 2007
Raking Leaves Script's author

The way the script gets around multi-page articles is through the printer-friendly view that many web sites provide, which puts all the text in one page. For sites that don't provide anything like a printer-friendly page, collecting all the text could be pretty complex. If someone writes some Greasemonkey code to do this text collecting for such a site, I'd consider integrating it.

You could comment on this script if you were logged in.