0

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?

  • 1
    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
1

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).

What you want requires special parsing (reading of text and doing something based on , which is not possible, as far as I know, with regular macros.

  • Did I answer your question? If so, please don't forget to accept my answer. :) – Gal Grünfeld May 18 '17 at 21:50

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.