# Fraction macro in lyx

I want to create a macro for word-like fraction sign in lyx. Namely, when I write 1/2 I want it to be \frac{1}{2}

Any Ideas?

• And if you write 13/5 it should be \frac{13}{5} or 1\frac{3}{5}? Or something else? – Przemysław Scherwentke Aug 24 '15 at 18:46
• I guess \frac{13}{5} – omerbp Aug 24 '15 at 18:47
• So what about \sin1/2? (I want to show you potential problems). – Przemysław Scherwentke Aug 24 '15 at 18:57
• that should be \frac{\sin1}{2}.I know it does not cover all the cases in the world, but I find it much easier to use this method. – omerbp Aug 24 '15 at 19:21

You can do it even more easily - create a macro of \frac{#1}{#2} and then you could just press Tab to move between the two arguments (#1, #2).