Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Am 16.04.2012 22:36, Séamas Ó Brógáin wrote:
Regina wrote:

They are usually written via AutoCorrect. The simple hyphen is replaced
with the en-dash or em-dash when the following word is finished . . .

That is _not_ a good idea. The hyphen, en rule and em rule (dash) are
distinct characters with distinct uses in conventional typography and
typesetting. Their correct use cannot be predicted by context, nor are
they interchangeable.


There is AutoCorrect, there is AutoText (F3 and Ctrl+F3) and there is a most simple macro:
REM  *****  BASIC  *****
sub Insert_Em_Dash()
REM the quoted string is one em-dash
insertChar "—"

REM same with decimal:
' insertChar Chr(8212)

REM same with a hex number:
'insertChar Chr(cInt("&H2014"))
end sub

sub Insert_En_Dash()
insertChar Chr(cInt("&H2013"))
end sub

sub Insert_Figure_Dash()
insertChar Chr(cInt("&H2012"))
end sub

sub insertChar(s$)
dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Text"
args1(0).Value = s
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args1())
end sub


--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: 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.