 			html += htmlFor(chunk: chunk)
 			html += "\n</section>\n"
 		}
-		html = escapeForJavascript(html)
-		let command = "document.getElementsByTagName('body')[0].innerHTML = '\(html)'; MathJax.Hub.Queue([\"Typeset\",MathJax.Hub]);"
-		outputView?.evaluateJavaScript(command, completionHandler: nil)
+		// if laoding the whole bod, might as well reload the whole page
+		load(html: "\(headerContents)\n\(html)\n\(footerContents)")
+//		html = escapeForJavascript(html)
+//		let command = "document.getElementsByTagName('body')[0].innerHTML = '\(html)'; MathJax.Hub.Queue([\"Typeset\",MathJax.Hub]);"
+//		outputView?.evaluateJavaScript(command, completionHandler: nil)
 	}
 	
 	private func htmlFor(chunk: RmdChunk) -> String {

			let footerUrl = Bundle.main.url(forResource: "customRmdFooter", withExtension: "html")
			else { return }
		do {
			let header = try String(contentsOf: headerUrl)
			let footer = try String(contentsOf: footerUrl)
			let nav = outputView?.loadHTMLString("\(header) \(footer)", baseURL: documentRoot)
			if let realNav = nav { emptyNavigations.insert(realNav) }
		} catch {
			fatalError("failed to load initial preview content: \(error)")
		}

//		tar.launch()
	}

	// MARK: - WebKit Delegate(s) methods
	
	func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
		if emptyNavigations.contains(navigation) {
			emptyNavigations.remove(navigation)
