3
$\begingroup$

I am (mis)using Mathematica as a WYSIWYG LaTex editor. I want to put a (long) tilde over an expression.

DisplayForm[OverscriptBox[a + b, "_"]]
DisplayForm[OverscriptBox[a + b, "~"]]

This Is how it looks:

overtilde

(Of course I'm using cntrl-7 to type in the above)

I want that the tilde stretched out over the whole expression, not just a small tilde in the middle. Just the same as with the underscore.

The corresponding LaTex expressions are

\overline{a+b}
\widetilde{a+b}

And the same issue with "^" and \widehat

I know I can mark the tilde (or hat) and use Command-"+" to increase the font size, but that doesn't look right.

Ideally, it would be something that exports easily to the mentioned Latex commands.

By the way,

FullForm[ToExpression["\\widetilde{a+b}", TeXForm]]

results in

OverTilde[Plus[a, b]]

which looks just like the above (tilde only above "+", not whole).

version: Mathematica 11.0

Edit/Clarification

I am well aware that this is not an issue with LaTeX itself, and that other, better working LaTeX editors exist. I want to continue writing Mathematica notebooks having parts which look like theorems or proofs look in math text books, referring to that look loosely as "LaTeX" (parts of which might later be exported for publication), and this question is about how to make those parts look right. So don't suggest any alternative LaTeX editors, that's not what the question is about.

$\endgroup$
  • 3
    $\begingroup$ My guess would be that there is currently no good way to do it, that OverTilde[something] is supposed to (=planned to by later Mathematica version) look like LaTeX's widetilde, and that this will be accomplished in a later version by there being a new special "widetilde" character, which will be a "strechable" tilde. I think that, because with \[OverBrace] (esc-o{-esc), it works just as it does with "_", and as one would wish for with "~", and [OverBrace] is just another special character. $\endgroup$ – mathheadinclouds Jun 15 at 21:26
  • $\begingroup$ yes, a new extensible character is what you want, but I don't know of any way to make new characters (extensible or not). Code for a palette of Mathematica's extensible brackets etc. can be found in the answers to this question $\endgroup$ – Andrew Norton Jul 9 at 3:22
0
$\begingroup$

$\widetilde{a+b}$

Maybe MMa's TeXForm doesn't do it properly, but it seems to work in MathJax. Or am I not understanding the question.

$\endgroup$
  • $\begingroup$ I want to use the Mathematica front end as a WYSIWYG editor, and there is no MathJax in the Mathematica front end, so that doesn't help in any way. Or am I not understanding the answer. $\endgroup$ – mathheadinclouds Jun 16 at 1:00
  • $\begingroup$ Misunderstood. I though LATEX was your goal. If MMa is required, can't help. $\endgroup$ – Bill Watts Jun 16 at 6:32
  • $\begingroup$ well, this is the Mathematica forum, not the LaTeX forum. Honestly, I would delete the answer to avoid downvotes. $\endgroup$ – mathheadinclouds Jun 16 at 7:20
  • $\begingroup$ I am way too old to worry about downvotes. The ultimate result was to be in LaTeX, and I worked it that way. Anyone who thinks my answer is worthless can downvote it all they want. $\endgroup$ – Bill Watts Jun 16 at 7:39
  • $\begingroup$ @mathheadinclouds The title of the question makes it appear that you're looking either for a LaTeX command or a way to generate a LaTeX command from Mathematica. It's easy to misunderstand what you want. $\endgroup$ – Szabolcs Jun 16 at 8:47

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.