5
$\begingroup$

I want to make a nice printout of an awesome answer with lots of pictures and pretty equations. If I select the answer and use the print feature in the browser then the formatting is lost (paragraphs are too wide) and the equations don't show properly.

I want to turn this (select answer text and print)

enter image description here

into this (properly rendered answer)

enter image description here

I propose each answer (or question) has a link to a printable page.

Edit 1

Use this answer for example.

$\endgroup$
6
  • 5
    $\begingroup$ stackprinter.com is better than just the print feature on my browser, but as a feature request this probably belongs on the mother meta. $\endgroup$ Jun 14, 2017 at 14:34
  • $\begingroup$ Most other sites don't have MathJAX to deal with while rendering/printing $\endgroup$ Jun 14, 2017 at 15:09
  • $\begingroup$ But there are quite a handful that do, so the problem is far from unique to physics. $\endgroup$ Jun 14, 2017 at 15:11
  • $\begingroup$ I tried stackprinter and it does not separate out the answers (to focus on one answer, or keep them on new pages). So the answer I am interested in is split between two pages. Also the UI to get to the right SE site and find the ID is rather clunky. Why couldn't they just accept a full URL as produced by the [share] button. I digress. $\endgroup$ Jun 14, 2017 at 15:18
  • 2
    $\begingroup$ ja72 is right: The stackprinter.com page only prints entire threads, not individual answers. $\endgroup$
    – Qmechanic Mod
    Jun 14, 2017 at 18:32
  • $\begingroup$ I get decent (not perfect) results on a sample post by running the Markdown source through pandoc to convert it to LaTeX, adding the necessary boilerplate, and compiling to PDF. That could probably be generalized. $\endgroup$
    – David Z
    Jun 14, 2017 at 19:57

2 Answers 2

2
$\begingroup$

If you like the way that the printout of the entire page looks, but you want only one answer to print, try this:

In Firefox on Windows:

  1. Open the menu item Tools > Web Developer > Style Editor. (The style editor is part of the "inspector" and there are a couple of ways to get to it.)

  2. This is the CSS for the page. Add, somewhere outside of any other block (I went to the end), two lines like these:

    .question, .answer { display:none; }
    #answer-80449 { display: block; } 
    

    When you add the first line, all the questions and answers (which live within HTML containers like <div class="question"> etc.) will disappear; when you add the second, any code contained in <div id="answer-XXX"> will reappear. The phone number is the post ID, which you can extract from the "share" link (or confirm by viewing the source).

  3. Your printed view should match what's on the screen.

Now my Firefox seems to be having this problem, but since the answer in your example fits on a single page I haven't attempted to fix it.

I'm sure this feature is available in other browsers. The tricky part is figuring out where to add the CSS; the code that you add should be the same.

I see in your comments that you're probably not thrilled about this sort of "clunky interface," but this is the sort of thing that's probably pretty easy for someone to turn into a browser extension.

$\endgroup$
2
  • $\begingroup$ I edited the question pointing to an answer which should fall over a page break. $\endgroup$ Jun 15, 2017 at 13:59
  • $\begingroup$ @ja72 Darn -- I'm not sure how to fix that issue. $\endgroup$
    – rob Mod
    Jun 15, 2017 at 14:06
1
$\begingroup$

This could be a nice suggestion for mother Meta. In the meantime, I want to point out that if you right-click anywhere on the page, and select Print..., then you can (at least on my browser) choose PDF as the destination. The result usually looks nice: enter image description here

I'm not sure if this is what you had in mind.

An alternative is to click on the edit button of the answer you want to print, copy the source code, paste into a Latex document, and compile it yourself.

$\endgroup$
5
  • $\begingroup$ For me it prints the entire page which includes: question, all answers, links and other extraneous information. I think that the ability to print a single answer (with possibility of including the question for context) would be great. $\endgroup$ Jun 14, 2017 at 15:08
  • $\begingroup$ @ja72 I agree. For now, I think your best option is to print as a pdf, and then crop the important parts. Not ideal, but it kinda works. $\endgroup$ Jun 14, 2017 at 15:10
  • $\begingroup$ It sucks when the answer I want to focus on is split across pages. Besides most people don't have good pdf edit tools. $\endgroup$ Jun 14, 2017 at 15:11
  • $\begingroup$ @ja72 hmm to avoid the splitting, you could perhaps sort by "activity" instead of "votes"? that does fix it? $\endgroup$ Jun 14, 2017 at 15:22
  • $\begingroup$ It's unfortunate that there's no "Current view" in print options (at least on Chrome). Generally that would be my go-to solution for that; but apparently that feature is mostly in PDF viewers, not all printing. $\endgroup$
    – JMac
    Jun 14, 2017 at 16:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .