Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

a simple example Text Cell Style with a inline Cell (DisplayFormula)

Cell[TextData[{"inline mode ",Cell[BoxData[FormBox[RowBox[{"f", "(", "x", ")"}], TraditionalForm]], "DisplayFormula", FormatType->"TraditionalForm"], " "}], "Text"]

setting in Options DefaultNewInlineCellStyle is DisplayFormula.

If setting in Options DefaultNewInlineCellStyle is Text this would not happen.

I think someone would also encounter the situation: Converting between TraditinalForm and StandardForm sometimes auto-add or remove some ().

When copy as Latex, it's ok to compile in WinEdt(my tex compiler‘s access)

f \text{inline} \text{mode} x



but when save notebook as .tex, load in file f(x) becomes


The right should be


enter image description here

I asked on the TeX StackExchange site and got some comments"

I am not on the other site, but in your Mathematica set-up it does not make much sense to say that inline should be rendered as DisplayFormula. My guess is the converter used to output $…$ for inline math and $$…$$ for display. Now \(…\) is often to be preferred for inline, but the display equivalent is \[…\] not \(\(…\)\). – Andrew Swann

This is a good point.

DisplayFormula ==> $$
InlineFormula ==> $

This is MathJax.

However, maybe the same to \(.

As Silvia's former suggestion, I should just not use DisplayFormula in inline cells.

But I still need to check: would some other inline styles generate such double \(s?

share|improve this question
OT: WinEdt is an editor/IDE, not a TeX compiler. – Silvia May 27 '13 at 16:12
@Silvia yeah, you're right. If I use CCompiler in Mathematica, I would probably say: When I open Mathematica(my C Compiler)'s much simpler in my opinion,anyway I added an access in the post. – HyperGroups May 28 '13 at 2:36
I think you simply should not use DisplayFormula for inline formula.. Just like you should not use $$\int_a^b f(x)\,\mathrm{d}x$$ for inline formula in LaTeX. – Silvia May 28 '13 at 3:08
@Silvia en, seems the double (( ' problem is not because of DisplayFormula which really not so necessary. But I'm not sure about this question, I should take time to do more tries. – HyperGroups May 30 '13 at 3:10
@Silvia In the previous simple case, I now accept your suggestion not use DisplayFormula in inline cells. Though still need to keep the track of whether other styles would generate such double \(s – HyperGroups Jun 28 '13 at 13:05

When you Copy as LaTeX from the Edit menu, the assumption is that your highlighted expression is mathematics. The result is just the stuff that goes between the LaTeX delimiters. You're expected to place them between dollar signs or double dollar signs or whatever you want to use yourself.

Note that this is similar to the behavior of TeXForm:

TeXForm[Integrate[f[x], x]]

(* Out: \int f(x) \, dx *)

By contrast, Export to TeX generates an entire LaTeX document, which includes delimiters.

ExportString[Integrate[f[x], x], "TeX"]

(* Out:
%% AMS-LaTeX Created by Wolfram Mathematica 9.0 :

\usepackage{amsmath, amssymb, graphics, setspace}



\[\int f[x] \, dx\]


Finally, we can now see why the "inline" and the "mode" were included in LaTeX \text commands - because that's necessary to have the display as text inside the LaTeX delimiters that you are expected to provide.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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