[Tex/LaTex] About some shortcuts used in LyX

lyx

Please tell me how to use shortcuts in LyX to implement the codes below

$\sum\limits_{\substack{0<k<p\\\gcd\left(  k,p\right)  =1}}$

Notice that do not use the function of inserting TeX code in LyX!

By the way, it is very easily implemented in Scientific Workplace.

Just like that

  1. Ctrl+sum

  2. Ctrl+F5

  3. TAB

  4. ENTER

  5. Ctrl+l

  6. 0<k<p

  7. ENTER

  8. gcd(k,p)=1

That's all!

The primary difficulty in LyX is that the Step 8 can not be easily implemented, so I ask the question here.

Wait for your elegant solution…

Best Answer

I'm not that familiar with LyX, but I think you have to add three new shortcuts to be able to add all of that using keyboard shortcuts only. If you do not know how to do this, see my answer to Shortcuts for Lemma, Claim, Theorem etc.

I added keyboard shortcuts for \substack, \gcd and \left( \right). The LyX functions (and keyboard shortcuts) I used were as follows. You can of course choose whichever keyboard shortcut that suits you and doesn't conflict with existing ones.

  • math-insert \substack

    Ctrl+Alt+Shift+0

  • math-insert \gcd

    Ctrl+Alt+Shift+G

  • math-insert \left( \right)

    Ctrl+Alt+Shift+P

The sequence for inputting your example will then be as follows, assuming you are in math mode:

  1. Alt+MU - enters summation sign
  2. Alt+MX - adds subscript
  3. Alt+ML - adds \limits
  4. Ctrl+Alt+Shift+0 - see above, begins a \substack.
  5. 0<k<p
  6. Ctrl+Enter - starts a new line in the substack ...
  7. - ... but doesn't move the cursor it seems.
  8. Ctrl+Alt+Shift+G - see above, enters \gcd
  9. Ctrl+Alt+Shift+P - see above, enters \left( \right)

    (these two can be done as one, hold down the modifiers and hit G followed by P)

  10. k,p
  11. = 1