Ask Your Question

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

asked 2015-03-08 02:49:04 +0200

jaihanuman gravatar image


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?


edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2015-03-08 08:57:23 +0200

karolus gravatar image

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


edit flag offensive delete link more


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")

jaihanuman gravatar imagejaihanuman ( 2015-03-09 03:26:05 +0200 )edit

answered 2015-03-08 08:13:21 +0200

pierre-yves samyn gravatar image


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("")

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

dim args3(1) as new
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
edit flag offensive delete link more


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!

jaihanuman gravatar imagejaihanuman ( 2015-03-09 03:35:46 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-03-08 02:49:04 +0200

Seen: 1,089 times

Last updated: Mar 08 '15