13
$\begingroup$

Lot of answers here are excellent but there is no way to save it in LaTeX format. Even if we can put them in favorites or print them or save as pdf .

What about create a way to save answers in tex?

Also on meta : Save the answer in PDF? but this discussion is about saving to pdf, the best solution utilize https://stackedit.io/ but it only provides save to markdown, html, or pdf.

$\endgroup$
  • 2
    $\begingroup$ click the edit button, copy the source into a tex file, add you favorite preamble $\endgroup$ – Grigory M Jul 9 '14 at 10:53
  • 2
    $\begingroup$ Have to do this for every reply $\endgroup$ – athos Jul 9 '14 at 10:57
23
$\begingroup$

The comment "click the edit button, copy the source into a tex file, add you favorite preamble" is a slight oversimplification. Consider bold and italic fonts, quotes and spoilers, links and images, strikethrough and colors, bulleted and numbered lists, HTML entities (accented letters, etc), underscores and ampersands in text, and the fact that MathJax tolerates some things that LaTeX will not (e.g., $$ \begin{align} ... \end{align}$$).

But here is Save as LaTeX, anyway. Paste in the URL of any question (here or on another MathJax-enabled SE site, e.g., MathOverflow) and enjoy the result. Answers are ordered by votes. Inclusion of comments is optional. Images are converted into hyperlinks; you'd have to save them separately anyway.

Warning: this stuff is just something I made to learn regular expressions; it's still a work in progress. Please report bugs in comments. Yes, it parses HTML with regex... Sample output (taken from the script and ran through LaTeX compiler):

sample

$\endgroup$
  • $\begingroup$ Do I report errors here?(Nice name change btw) math.stackexchange.com/questions/906820/… "! Undefined control sequence. l.16 [\f =\1^2+\2^2+2\3^2]" Does it not take \def text? $\endgroup$ – Tony Aug 24 '14 at 0:33
  • $\begingroup$ @user151558 The problem is that TeX processors require definitions to be in topmatter (before \begin{document}), while MathJaX (for lack of topmatter) is okay with them being in a formula within the document. I'll try to come up with a way to extract definitions and put them where they belong. For now, the fix is to copy-paste the \def manually to the beginning of file, removing the surrounding \[\]. Compiles after that. $\endgroup$ – user147263 Aug 24 '14 at 0:40
  • $\begingroup$ A very very useful tool! Thank you so much! $\endgroup$ – Prism Nov 16 '14 at 4:43
  • $\begingroup$ The dropbox link doesn't seem to exist anymore $\endgroup$ – lucidbrot Jan 25 '18 at 7:18
  • $\begingroup$ @lucidbrot This link seems to be working now: normalhuman.github.io/savetex $\endgroup$ – Martin Sleziak Feb 2 at 11:31
  • $\begingroup$ Both dl.dropboxusercontent.com/u/29863189/mse/savetex.html and normalhuman.github.io/savetex don't work right now $\endgroup$ – JKHA Sep 4 at 9:44

You must log in to answer this question.

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