From 58adcd102a1962c77db404a96ba62661f1f75ea8 Mon Sep 17 00:00:00 2001 From: "anburasan.saravanan@syncfusion.com" Date: Wed, 24 Jan 2024 13:51:38 +0530 Subject: [PATCH 1/3] ES-867853_Added Format Equations in DocIO --- File-Formats/DocIO/Working-with-LaTeX.md | 262 ++++++++++++++++++ .../scripts.png | Bin 0 -> 1707 bytes 2 files changed, 262 insertions(+) create mode 100644 File-Formats/DocIO/WorkingwithMathematicalEquation_images/scripts.png diff --git a/File-Formats/DocIO/Working-with-LaTeX.md b/File-Formats/DocIO/Working-with-LaTeX.md index 00397d842..e5a76cd42 100644 --- a/File-Formats/DocIO/Working-with-LaTeX.md +++ b/File-Formats/DocIO/Working-with-LaTeX.md @@ -1569,3 +1569,265 @@ The following table demonstrates the LaTeX equivalent to professional format Rig {\mathbf{100}}_{\mathbf{40}}^{\mathbf{20}} + +## Format Equations + +### Apply style to characters + +Apply styles to characters, such as bold and bold-italic, for equations in a Word document using LaTeX with the .NET Word Library. Apply the following styles using LaTeX commands. + + + + + + + + + + + + + + + + +
StylesLaTeX
+Bold

+\mathbf

+BoldItalic

+\mathbit

