On 09/21/2009 10:27 AM, silvio grosso wrote:
Hello everybody,

I am sorry for asking such a trivial question so bear with me :-)
In essence, I would like to know why there are not two buttons, in the Lyx 
interface, to underline or bold a text.

Don't get me wrong.
I know you can perform these two options easily with Lyx :-)
Actually, there are really plenty of ways to do so.
For instance, my "preferite" way (because it is fast) is to press ctr+b (to 
bold) and ctr+u (to underline).
However, in my opinion, it is a bit "strange" to have a button in the Lyx's 
interface which allows to emphasize a text.
I am referring to the one with the big E on it (its shortcut is ctr+e).
On the other hand, there are not the two buttons needed to bold or underline.
I suppose there is a reason for it?

I don't know for sure why the buttons aren't there, but I think the reason is the same as the reason that there isn't a button for italics. Now you might say, yes, there is! But there isn't. Emphasis isn't italics, as you will find it you do this:
    This is <emph>really <emph>emphatic</emph></emph>
In most document classes, "really" will be italicized and "emphatic" will be upright.

Emphasis is semantic. It means something. So does "noun", for which there is also a button. The others are not. LyX discourages their use; hence the lack of a button. Of course, you could also have something equivalent to HTML's <strong> tag, which defaults in most browsers to boldface, and the Logical Markup module defines such a thing. But at present there's no way for modules to add things to the toolbars. Such a button would have to be added independently.

This is not very hard to do. The safest way is to copy the file stdtoolbars.inc from LyX's resource directories (normally, this would be /usr/share/lyx/ui/ on Linux) to your local LyX directory ($HOME/.lyx/ui/, on Linux) and then modify it as follows.

Around line 85, you will see this:
        Item "Toggle emphasis" "font-emph"
        Item "Toggle noun" "font-noun"
Add this:
        Item "Toggle bold" "font-bold"
if you just want bold or
        Item "Toggle strong" "flex-insert CharStyle:strong"
for strong. Then you have to add the button file itself (to $HOME/.lyx/images/, on Linux). This should be a 20x20 PNG named the same (more or less) as the LFUN you are calling. As it happens, there seems already to be a font-bold.png; you could just copy this to flex-insert_CharStyle:strong.png for the latter case.

Richard

Reply via email to