This does not mimic the markup features provided by Stack Exchange, but if you use this template in a file with a ".html" extension, and replace the body, then drag the file to your browser, you should see the MathJax rendered.
<html>
<head>
<title>MathJax</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"] },
tex2jax: { inlineMath: [ ["$", "$"], ["\\\\(","\\\\)"] ], displayMath: [ ["$$","$$"], ["\\[", "\\]"] ], processEscapes: true, ignoreClass: "tex2jax_ignore|dno" },
TeX: { noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } } },
messageStyle: "none"
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML"></script>
</head>
<body>
The definition of the Euler-Mascheroni constant is
$$\gamma=\lim_{n\to\infty}\left(\sum_{k=1}^n\frac1k\right)-\frac1n$$
</body>
</html>
I use this method with the Markup > Preview in BBEdit
feature of BBEdit to get live updating.
Caveat: I may have misinterpreted "offline". To use the template above, you need to be online so that you can access the server at cdn.mathjax.org
, but you can work on MathJax away from MSE. To use MathJax offline, you can download the local version of MathJax as described here. Otherwise, you can get a standalone LaTeX system, many of which are listed here.