How to make a shortcut for \mathbb font in LyX?

New shortcuts are added under Tools --> Preferences --> Editing --> Shortcuts, for details see Shortcuts for Lemma, Claim, Theorem etc. The function you need for the blackboard font is

math-insert \mathbb

The other fonts in the list (under the font button on the math toolbar) has similar functions, just replace \mathbb with the appropriate macro, e.g. math-insert \mathcal.


Alternatively, you could go to [User]/AppData/Roaming/LyX[version]/bind (on Mac or Linux the path would differ), open user.bind with a text editor and insert the following line:

\bind "M-k b" "command-sequence math-insert `\\mathbb`;"

Which would insert a \\mathbb environment on pressing alt+k b.

You could also use

\bind "M-k r" "command-sequence math-insert \\mathbb R; char-right"
\bind "M-k z" "command-sequence math-insert \\mathbb Z; char-right"

Which would insert \\mathbb{R} and \\mathbb{Z}, respectively, and move your pointer out of \\mathbb environment.

Tags:

Lyx

Math Mode