2

I am having really hard time to figure out how to adjust the length of \leadsto arrow in order to match the text above it. The command I am using is

   \newcommand{\transitb}[1]{\stackrel{#1}{\leadsto}_{\pi\gamma}}

and here is the output I get:

enter image description here

I found this as an answer: leadsto with text but I don't want to mess my equation with some tikz stuff.

Is there a simple way to do what I am looking for?

EDIT:

Here is the output I get when I try this How do I put text over a squiggly arrow? enter image description here

EDIT2

When Trying to use it in beamer within definition block I go the following error:

 Missing $ inserted

Any thoughts on what could cause this error.

Mr. D
  • 397
  • 4
    Maybe this way? http://tex.stackexchange.com/questions/75669/how-do-i-put-text-over-a-squiggly-arrow – Steven B. Segletes Feb 24 '16 at 14:55
  • I am trying it but I get errors on compilation – Mr. D Feb 24 '16 at 15:06
  • It is not working I got the output shown in the EDIT. – Mr. D Feb 24 '16 at 15:13
  • I am not sure why it wouldn't work. However, I will note that, for that MWE, I set both \textwidth and \parskip, neither of which have anything to do with the operation of the solution. Their change, however, could wreak havoc with your document, if you tried to copy/paste my result into your document. So you would want to remove those settings. – Steven B. Segletes Feb 24 '16 at 15:15
  • I removed the \textwidth and \parskip setting. Adding them back does not change a thing – Mr. D Feb 24 '16 at 15:16
  • I found that adding amsmath causes the behavior you observe. I will work to fix that. – Steven B. Segletes Feb 24 '16 at 15:33
  • Please see revised answer at http://tex.stackexchange.com/questions/75669/how-do-i-put-text-over-a-squiggly-arrow, which I hope can suit your needs. – Steven B. Segletes Feb 24 '16 at 15:50
  • 1
    Worked like magic! – Mr. D Feb 24 '16 at 16:21
  • I just provided an additional answer there that uses different glyphs for the squiggles and solid arrow heads. You might have a look. – Steven B. Segletes Feb 24 '16 at 16:26
  • @StevenB.Segletes I am having errors when I try to use it in definition block in beamer!! Error says missing $. Any thoughts on it? – Mr. D Mar 03 '16 at 10:18
  • One thought is stackengine, by default, stacks text, not math. In the cited MWE, I issued a \stackMath in the preamble to tell stackengine to stack math, not text, by default. If your application stacks both math and text at different points in the document, one can keep the text stacking as the default, and employ \ensurestackMath{...} as needed. – Steven B. Segletes Mar 03 '16 at 10:49

0 Answers0