5
$\begingroup$

When I' m testing on this post' s method

I found some problems.

Export["test.html", nb = EvaluationNotebook[], "HTML",  
    "ConversionRules" -> {"Input" -> {"<pre><code>", DisplayForm[#] &, "/code>/pre>"}},
    CharacterEncoding -> "CP936", "CSS" -> None]


Export["test.html", nb = EvaluationNotebook[], "HTML",  
     "ConversionRules" -> {"Input" -> {"<pre><code>", InputForm[#] &, "</code>/pre>"}},  
     CharacterEncoding -> "CP936", "CSS" -> None]

enter image description here

How can I keep the Codes completely the same as that in the Notebook?

Are there any easy ways to do that? For example, change the DisplayFormula[#]& into something else that I don't know?

$\endgroup$
5
$\begingroup$

This thing could be done by the option "MathOutput"->"InputForm", However I'm not sure whether this can entirely solve the question(need more tests).

Export["test.html", nb = EvaluationNotebook[], "HTML",  
       "ConversionRules" -> {"Input" -> {"<pre><code>", "</code></pre>"}}, 
       CharacterEncoding -> "CP936", "CSS" -> None,"MathOutput"->"InputForm"]

enter image description here

Merge two Input Cell(Or type by Enter, there is a "\n" in the cell Expression), and follow the method in the above then still generate images in the HTML files. (How to make this Input Cell become text in the html files?)

enter image description here

$\endgroup$
  • $\begingroup$ I have resized last image, feel free to undo this if you like. $\endgroup$ – Kuba Aug 23 '13 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.