[Solved] Add special character to favorite characters

Discuss the word processor
Post Reply
MilosDj
Posts: 5
Joined: Fri Sep 18, 2020 10:24 am

[Solved] Add special character to favorite characters

Post by MilosDj »

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
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to add special character to favorite characters?

Post by RoryOF »

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.15 on Xubuntu 22.04.4 LTS
MilosDj
Posts: 5
Joined: Fri Sep 18, 2020 10:24 am

Re: How to add special character to favorite characters?

Post by MilosDj »

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
JeJe
Volunteer
Posts: 2785
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Add special character to favorite characters

Post by JeJe »

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


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 138 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to add special character to favorite characters?

Post by Zizi64 »

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):
Click on the picture for a better view.
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; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
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.
MilosDj
Posts: 5
Joined: Fri Sep 18, 2020 10:24 am

Re: How to add special character to favorite characters?

Post by MilosDj »

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
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Add special character to favorite characters

Post by RoryOF »

The characters have to be in the font used.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
MilosDj
Posts: 5
Joined: Fri Sep 18, 2020 10:24 am

Re: [Solved] Add special character to favorite characters

Post by MilosDj »

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
Post Reply