Page 1 of 1

[Solved] Can't write a literal character (%) in a Math object

Posted: Thu Apr 27, 2023 4:36 pm
by clone799
I can't believe I am having this problem,and if it's just me being a dummy, let me know.

I have a document in which I need to insert a math formula. I inserted a math/formula object, and here's what I wrote (with sensitive information removed, of course):

{x}over{y}={20}over{94}=21%

I want it to look like this:
CutPerc.PNG
CutPerc.PNG (2.01 KiB) Viewed 28803 times
Instead, it looks like this:
CutNoPerc.PNG
CutNoPerc.PNG (854 Bytes) Viewed 28803 times
I know that % is used in functions (an atrocious design choice for a MATH markup language, but that's not the point). But there has to be a way to write a single percent sign, right? They allow a perthousand sign (%perthousand), but not a %? And I've tried using a \ and a / to mark a literal character, nothing.

I can't believe this is such a problem, and I can't believe there's nothing in the documentation to resolve this. How has this never come up? This has to be me, I'm sure of it, I'm the one unable to find the easy solution. Because nobody would make a whole text editing software in which you can add math formulas, but you can't use a percent sign in any of them.

I am begging the wizards of this board to help me, I am out of ideas.

Re: Can't write a literal character (%) in a math object.

Posted: Thu Apr 27, 2023 5:05 pm
by RoryOF
Put your % sign in double quotes: "%"

Re: Can't write a literal character (%) in a math object.

Posted: Thu Apr 27, 2023 5:49 pm
by clone799
RoryOF wrote: Thu Apr 27, 2023 5:05 pm Put your % sign in double quotes: "%"
Honestly, that's such an obvious solution I can't believe I didn't think of it. Thank you.

While I'm here, is there a document/help page where is says that? I couldn't find it for the life of me.

Re: SOLVED: Can't write a literal character (%) in a math object.

Posted: Thu Apr 27, 2023 6:01 pm
by RoryOF
I just searched on the Forum. using the Forum search at top right.

Re: SOLVED: Can't write a literal character (%) in a math object.

Posted: Thu Apr 27, 2023 6:40 pm
by Zizi64
Three versions work in my LibreOffice 7.4.6:
LO746_Equ.png
LO746_Equ.png (15.69 KiB) Viewed 28735 times

https://en.wikipedia.org/wiki/Percent_sign
"Form and spacing
English style guides prescribe writing the percent sign following the number without any space between (e.g. 50%)."

Therefore it will be better result with the formula:

Code: Select all

{x}over{y}={20}over{94}="21%"

Re: [Solved]: Can't write a literal character (%) in a math object.

Posted: Thu Apr 27, 2023 7:54 pm
by RoryOF
@Zizi64: Only your first example works with OpenOffice.

Re: Can't write a literal character (%) in a math object.

Posted: Thu Apr 27, 2023 9:37 pm
by cwolan
clone799 wrote: Thu Apr 27, 2023 5:49 pm
RoryOF wrote: Thu Apr 27, 2023 5:05 pm Put your % sign in double quotes: "%"
Honestly, that's such an obvious solution I can't believe I didn't think of it. Thank you.

While I'm here, is there a document/help page where is says that? I couldn't find it for the life of me.
See OpenOffice Help for Math, topic "Entering Text".
The other option is to define your own % symbol (mentioned in the Bugzilla request for enhancement 20739 ).


EnteringText.jpg
EnteringText.jpg (89.76 KiB) Viewed 28610 times

Re: Can't write a literal character (%) in a math object.

Posted: Thu Jun 22, 2023 5:47 pm
by thejoyofwriting
cwolan wrote: Thu Apr 27, 2023 9:37 pm
clone799 wrote: Thu Apr 27, 2023 5:49 pm
RoryOF wrote: Thu Apr 27, 2023 5:05 pm Put your % sign in double quotes: "%"
Honestly, that's such an obvious solution I can't believe I didn't think of it. Thank you.

While I'm here, is there a document/help page where is says that? I couldn't find it for the life of me.
See OpenOffice Help for Math, topic "Entering Text".
The other option is to define your own % symbol (mentioned in the Bugzilla request for enhancement 20739 ).



EnteringText.jpg
I am having some troubles,when I am typing the 15 "%" in my report the numbers 15 are in italic and the % is in normal font,how can i format the mto the same fonts ? it's really weird
 Edit: Spam link in quoted text removed 

Re: [Solved] Can't write a literal character (%) in a Math object

Posted: Thu Jun 22, 2023 7:38 pm
by Zizi64
I am having some troubles,when I am typing the 15 "%" in my report the nu
Please upload your ODF type sample file here.

Re: [Solved] Can't write a literal character (%) in a Math object

Posted: Tue Jul 25, 2023 1:00 pm
by DiGro
Use ~ or ` for a great or small gap respectively between

Code: Select all

{x}over{y}~=~{20}over{94}~=`21"%"
that will get you the spaces you desire:
With gaps
With gaps
CutPerc_with_gaps.PNG (2.01 KiB) Viewed 27633 times