In the following link you can find the following about ConversionRules
when exporting to HTML:
specifies mappings from Mathematica cell styles to HTML elements, including both inline and block-level versions of the markup
Lets define the following temporary function with the following conversion rules:
TempFunction[expr_] := ExportString[expr, "HTML",
"FullDocument" -> False,
"ConversionRules" -> {
"InlineMath" -> {
{"<inline>", Convert`TeX`BoxesToTeX[#] &, "</inline>"},
{"<block>", Convert`TeX`BoxesToTeX[#] &, "</block>"}
},
"Text" -> {
{"<inlineText>", "</inlineText>"},
{"<blockText>", "</BlockText>"}
},
"" -> {"", ""}
}
]
As the quote says, I have specified both the inline and block versions of the mapping. Now lets use it to see if they work as intended.
CASE 1:
Here we use a single block cell.
TempFunction[
Cell[BoxData[FormBox[RowBox[{"x", "=", "y"}], TraditionalForm]], "InlineMath"]
]
The output is:
<block>x=y</block>
CASE 2:
Here we use an inline cell.
TempFunction[
Cell[TextData[{"Let ",
Cell[BoxData[
FormBox[RowBox[{"x", " ", "=", " ", SuperscriptBox["y", "2"]}],
TraditionalForm]], "InlineMath", FormatType -> "TraditionalForm"], "."}], "Text"]
]
<blockText>Let <inline>x = y^2</inline>.</BlockText>
CASE 3:
TempFunction[
Cell[TextData[{"Let ",
Cell[BoxData[
FormBox[RowBox[{"x", " ", "=", " ", "y"}], TraditionalForm]],
"InlineMath", FormatType -> "TraditionalForm"], "."}], "Text"]
]
<blockText>Let <inline><em>x</em><em> </em><em>=</em><em> </em><em>y</em></inline>.</BlockText>
I was expecting this:
<blockText>Let <inline>x = y</inline>.</BlockText>
Is this a bug? What style is being surrounded by the tag em? Case 1 and Case 2 make sense, but Case 3 has me scratching my head. Can someone explain this behavior?