[Solved] Add special character to favorite characters

Discuss the word processor

[Solved] Add special character to favorite characters

Postby MilosDj » Fri Sep 18, 2020 10:31 am

I am using LibreOffice 7.0. Writer.
In "Insert Special Character" I want to add ∀ ∃ ∧ ∨ ⇒ ⤃ ⇔ ⤄ as favorites.
Its not working. Why? Is it a bug or I am doing something wrong?

If I try to put hex or decimal values manually I see "Missing character" message.
Is there a way to put those and similar characters to favorites? :crazy:
Last edited by MilosDj on Fri Sep 18, 2020 12:40 pm, edited 1 time in total.
LibreOffice 7.0.0.3 on Windows 10
MilosDj
 
Posts: 5
Joined: Fri Sep 18, 2020 10:24 am

Re: How to add special character to favorite characters?

Postby RoryOF » Fri Sep 18, 2020 12:17 pm

I do not think one can add personal special characters to the /insert /Special characters option. It is my understanding that this option shows the characters available in a particular font/character set. Change its font selection (selector top left of the Special Characters window) and choose a font that has the desired characters, changing the subset to "Mathematical operators" (righthand selector) to avoid having to scroll through the entire set of characters.

A quick test on my system (details as in my .sig) shows that the characters you require are in Mathjax_Main font. No doubt there is a font on Windows or available for Windows, that offers such characters.
Apache OpenOffice 4.1.7 on Xubuntu 20.04.1 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 31540
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to add special character to favorite characters?

Postby MilosDj » Fri Sep 18, 2020 12:39 pm

Well I am surprised. Normal copy paste of any symbol ∀ ∃ ∧ ∨ ⇒ ⤃ ⇔ ⤄ works independent of the selected font in the document.

But it seems that you are right. Choosing OpenSymbol fonts did enable adding those symbols to Special characters. Although inserted symbol is OpenSymbol font type not original doc font.

I stumbled on another potential solution using autocorrect. Mapping \forall \exist \and \or \... to corresponding symbol also works. And corrected font type is original font type from document!?!

I am puzzled how this works, but thanks. Now I have two working solutions.

Thanks :)
LibreOffice 7.0.0.3 on Windows 10
MilosDj
 
Posts: 5
Joined: Fri Sep 18, 2020 10:24 am

Re: [Solved] Add special character to favorite characters

Postby JeJe » Fri Sep 18, 2020 5:23 pm

A simple macro can show a popup menu with these characters to choose from. See attached document (macros will have to be enabled for it).

You don't need to understand the code to use it. To run it outside that document, you'd have to copy and paste it to somewhere like your MyMacros/Standard Library and then set a keyboard shortcut or toolbar button to run the sub SpecialCharactersPopup.

Code: Select all   Expand viewCollapse view

Sub SpecialCharactersPopup
st ="1 ∀*2 ∃*3 ∧*4 ∨*5 ⇒*6 ⤃*7 ⇔*8 ⤄"
res = showpopup3(thiscomponent.currentcontroller.frame.componentwindow,st,0,0)
if res<> "" then
vc =  thiscomponent.currentcontroller.viewcursor
vc.string = right(res,1)
vc.collapsetoend
end if
End Sub

function showpopup3(window,st as string,x,y) as string 'helper function to show a popup menu
   'split by *
   'separator_
   'note ~ identifies accelerator
   dim sts() as string,c as long

   aRect = CreateUnoStruct("com.sun.star.awt.Rectangle")
   arect.x = x
   arect.y =y

   oPopup = CreateUnoService("stardiv.vcl.PopupMenu")'"com.sun.star.awt.PopupMenu")

   sts = split(st,"*")

   for i = 0 to ubound(sts)
      c =c+1
      if sts(i) ="_" then
         oPopup.insertSeparator(c)
      else

         if mid(sts(i),1,1) ="!" then isdefault = true else isdefault = false

         if isdefault then
            mid(sts(i),1,1) =""
            oPopup.insertItem(c, sts(i),0, c)
            opopup.setDefaultItem c
         else
            oPopup.insertItem(c, sts(i),0, c)
            oPopup.setCommand(c, sts(i))
         end if
      end if
   next
   n = oPopup.execute( window, aRect, com.sun.star.awt.PopupMenuDirection.EXECUTE_DEFAULT)
   If n > 0 Then
      showpopup3 = oPopup.getCommand(n)
   end if

End function

Attachments
popup menu.odt
(11.62 KiB) Downloaded 10 times
Openoffice 4.1.6
Windows 8
JeJe
Volunteer
 
Posts: 1190
Joined: Wed Mar 09, 2016 2:40 pm

Re: How to add special character to favorite characters?

Postby Zizi64 » Fri Sep 18, 2020 6:18 pm

RoryOF wrote:I do not think one can add personal special characters to the /insert /Special characters option. It is my understanding that this option shows the characters available in a particular font/character set. Change its font selection (selector top left of the Special Characters window) and choose a font that has the desired characters, changing the subset to "Mathematical operators" (righthand selector) to avoid having to scroll through the entire set of characters.

A quick test on my system (details as in my .sig) shows that the characters you require are in Mathjax_Main font. No doubt there is a font on Windows or available for Windows, that offers such characters.


The LibreOffice has a new feature named "Favourite characters" in the Insert - Special characters function bot it has a limit (16 characters):

Special characters.png
Click on the picture for a better view.


You can add only those characters to the Favourite list, what is present in the table.
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 9591
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to add special character to favorite characters?

Postby MilosDj » Fri Sep 18, 2020 7:07 pm

Zizi64 wrote:The LibreOffice has a new feature named "Favourite characters" in the Insert - Special characters function bot it has a limit (16 characters):
You can add only those characters to the Favourite list, what is present in the table.

I know. I tried that. It doesnt work for ∀ ∃ ∧ ∨ ⇒ ⤃ ⇔ ⤄. Or it works if I choose different font as suggested by RoryOF. Only problem is it inserts char AND char type. So far auto correct just replace character, preserving document font type.
LibreOffice 7.0.0.3 on Windows 10
MilosDj
 
Posts: 5
Joined: Fri Sep 18, 2020 10:24 am

Re: [Solved] Add special character to favorite characters

Postby RoryOF » Fri Sep 18, 2020 7:20 pm

The characters have to be in the font used.
Apache OpenOffice 4.1.7 on Xubuntu 20.04.1 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 31540
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Add special character to favorite characters

Postby MilosDj » Fri Sep 18, 2020 9:18 pm

RoryOF wrote:The characters have to be in the font used.

I understand that. But out of curiosity, how is auto correct able to convert \forall to right character and display it correctly with document font type, in this case Bahnschrift SemiLight? And special char insert does not have forall and must use OpenSymbols fonts?
LibreOffice 7.0.0.3 on Windows 10
MilosDj
 
Posts: 5
Joined: Fri Sep 18, 2020 10:24 am


Return to Writer

Who is online

Users browsing this forum: No registered users and 12 guests