A macro is an excellent idea. Let me see how I can do that.
Of cause you can write a "true" macro, but the needed operations are
also available by the macro recorder. So you can use that tool.
First you have to enable the macro recorder.
(1) Goto Tools > Options > LibreOffice > Advanced. Check "Enable
macro recording (limited)". OK
(2)Right click the formatting toolbar, click item "Visible buttons",
click on item "Line Spacing :2". Later you can deactivate it the
(3)Open such plain text document.
Now record your actions
(4)Tools > Macros > Record Macros. Notice, that you get a little
floating toolbar, where you later on can stop the recording.
(5)Crtl+A, to select the whole text
(6)Select a paragraph style from the drop down list, which has a
serif font as default, for example "Text Body" or "Default Style".
You should use a predefined style, so that it is always available.
(7)Click on the button "Line Spacing : 2".
(8)Click on right arrow key in the navigation block. That will
(9)Click on "Stop recording".
Next actions will save the macro to your user directory. You get a
dialog for organization of macros. The part My Macros > Standard >
Module should already be selected.
(10)In the field "Macro name" enter a name for the macro. This name
is later on used as default label for the button.
(11)Click on button "Save".
Now we generate an easy access to the macro using a button.
(12) Right click the formatting toolbar, click item "Customize
Toolbar". In the "Command" list click on that item, which you want
to be left of the new button, click button "Add.."
(13) In the "Category" list scroll down to the end. Open the +
"LibreOffice Macros", "My Macros", "Standard", and "Module".
(14) Now you should see your macros' name in the list "Commands".
Click on it. Click button "Add". Click button "Close".
(15) Look whether the macro name is at the desired position; you can
move it up or down with the arrow buttons. To use a different label
click button "Modify" and then item "Rename". At last click OK.
(16) Close your document without saving the changes.
Test your macro.
(17) Open a plain text document.
(18) Click on the new macro button.
Does it work?
Alternative/ In addition you can assign a shortcut to the macro.
(19) Tools > Customize > Keyboard
(20)~(13) In the "Category" list scroll down to the end. Open the +
"LibreOffice Macros", "user", "Standard", and "Module".
(21)~(14) Now you should see your macros' name in the list
"Function". Click on it.
(22) In the "Shortcut keys" list click on the desired shortcut, and
then on button "Modify". OK.
If you are curious, how the macro looks like: Tools > Macros >
Organize Macros > LibreOffice Basic. Select your macro and click on
To unsubscribe e-mail to: firstname.lastname@example.org
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Impressum (Legal Info)
: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (MPLv2
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our trademark policy