Especially a way that could preserve special LaTeX formatting?
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
At the moment, the easiest way is to download the data dumps. Getting the data out of that then becomes a problem (query on your user number for each site), but the easiest way to get ahold of the data, especially with all formatting intact, is to download the dumps.
You can also write a script using the API to do the same thing, but that's more work up front. However, you'll only get what you need, whereas the data dump gives you much more than you need. You can peruse the library of existing apps built on the API to help you get close to what you want.
There are many other ways to grab the data, but the engine actively resists robots and screen scrapers, so it's harder to get the data off the site using normal site grabbing tools.
The main issue is that it needs to be run for each Stack Exchange website you want to retrieve your questions+answers from, which can be pretty tedious to do. Also, the output is in CSV format.