# How to print a Cross Validated question or answer?

While I respect, laud and enjoy Cross Validated questions' and answers' palimpsest-like qualities of being a dynamic and living documents, I have a need to print (or save to PDF) a static snapshot of some questions and answers. My browser and/or operating system's default printing behavior do not seem to be playing well with Mathjax.

Is there a utility for printing a CV question or answer or saving it as a PDF?

• If this is limited to few QAs, why not copying/pasting Markdown source and compiling it with, e.g., Pandoc?
– chl
Sep 28 '14 at 19:24
• That would miss comment chains. But that's a useful link. Thank you. Sep 28 '14 at 19:32
• Hmm... Pandoc also misses graphics... Sep 28 '14 at 19:48
• You can grab images from i.imgur.com (as I did long ago, although I used ConTeXt rather than Pandoc).
– chl
Sep 28 '14 at 19:54
• That's a bit opaque. Do you mean I can download images from a CV entry. Create an imagur account. Upload them. Copy the markdown to Pandoc, edit it to reference imagur URLs for the images and the compile the answer in LaTeX which I can then render into a PDF? 'Cause that's starting to sound like a job description, rather than what should be a simple task. :) Sep 28 '14 at 20:17
• I have had reasonable success using Chrome's built-in printing function for this. One option through that interface, even on Windows, should be to save as a PDF. Sep 28 '14 at 20:41
• You can always just save a webpage as an HTML file & store it in a folder for off-line viewing. I don't know about printing to hardcopy, but that will certainly save everything for you. Sep 28 '14 at 23:46
• @gung HTML does not help in that it is not in print form, nor in pdf form. :) Sep 29 '14 at 3:40
• @Alexis No, if you are familiar with Unix shell scripting, you can just write a little script that will extract URLs from any Markdown file and grab them directly from i.imgur.com in a dedicated folder. Otherwise, I believe ConTeXt, and probably some dedicated LaTeX packages, will allow you to write plain URLs in your document and images will be fetched during first compilation. I'm pretty sure this could be done with knitr as well.
– chl
Sep 29 '14 at 7:06
• There are command line tools to print the page directly as well. I've played around with wkhtmltopdf before. Here is an example pdf with all of the defaults. The text is searchable and the links are saved. The math is printed as images, but it is a fairly high resolution so zooming in one can see the math pretty easily. There is a switch to prevent printing of the background image, which I presume would reduce the size of the PDF substantially. Sep 29 '14 at 12:01
• @chl I appreciate your efforts, but as I wrote you are not providing a persuasive solution (i.e. use this one tool, or perform this one action), rather you are creating a work flow. The credible answer to my question (until I explore Andy W's solution) seems to be more along the lines "No. There are a set of clumsy work-arounds." Sep 29 '14 at 15:30

## 1 Answer

You can use StackPrinter. It formats a given question, with answers and comments, into printer-friendly form, which can be saved as PDF or printed directly. The StackPrinter Bookmarklet allows this to be done directly from the question page.

• Ehr Mah Gherd! That totes works! Works well. If one is using NoScript one has to remember to permit StackPrinter, otherwise the MathJax does not render, but it is very nicely laid out otherwise. Sep 30 '14 at 0:26
• You can optionally disable comments if you want, appending &comments=false in querystring. Check this Api help. Sep 30 '14 at 17:25