Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

LyX /

UserInterface

<< | Page list | >>

Customize Menus and Toolbar

1.  General information

LyX allows the configuration of menus and toolbar via .ui files. They are found in your system directory (in the ui folder). Generally, if you change something in the file, copy the file default.ui or classic.ui from your system directory to your user directory (create an ui folder, if it doesn't exist yet) and edit the file there.

Starting with LyX 1.4.0, several ui files are available. default.ui is what is used by default, classic.ui restores the menu structure which has been used prior to 1.4.0. Up to LyX 1.3.x, there was only one standard user interface file (default.ui).

To use an .ui file, set it in the menu Edit→Preferences→Look and feel→User interface and restart LyX to see the changes.

NOTE: DO NOT select the file stdtoolbars.ui or stdmenus.ui. These files are used by LyX internally; selecting them will result in a non-functional ui (see bug bug 2387).

2.  Using Multiple Toolbars

From 1.4.0 on, multiple toolbars are provided: the main toolbar, an extra toolbar, a math and a tabular toolbar, plus the minibuffer (which is actually not a toolbar, but treated similarly). Up to LyX 1.3.7, you cannot use multiple toolbars.

The toolbars can be enabled and disabled on the bottom of the file default.ui or classic.ui, respectively. Look for these lines:

Toolbars
        "standard" "on,top"
        "extra" "on,top"
        "table" "off,bottom"
        "math" "off,bottom"
        "minibuffer" "off,bottom"
End
You'll find a comment explaining which settings you can use. Amongst others, you can set the tabular and math toolbars to automatically appear only when the cursor is inside math or a table. You'd have to change it as follows:

Toolbars
        "standard" "on,top"
        "extra" "on,top"
        "table" "table,bottom"
        "math" "math,bottom"
        "minibuffer" "off,bottom"
End

3.  Modifying the toolbars

The toolbars are defined in default.ui (up to LyX 1.3.7) or stdtoolbars.ui (as of LyX 1.4.0) or stdtoolbars.inc (as of LyX 1.5.0).

The syntax is pretty straightforward:

Item "Tooltip" "lfun"

where "Tooltip" holds a short description of the action to be performed, and "lfun" is the command (LyXFunction) which is triggered when hitting the icon. See this page for a list of commands. The icon which is used has to reside in the images directory of your system directory or your user directory, and it has to be named exactly like the command. In your system directory, you'll find icons for quite a lot, but not all commands.

So, if you want to use an alternative icon, just put an alternative xpm-image (more recent versions of LyX use png image files) with the appropriate name in your user directory, and LyX will select that automatically.

If you want to remove an icon, just comment the according Item out by a preceding #.

If you want to add a new action, follow the above syntax. If no icon is found, LyX will display the tooltip text in the toolbar.

4.  Modifying the menus

The menus are defined in default.ui (up to LyX 1.3.7) or stdmenus.ui (as of LyX 1.4.0, provided that you are using default.ui).

The syntax is similar to the toolbar syntax, except that you can set a shortcut in the description part, after the |. Furthermore, you can classify different kind of menus like Submenu (embedded into a main menu), and optional Items (OptItem) that only are visible if certain (internally defined) conditions are true.

An example of a modified ui file can be found under Tips.ToplevelMathMenu

5.  Collection of toolbars

5.1  "Toolbar-Extension" for LyX 1.4.x

Screenshot and Download


5.2  Ekkehart Schlicht's toolbar for LyX 1.3 (legacy)

Screenshot and install instruction

Download

Toolbar, Customization, User_Interface

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2014-05-02 08:59 UTC