7

I want to create a shortcut in LyX for changing the color of selected text.

I tried to create a shortcut for "set-color green" or "set-color green green", but none of these worked.

What is the magic word?

1 Answer 1

11

Highlight the text and for green use

textstyle-update color 4

For a general approach for how to figure out the correct command, see http://tex.stackexchange.com/questions/208510/lyx-commands-to-insert-wysiwyg-horizontal-line-for-keyboard-shortcut/208531#208531

4
  • "4" seems to be brown? Where can I find the list of numbers corresponding to the colors?
    – user255783
    Dec 22, 2022 at 6:19
  • For dummies like myself, to create a new shortcut (at least in LyX 2.3.6.1): Go to Tools > Preferences > Editing > Shortcuts > Click "New"
    – user255783
    Dec 22, 2022 at 6:24
  • 1
    OK I tried and for LyX 2.3.6.1, it seems to be 1 = Black, 2 = White, 3 = Blue, 4 = Brown, 5 = Cyan, 6 = Darkgray, 7 = Gray, 8 = Green, 9 = Lightgray, 10 = Lime, 11 = Magenta, 12 = Olive, 13 = Orange, 14 = Pink, 15 = Purple, 16 = Red, 17 = Teal, 18 = Violet, 19 = Yellow , 20 = Cursor, 21 = Background, 22 = Text, 23 = Selection, 24 = Selected Text, 25 = LaTeX Text, 26 = Previewed Snippet, 27 = Inline Completion, 28 = Non-Unique Inline Completion, 29 = Note Label, 30 = Note Background, etc.
    – user255783
    Dec 22, 2022 at 6:35
  • you, sir, are a fine gentleman, @user24096
    – daydreamer
    Mar 21, 2023 at 0:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .