Display less than or equal to in LaTex

Hello,

I would like to display the less than or equal to sign using LaTex notation. Currently, I am using @"\leq" which is not working. Other commands such as @"\geq" displays the correct greater than or equal sign and @\"ngtr" and @"\nleq" also work as expected. 


is there a way to display the less than or equal to sign? 


Thanks.  


5 Replies 1 reply marked as answer

SB Sneha Biju Syncfusion Team January 3, 2024 10:30 AM UTC

Hi Natalie,

To achieve your requirement of displaying less than and greater than related symbols, you can refer to the LaTeX syntax tabulated below.

Symbol Name

Character

LaTeX syntax

Greater

Lesser

Greater than or equal to

\geq

Lesser than or equal to

\le

Much greater than

\gg

Much lesser than

\ll

Not greater than or equal to

\ngeq

Not lesser than or equal to

\nleq


You can also refer to the following code snippet for appending the above symbols.

WordDocument document = new WordDocument();

document.EnsureMinimal();

document.LastParagraph.AppendMath(@"a>b");

document.LastSection.AddParagraph().AppendMath(@"a<b");

document.LastSection.AddParagraph().AppendMath(@"a\geq b");

document.LastSection.AddParagraph().AppendMath(@"a\le b");

document.LastSection.AddParagraph().AppendMath(@"a\gg b");

document.LastSection.AddParagraph().AppendMath(@"a\ll b");

document.LastSection.AddParagraph().AppendMath(@"a\ngeq b");

document.LastSection.AddParagraph().AppendMath(@"a\nleq b"); document.Save("Output.docx");


We have also attached the output document for the above code snippet.

Regards,
Sneha.


Attachment: Output_4573a9d.docx


NW Natalie Westphal January 3, 2024 06:04 PM UTC

Please see attached for the word file that is created when I copied and pasted your code and ran it. 

The "ageq b" and "aleq b" code is not working. However, using "a\ngeq b" and "a \nleq b" displays the desired result. 


Attachment: EqualityOperators_7d4f9fdd.zip


SB Sneha Biju Syncfusion Team January 4, 2024 12:14 PM UTC

Natalie, sorry for the inconvenience. Please find the valid LaTeX syntax for displaying the lesser than and greater than related symbols to use in DocIO from the below image.
A screenshot of a computer

Description automatically generated

Also please find the proper code snippet for the above mentioned LaTeX syntax.
A screenshot of a computer program

Description automatically generated



NW Natalie Westphal March 18, 2024 09:15 PM UTC

Can you confirm the latex for the not greater than symbol? 

According to this editor (https://editor.codecogs.com), \ngtr should produce the desired symbol but this is not the case, as seen in the attached program.


Attachment: LatexEquation_(2)_f3a8bce2.zip


AA Akash Arul Syncfusion Team March 19, 2024 11:05 AM UTC

Natalie, please find the LaTeX for not greater than symbol below.

paragraph.AppendMath(@"-16.75 \ngt 0");


Refer to the below UG documentations for the LaTeX for the common relational operators in DocIO.
https://help.syncfusion.com/file-formats/docio/supported-latex#common-relational-operators

Kindly refer to the below UG documentation for the supported symbols using LaTeX in .NET Word library.
https://help.syncfusion.com/file-formats/docio/supported-latex


Marked as answer
Loader.
Up arrow icon