+ +The following code example demonstrates how to apply styles to characters within equations in a Word document. + +{% tabs %} + +{% highlight c# tabtitle="C# [Cross-platform]" %} +// Create a new Word document. +using (WordDocument document = new WordDocument()) +{ + //Add one section and one paragraph to the document. + document.EnsureMinimal(); + + //Append an accent equation with bold using LaTeX. + document.LastParagraph.AppendMath(@"\dot{\mathbf{a}}"); + //Append an accent equation with bold-italic using LaTeX. + document.LastSection.AddParagraph().AppendMath(@"\dot{\mathbit{a}}"); + + //Save a Word document to the MemoryStream. + using (MemoryStream stream = new MemoryStream()) + { + document.Save(stream, FormatType.Docx); + } +} +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +// Create a new Word document. +using (WordDocument document = new WordDocument()) +{ + + //Add one section and one paragraph to the document. + document.EnsureMinimal(); + + //Append an accent equation with bold using LaTeX. + document.LastParagraph.AppendMath(@"\dot{\mathbf{a}}"); + //Append an accent equation with bold-italic using LaTeX. + document.LastSection.AddParagraph().AppendMath(@"\dot{\mathbit{a}}"); + + //Save a Word document. + document.Save("Result.docx", FormatType.Docx); +} +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +' Create a new Word document. +Dim document As WordDocument = New WordDocument() + +'Add one section and one paragraph to the document. +document.EnsureMinimal() + +'Append an accent equation with Bold using LaTeX. +document.LastParagraph.AppendMath(@"\dot{\mathbf{a}}") +'Append an accent equation with Bold-Italic using LaTeX. +document. LastSection.AddParagraph().AppendMath(@"\dot{\mathbit{a}}") + +'Save the Word document. +document.Save("Result.docx", FormatType.Docx) +{% endhighlight %} + +{% endtabs %} + +### Apply scripts to the equation + +Apply scripts, such as double-struck, fraktur, and more, to equations in a Word document using LaTeX with the .NET Word Library. Apply the following scripts using LaTeX commands. + + + + + + + + + + + + + + + + + + + + + + + + +
ScriptsLaTeX
+Double-struck

+\mathbb

+Fraktur

+\mathfrak

+Sans Serif

+\mathsf

+Script

+\mathscr
\mathcal
+ +The following code examples show how to apply the scripts to equations in a Word document. + +{% tabs %} + +{% highlight c# tabtitle="C# [Cross-platform]" %} +// Create a new Word document. +using (WordDocument document = new WordDocument()) +{ + //Add one section and one paragraph to the document. + document.EnsureMinimal(); + + //Append an accent equation with Double-Struck font using LaTeX. + document.LastParagraph.AppendMath(@"\dot{\mathbb{a}}"); + //Append an accent equation with Fraktur font using LaTeX. + document.LastSection.AddParagraph().AppendMath(@"\dot{\mathfrak{a}}"); + //Append an accent equation with Sans Serif font using LaTeX. + document.LastSection.AddParagraph().AppendMath(@"\dot{\mathsf{a}}"); + //Append an accent equation with Script using LaTeX. + document.LastSection.AddParagraph().AppendMath(@"\dot{\mathcal{a}}"); + //Append an accent equation with Script using LaTeX. + document.LastSection.AddParagraph().AppendMath(@"\dot{\mathscr{a}}"); + + //Save a Word document to the MemoryStream. + using (MemoryStream stream = new MemoryStream()) + { + document.Save(stream, FormatType.Docx); + } +} +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +// Create a new Word document. +using (WordDocument document = new WordDocument()) +{ + //Add one section and one paragraph to the document. + document.EnsureMinimal(); + + //Append an accent equation with DoubleStruck font using LaTeX. + document.LastParagraph.AppendMath(@"\dot{\mathbb{a}}"); + //Append an accent equation with Fraktur font using LaTeX. + document.LastSection.AddParagraph().AppendMath(@"\dot{\mathfrak{a}}"); + //Append an accent equation with SansSerif font using LaTeX. + document.LastSection.AddParagraph().AppendMath(@"\dot{\mathsf{a}}"); + //Append an accent equation with Script using LaTeX. + document.LastSection.AddParagraph().AppendMath(@"\dot{\mathcal{a}}"); + //Append an accent equation with Script using LaTeX. + document.LastSection.AddParagraph().AppendMath(@"\dot{\mathscr{a}}"); + + //Save a Word document. + document.Save("Result.docx", FormatType.Docx); +} +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +' Create a new Word document. +Dim document As WordDocument = New WordDocument() + +'Add one section and one paragraph to the document. +document.EnsureMinimal() + +'Append an accent equation with DoubleStruck font using LaTeX. +document.LastParagraph.AppendMath(@"\dot{\mathbb{a}}") +'Append an accent equation with Fraktur font using LaTeX. +document.LastSection.AddParagraph().AppendMath(@"\dot{\mathfrak{a}}") +'Append an accent equation with SansSerif font using LaTeX. +document. LastSection.AddParagraph().AppendMath(@"\dot{\mathsf{a}}") +'Append an accent equation with Script using LaTeX. +document. LastSection.AddParagraph().AppendMath(@"\dot{\mathcal{a}}") +'Append an accent equation with Script using LaTeX. +document. LastSection.AddParagraph().AppendMath(@"\dot{\mathscr{a}}") + +'Save a Word document. +document.Save("Result.docx", FormatType.Docx) +{% endhighlight %} + +{% endtabs %} + +![Apply scripts to the equation](WorkingwithMathematicalEquation_images/scripts.png) + +### Preserve as normal text + +By default, characters in equations in a Word document are in italics. However, you can also include normal text within an equation using LaTeX. + +The following code example shows how to preserve text as normal text, without any default formatting, within an equation using LaTeX. + +{% tabs %} + +{% highlight c# tabtitle="C# [Cross-platform]" %} +// Create a new Word document. +using (WordDocument document = new WordDocument()) +{ + //Add one section and one paragraph to the document. + document.EnsureMinimal(); + + //Append an accent equation as normal text using LaTeX. + document.LastParagraph.AppendMath(@"\dot{\mathrm{a}}"); + + //Save a Word document to the MemoryStream. + using (MemoryStream stream = new MemoryStream()) + { + document.Save(stream, FormatType.Docx); + } +} +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +// Create a new Word document. +using (WordDocument document = new WordDocument()) +{ + //Add one section and one paragraph to the document. + document.EnsureMinimal(); + + //Append an accent equation as normal text using LaTeX. + document.LastParagraph.AppendMath(@"\dot{\mathrm{a}}"); + + //Save a Word document. + document.Save("Result.docx", FormatType.Docx); +} +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +' Create a new Word document. +Dim document As WordDocument = New WordDocument() + +'Add one section and one paragraph to the document. +document.EnsureMinimal() + +'Append an accent equation as normal text using LaTeX. +document.LastParagraph.AppendMath(@"\dot{\mathrm{a}}") + +'Save a Word document. +document.Save("Result.docx", FormatType.Docx) +{% endhighlight %} + +{% endtabs %} + +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Mathematical-Equation/LaTeX-equations/Format%20Equation). \ No newline at end of file diff --git a/File-Formats/DocIO/WorkingwithMathematicalEquation_images/scripts.png b/File-Formats/DocIO/WorkingwithMathematicalEquation_images/scripts.png new file mode 100644 index 0000000000000000000000000000000000000000..6f58d33f5060450ac9ad65bbef2f3c1eae94b59c GIT binary patch literal 1707 zcma)-dpy&77{{kGUPJDh(T)AcZDSpY+^=Igh}z733Og=!7+x-OT8(lk*Is9+D9xo9 zbI3JX>qtY)C5p%tLK%_k#MycEU$56Woj;!M^L?J@^?Lqze?Q;nNjv4@ASIz90Rn-f zFphTaLLVozE{K@$ybzqs5IT`4cLy6#b?<>WVE`stJ6nT5e`ZN;2Z#z|@d!uHC=dv$ z@sEjM+|`#rATcY9o%NYGzlFk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cmV?d00001 From ab93629a7e75fcd44de010ffc2e4947b3ac7db6e Mon Sep 17 00:00:00 2001 From: BrunoJenson Date: Wed, 24 Jan 2024 16:02:23 +0530 Subject: [PATCH 2/3] Update release notes content --- File-Formats/Release-Notes/v24.1.47.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/File-Formats/Release-Notes/v24.1.47.md b/File-Formats/Release-Notes/v24.1.47.md index b380250cd..ddb797f31 100644 --- a/File-Formats/Release-Notes/v24.1.47.md +++ b/File-Formats/Release-Notes/v24.1.47.md @@ -9,6 +9,19 @@ documentation: ug {% include release-info.html date="January 23, 2024" version="v24.1.47" %} + + +
+With the 2024 Volume 1 release, we will discontinue support for .NET Framework 4.5, 4.5.1, and 4.6 in WinForms, WPF, and the File-Format Frameworks. Instead, we will provide support for .NET 4.6.2. +
## DocIO From 4e193b0656c736e8f0fdf6f4d1b71f3dc8156de6 Mon Sep 17 00:00:00 2001 From: "anburasan.saravanan@syncfusion.com" Date: Wed, 24 Jan 2024 20:20:16 +0530 Subject: [PATCH 3/3] Resolved curly braces --- File-Formats/DocIO/Working-with-LaTeX.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/File-Formats/DocIO/Working-with-LaTeX.md b/File-Formats/DocIO/Working-with-LaTeX.md index e5a76cd42..4b60fefa3 100644 --- a/File-Formats/DocIO/Working-with-LaTeX.md +++ b/File-Formats/DocIO/Working-with-LaTeX.md @@ -313,6 +313,7 @@ The following code example illustrates how to create border box equation using L {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" %} +{% raw %} // Create a new Word document. using WordDocument document = new WordDocument(); @@ -326,10 +327,11 @@ document.LastParagraph.AppendMath(@"\boxed{{x}^{2}+{y}^{2}={z}^{2}}"); using MemoryStream stream = new MemoryStream(); document.Save(stream, FormatType.Docx); - +{% endraw %} {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} +{% raw %} // Create a new Word document. using WordDocument document = new WordDocument(); @@ -342,9 +344,11 @@ document.LastParagraph.AppendMath(@"\boxed{{x}^{2}+{y}^{2}={z}^{2}}"); //Save the Word document. document.Save("Result.docx", FormatType.Docx); +{% endraw %} {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +{% raw %} ' Create a new Word document. Dim document As WordDocument = New WordDocument() @@ -357,6 +361,7 @@ document.LastParagraph.AppendMath(@"\boxed{{x}^{2}+{y}^{2}={z}^{2}}") 'Save the Word document. document.Save("Result.docx", FormatType.Docx) +{% endraw %} {% endhighlight %} {% endtabs %} @@ -375,7 +380,7 @@ The following table demonstrates the LaTeX equivalent to professional format bor 1. Border Box equation -\boxed{{x}^{2}+{y}^{2}={z}^{2}} +{% raw %}\boxed{{x}^{2}+{y}^{2}={z}^{2}}{% endraw %}