Ask Your Question
2

Small Capitals shortcut or icon [closed]

asked 2013-08-25 20:33:29 +0200

Eduardo Villegas gravatar image

In Writer there is a character format style called Small Capitals, which some of us employ constantly, for instance, to render a better view of roman numerals like in centuries. So, I wonder if there is a shortcut I can use, or even an icon I can put in the toolbar.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-25 00:18:55.119061

2 Answers

Sort by » oldest newest most voted
4

answered 2013-08-25 23:37:53 +0200

David gravatar image

You can do this with a macro. I think you need to do this with a macro, in fact, because I can't see where this feature can be found in the Tools > Customise... options. If you haven't recorded a macro with LibO before, you might need some help to find out how, and that link should point in the right direction.

Meanwhile, I tried this myself, and here's what I came up with: first, recorded the macro; then, assigned it to the toolbar. If you want to see if my macro does the job for you, try this (it should only take about five minutes):

1. Set up macro

  1. Click on Tools > Macros > Organise macros > LibreOffice Basic... (a new window opens).
  2. In the left-hand box, you should see "[+] My Macros". Open that up by clicking on the "plus" sign to get "[+] Standard", open it and see "Module 1", now click on it. You should now see "Main" listed in the right-hand box, "Existing macros in: Module 1".
  3. Click on "Main" in the right-hand box, and now the "Edit" button to the right of it. A new window opens, and in the main text area, you should see "Sub Main" followed a blank line later by "End Sub". Good.
  4. Now we need to get the LO Basic code -- the macro itself -- to paste in below that "End Sub" line. I have saved this as a "gist" on Gitub, but go to the raw version, hit CTRL-A to select all, then CTRL-C to copy to clipboard.
  5. Return to the LibreOffice Macro editor, position your cursor under the "End Sub" line, then hit CTRL-V to paste it in. Press CTRL-S to save it.
  6. Close the Macro editor.

Now when you go to Tools > Macros > Organise macros > LibreOffice Basic... (and My Macros > Standard > Module 1) again, you will see SmallCapsStart and SmallCapsStop listed below Main (along with any other macros you might already have made). Good. It worked!

2. Assign to Toolbar

  1. Go to Tools > Customise..., then choose the "Toolbars" tab in the new dialog that opens.
  2. Choose which toolbar you want these to appear in: to me, it makes most sense to include it with the "Formatting" options, so find that one on the Toolbar drop-down.
  3. Click the "Add..." button on the right, go to the bottom of the list on the left, "LibreOffice Macros", and click it so that ...
(more)
edit flag offensive delete link more

Comments

1

Great guide. You should also be able to create a new character style (e.g., "Small capitals") that either has the required Font effect enabled or uses the graphite feature (e.g., Linux Libertine G:c2sc or Linux Libertine G:smcp for upper-case or lower-case respectively). This style will then show up under Tools > Customize > Keyboard > Category of "Styles|Character" for assigning to a key combination.

oweng gravatar imageoweng ( 2013-08-26 03:03:33 +0200 )edit

This macro works as intended. I didn't know the font you mentioned, but it looks great: already installed it (from Ubuntu repos) and trying for my documents. Thanks for your time.

Eduardo Villegas gravatar imageEduardo Villegas ( 2013-08-26 03:08:00 +0200 )edit

@oweng = I considered the character style approach, but wasn't sure if it specified too much (e.g., font-family, size, etc.) and thought the macro was more "agnostic". But if the use case meant those factors were defined and stable, then the style approach would certainly be faster/easier to implement.

David gravatar imageDavid ( 2013-08-26 08:38:04 +0200 )edit

It's a pity this isn't implemented in the software itself (so you can have one single key combination that toggles this, like for italics or bold), but barring that this is a great solution. Thanks for taking the trouble.

Frank Lekens gravatar imageFrank Lekens ( 2014-08-22 21:52:21 +0200 )edit
2

answered 2014-06-09 14:10:23 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Apart from the great answer @David gave, there is a nice quick and dirty how-to from Brian

http://permalink.gmane.org/gmane.comp...

Short description:

  • format a word as small caps
  • mark it and define a new character style
  • use "Fill Format Mode" button and simply click on every word or sentence

In my eyes very nice for just a few words to be renamed.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-08-25 20:33:29 +0200

Seen: 5,444 times

Last updated: Jun 09 '14