Character style: lower-case and small caps at the same time

Hello,

I need help with LibreOffice 4.4 Writer:

How do I create a character style that first converts a word into lower-case letters and then into small caps? I need it for acronyms.

I have created a character format style for small caps, but have to convert capitals per hand into lower case letters, or else applying small caps doesn’t change anything (because it only converts lower case letters, not capitals, into small caps).

So for example right now I have to manually change every instance of NASA, FBI or USA into nasa, fbi and usa, and afterwards select my small caps style. I’d like to select the capitalized word and turn it into small caps through a character style.

Or, in other words: How do I apply two character styles at the same time?

Thanks

Use special features of Fonts Linux Libertine G and Linux Biolinum G.

In short: use Characterstyle with Font Linux Libertine G:smcp=1&c2sc=1

Docs : numbertext_linux

Karolus

This is my favorite answer. It’s not perfect, because it doesn’t work with every font, but I use Libertine and Biolinum, so it’s great for my purposes. Plus they are real small caps, so it looks really good.

I never knew what the “G” stood for—now I am learning about Graphite! Thank you very much.

(edited to change “any font” to “every font”)

Hi

You can record a macro that would do both operations (convert to lowercase and then apply your style “SmallCap”).

Assign the launch of the macro to a keyboard shortcut of your choice: Tools> Customize> Keyboard> Category: LibreOffice Macros.

To record a macro enable Tools> Options> LibreOffice> Advanced> Enable Macro recording

The generated code could be this (adapt with your name of style):

sub SmallCap

dim document   as object
dim dispatcher as object

document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

dispatcher.executeDispatch(document, ".uno:ChangeCaseToLower", "", 0, Array())

dim args3(1) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Template"
args3(0).Value = "SmallCap"
args3(1).Name = "Family"
args3(1).Value = 1

dispatcher.executeDispatch(document, ".uno:StyleApply", "", 0, args3())

end sub

That’s a very good idea and what I would do if I wouldn’t be able to use a Graphite font (see karolus’ answer); it’s just so much more elegant to simply choose a character style.

Thanks for a great answer!