Releases ยท verybadcat/CSharpMath
1.0.0-pre.1 Update Uno for .NET 10
๐ New Platforms!
CSharpMath.Maui replaces CSharpMath.Forms
.NET MAUI is the replacement for Xamarin.Forms. Now we have native views for it!
Uno Platform Support (#121) @MartinZikmund
This adds a second way to support Uno which supports Xaml, adding to the previous CSharpMath.SkiaSharp support.
CSharpMath.Uno works with both Uno's native renderer (for iOS, Android and WinUI) and Skia renderer. Browser native renderer is unsupported as there is no way to use cross-targeting to support it.
CSharpMath.Uno.Example is now published at https://verybadcat.github.io/CSharpMath
New frontend CSharpMath.VectSharp. (#215) @arklumpus
PR description
Hi! Thank you for this project, I really like it!
I needed a way to render LaTeX equations for another project (VectSharp.Markdown), and this seemed like a good place to start.
To be able to make it work with my project, I have created a new front end for CSharpMath, which uses VectSharp to render the equations. As a side effect, this makes it possible to output the rendered LaTeX to SVG and PDF documents, as well as to raster images.
For example, to render an equation to an SVG file (requires the VectSharp.SVG NuGet package):
using VectSharp; using VectSharp.SVG; using CSharpMath.VectSharp; var painter = new MathPainter(); painter.LaTeX = @"\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)"; Page pag = painter.DrawToPage(); pag.SaveAsSVG("test.svg");
Or to a PDF file (requires the VectSharp.PDF NuGet package):
using VectSharp; using VectSharp.PDF; using CSharpMath.VectSharp; var painter = new MathPainter(); painter.LaTeX = @"\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)"; Page pag = painter.DrawToPage(); Document doc = new Document(); doc.Pages.Add(pag); doc.SaveAsPDF("test.pdf");
Currently, this implementation is very similar to the CSharpMath.SkiaSharp implementation, except that it uses VectSharp rather than SkiaSharp for rendering. Ideally, at some point in the future I would like to fork from CSharpMath.Rendering in order to directly draw the glyphs, which would have the added benefit of making text selectable in PDF files. It will take some time though, because at the very least I need to implement a parser for the MATH OpenType table.
I hope this can be useful! Let me know if there are any issues or you have any questions!
Updates for .NET 10!
All packages now target net10.0 (potentially with a target OS) or netstandard2.0. The entire repo now builds cross-platform with the dotnet toolchain but only Windows can build for all target OSes. Everything should be usable out of the box for modern .NET applications now.
CSharpMath.Evaluation now supports a lot more math operations with AngouriMath 1.4! Check out what it can do here.
Namespace refactor
CSharpMath.Structures have been merged into either CSharpMath.Atom or CSharpMath.Display. Update namespace usages accordingly.
Deprecations
CSharpMath.Forms package is deprecated. Use CSharpMath.SkiaSharp or CSharpMath.Maui instead.
CSharpMath.Ios package is deprecated. Use CSharpMath.SkiaSharp instead.
CSharpMath.Editor package is now integrated into CSharpMath base package. Explicit references to it (I don't think anyone does that) should be replaced with CSharpMath.
Contributors
@Copilot, @Happypig375, @MartinZikmund, @arklumpus, @charlesroddie, @copilot-swe-agent and @hflexgrig
0.5.2 CI
Changes from v0.5.1 (Recently merged first)
Remove EnumGetValues (#230) @charlesroddie
Remove a usage of Enum.GetValues, which is based on reflection and not trim compatible.
Fixes #227
๐ Features
Add TextColor property to BaseButton and make MathInputButton's color customizable (#164) @SymboLinker
The main goal of this commit is to make keyboard colors customizable (per keyboard key) to fit an app's color theme(s). For example, a dark keyboard background with light button texts.
CSharpMath.Forms:
- Refactor BaseButton's constructor.
- Add TextColor property to BaseButton and a bindable TextColorProperty.
- Remove the predefined Red color from MathInputButton.InputToLaTeX(input) for "Backspace" and "Clear".
CSharpMath.Forms.Example (MathKeyboard.xaml):
- Use the TextColorProperty in the Style of "Backspace" and "Clear", setting it to Red.
๐งฐ Maintenance
Update FractionDisplay.cs (#200) @ReallyVirtual
Contributors
0.5.1 Evaluation Update Quickfix
Changes from v0.5.0 (Recently merged first)
๐ Features
Provide workaround for #192 (#193) @Happypig375
So that
class RussianBreakingEngine : Typography.TextBreak.EngBreakingEngine { public override bool CanHandle(char c) => c is >= '\u0400' and <= '\u052f'; // Unicode Cyrillic and Cyrillic Supplement } CSharpMath.Rendering.Text.TextLaTeXParser.AdditionalBreakingEngines.Add(new RussianBreakingEngine());
can be used for #192 while awaiting Typography support.
Contributors
0.5.0 Evaluation Update
Changes from v0.5.0-beta (Recently merged first)
๐งฐ Maintenance
Fix ci build (#187) @FoggyFinder
- Build /
- Test / Core [ workaround ]
For Test / Core I had to change version for Avalonia.Skia package manually since I didn't find any good (and easy to implement) way to specify the same version of Avalonia.
Also I turned off (temporarily) automatic updates for Avalonia.Skia package.
Test / Ios is unrelated.
Contributors
@FoggyFinder and @devel0
0.5.0 Evaluation Update Beta
Changes from v0.5.0-alpha4 (Recently merged first)
๐ Features
Add placeholder blinks setting (#177) @SymboLinker
In issue #175 a feature request was done for stopping the blinking of the placeholder (but still have a blinking carret if it moves to a spot without a placeholder).
The proposed pull request #176 just removes the blinking of the placeholder and does not leave it as an option.
This pull request adds a setting LaTeXSetting.PlaceholderBlinks that keeps the default value true and does not break any existing unit tests.
Tests are added
- to make sure that the setting for a non-blinking placeholder works
- to document how it should work
- to make sure that it will not be removed in a whim
@charlesroddie Please verify that the effect of changing the "PlaceholderBlinks"-setting results in the behaviour you like.
Make blinking Placeholder's Nucleus and ForeColor customizable in both CaretStates (#167) @SymboLinker
In pull request #164, posting #164 (comment), the idea came up to make the placeholder customizable in the keyboard output. While PR #164 is concerned with the display of the keyboard buttons themselves, this PR is about the math keyboard output.
Currently the placeholder has two possible appearances: a full black square and an empty square with a black border.
This pull request makes the Nucleus and the ForeColor of the placeholder customizable in both CaretStates.
An example of usage: instead of an empty square with a black border in the 'hiding' CaretState, you could choose a full square with another Color (gray, for instance).
An example test:
In CSharpMath.Forms.Example\CSharpMath.Forms.Example\EditorPage.xaml.cs
add the following lines at the top of the constructor of the EditorView:
Atom.LaTeXSettings.PlaceholderHidingNucleus = "\u25A0";
Atom.LaTeXSettings.PlaceholderHidingColor = Color.LightGray;
Open the Example project and go to the Editor tab. Click the fraction button. The output is:

where the square in the numerator blinks, LightGray/Black.
I am willing to write unit tests after some form of preliminary approval of this pull request.
(And of course I will fix mistakes and refactor if needed.)
๐งฐ Maintenance
-
#180 take 2 (#181) @Happypig375
-
Update Release workflow with the workaround from Test (#180) @Happypig375
Make MathKeyboard IDisposable (#179) @charlesroddie
Cleanup in preparation for Font Styles (#156) @charlesroddie
Initial simplification in preparation for adding Font Styles
- DoNothingFontChanger was removed was only used in tests.
For subsequent PR:
- UnicodeFontChanger uses "mathematical bold/italic" ranges to use a single font for normal/bold/italic. To preserve existing functionality without deploying additional fonts, this logic needs to be kept when using standard fonts.
- Allow users to add bold and italic fonts, for use in TextPainter. This PR will not address MathAtom fonts. If these fonts are present, they will be used instead of UnicodeFontChanger for rendering bold/italic fonts.
Enable the use of codecov.io (#163) @Happypig375
Continuous Benchmark (#162) @Happypig375
- Fix GitHub Packages (#157) @Happypig375
Add test coverage as CI artifacts (#155) @Happypig375
Also CSharpMath.Rendering.Tests baselines became smaller magically
Contributors
0.5.0 Evaluation Update Alpha 4
Changes from v0.5.0-alpha3 (Recently merged first)
๐งฐ Maintenance
- Delete the unneeded reference to CSharpMath.Evaluation in CSharpMath.Avalonia (#154) @Happypig375
Contributors
0.5.0 Evaluation Update Alpha 3
0.5.0 Evaluation Update Alpha 2
Changes from v0.5.0-alpha (Recently merged first)
๐งฐ Maintenance
- Try to fix why only CSharpMath the package was published to NuGet (#152) @Happypig375
Contributors
0.5.0 Evaluation Update Alpha
Changes from v0.4.2 (Recently merged first)
๐ Features
`Change AngouriMath reference to use NuGet package instead of git submodule` (#149) @Happypig375
Also added a calculator to Avalonia Example
`Parser refactor (part 1)` (#143) @Happypig375
Now every command is put into a central place for lookup.
Also added \atopwithdelims to let MathListFromLaTeX be able to consume MathListToLaTeX output, and % for comments are now supported in MathListFromLaTeX and MathListToLaTeX.
AliasDictionary has been split into BiDictionary and ProxyAdder.
Contributes to #58.
`System.Drawing.Color` (#141) @charlesroddie
Reduce code by removing a Color structure that duplicates System.Drawing.Color. Presumably this predated netstandard.
`Added the bra and ket commands for Dirac notation support` (#134) @jclapis
This pull request adds the \bra{} and \ket{} commands, which are useful shorthand commands for work involving quantum mechanics and Dirac notation.
Their implementation is inspired by the popular braket LaTeX package.
๐ Bug Fixes
`Killing four bugs with one PR?` (#144) @Happypig375
`Spacing and bounding boxes (part 1)` (#132) @Happypig375
Part of a series of PRs on fixing #32
- Fixed large space above large matrices
- Fixed several parsing bugs like
\left( x\\ y\right)which round-tripped to\left( x\\ y&\right) - Better error messages for
\begin \endand\left \rightpairs - And refactorings
`Align text center and right correctly` (#126) @Happypig375
`Fix punctuation` (#128) @Happypig375
According to AMSMath documentation, ! should be of Class Punctuation instead of Close. Not sure why ? and ! are classified as Close which brings complexity when dealing with brackets.
`Punctuation should stick to inline maths` (#119) @Happypig375
๐งฐ Maintenance
-
CSharpMath.Evaluation.Interpret tests(#151) @Happypig375 -
Automatic releasing(#150) @Happypig375
`Updated Avalonia to 0.10.0-preview1` (#146) @jp2masa
Changes
- Updated Avalonia to 0.10.0-preview1:
- Updated default text color and font size:
- Text color is now based on fluent theme resources (won't work for default theme, which I think will be deprecated soon anyway).
- Font size is now constant
14.0f(this value comes from fluent theme resources, there is also a bug which blocks using the resource: it isdouble, but font size isfloat, probably a bug in Avalonia).
- Updated Avalonia sample:
- Also removed
SideBar.xaml: the default styles forTabControlis good in fluent theme, also the side bar styles don't look good in fluent.
- Also removed
- Updated default text color and font size:
Apparently you can add redirect buttons in issue template selection(#147) @Happypig375
`Enable CSharpMath.Rendering.Tests.TextPainterSettings` (#139) @Happypig375
Comment out specific problematic test cases instead of skipping the whole test
Also fixed CSharpMath.Ios.Tests.MathInline not actually being inline
`CSharpMath.Ios.Tests` (#133) @Happypig375
Also enabled artifact uploading of image test results.
A better way of comparing images will be needed, as image size comparisons are unreliable.
`Fix dependency version of CI packages + SourceLink infrastructure` (#131) @Happypig375
Per dotnet/sourcelink#255, non-NuGet feeds do not support .snupkgs, so they are not available for CI packages.
-
Add nightly steps to README(#130) @Happypig375 -
New shields(#129) @Happypig375 -
Upload CI artifacts(#127) @Happypig375 -
Stick a Status:New label to all non-Chat issue templates(#122) @Happypig375
Contributors
0.4.2 Avalonia Update
The 0.4 Avalonia Update brings the Avalonia front end!
0.4.1: Fixed Measure in CSharpMath.Rendering
0.4.2: Fixed TextPainter setting the position of display maths in the first line to above the canvas bounds
