fornever / xaml-math Goto Github PK
View Code? Open in Web Editor NEWA collection of .NET libraries for rendering mathematical formulae using the LaTeX typesetting style, for the WPF and Avalonia XAML-based frameworks
License: MIT License
A collection of .NET libraries for rendering mathematical formulae using the LaTeX typesetting style, for the WPF and Avalonia XAML-based frameworks
License: MIT License
From launchpad repo
WPF Math run very well in my PC which is running Windows 7 SP1 Professional. But in some PC running Windows 7, it cannot render when i click Render button.
We need to implement multiple integrals commands.
https://www.sharelatex.com/learn/Integrals,_sums_and_limits#/Multiple_integrals
Can you support UTF8 symbols? I can't add symbols from other languages than English!
Hi, I found WpfMath available as a nuget package in VS2015. Although it claims to be v0.2 the whole namespace WpfMath.Controls is missing there, thus making it useless for usage as a WPF control.
Would be great to just reference the nuget package except the need to build my own version from the sources.
I want to generate DefaultTexFont.xml
from the TTF files we have.
Comments from jlatexmath maintainer were helpful, but I'm still struggling with that. Will document after I find everything out.
We should to revise all parser error messages and make them more concise and rich. E.g. add info about index of symbol where error was occured.
As a library user, I want to have a WPF control that'll be able to render the formula. Usage should be like that:
<FormulaControl Formula="E = m \cdot c ^ 2"/> <!-- Simple text formula -->
<FormulaControl Formula="{Binding SomeMath}" /> <!-- With binding -->
That control should be included into the library and published to NuGet.
master
): feature/17-avalonia
FormulaBlock
publicmaster
branchBrush
es) for WPF- and Avalonia-dependent code.xml
and .ttf
) are deduplicated properly.Do you have any plans to add possibility of rendering LaTeX formulas from a normal string?
Reported by our user in #82 (comment): \text{abc}
doesn't work; it says "Unknown symbol or command or predefined TeXFormula: 'text'".
I've confirmed that \text{}
command never worked in any released version, so that's not a regression but a lack of feature.
We have a bunch of XML files, namely:
DefaultTexFont.xml
GlueSettings.xml
PredefinedTexFormulas.xml
TexFormulaSettings.xml
TexSymbols.xml
There's a consensus between current contributors that we need to replace them with something else.
I think that PredefinedTexFormulas
, GlueSettings
, TexFormulaSettings
and TexSymbols
can be completely replaced by code without problems.
DefaultTexFont
is a bit different, because it would be too much code to replace it. I'd like to research if we can extract some of its information from the font files we provide. Probably these mappings were originally created by some script we could find and/or rewrite.
After all of the files are gone, we could remove GPL license and release a new version with MIT exclusively.
There're some TODOs in on of the patches for the original project:
These should be resolved.
What do you think if we add common differential operators like \grad, \div, \rot (\curl)? The only problem I see it's collision between \div (÷) symbol and divergence operator. But division symbol is rarely used, I think we can redefine it as \divsymb [1].
[1] See \div operator: http://www.dfcd.net/articles/latex/latex.html
Authors.txt
together with the project history into the Readme.gitignore
We have \mathrm, \mathit, \mathcal command, but it doesn't affect on rendering.
We should fix it first, before implementing #32 as math functions (sin, cos, log) have \mathrm style.
Full brace list we need to support:
\left.
\right.
(empty delimiter)\left(
\right)
\left[
\right]
\left\{
\right\}
\left<
\right>
\left|
\right|
There's a bunch of patches attached to the old repository tracker. I think it should be worth to check them out and apply to our codebase.
Ideally we should treat these patches as our own pull requests: we should try our best to reproduce the mentioned issues (probably even write the unit tests), and merge the changes afterwards. The maintainer on duty (well, probably myself) should notify the patch authors that the patches are being merged here.
I want the package to be published to NuGet. I don't think we need .NET 3.5 version, but 4.0 should be available.
It seems that array is not supported. Following expression does not work.
\left[\begin{array}1 & 2 & 3 & 4 & 5 \3 & 4 & 5 & 6 & 7 \end{array}\right]
Suggestions to add: dotnet, csharp, tex, mathematics, math/maths, rendering, graphics (include which ones you will)
Current parser is messy a bit: it uses ref
parameters all the way (especially after my #28). We need to refactor it and replace that with some alternate architecture that'll be easier to follow.
When building the project in Visual Studio 2015, I got this:
3>wpf-math\src\WpfMath.Tests\WpfMath.Tests.fsproj(102,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props.
It likely was broken by commit e67bc2a. Need to investigate.
Looks like we don't currently support some of common LaTeX delimiters [1]. We also have some uncommon delimiters, e.g. \left{
that should be \left\{
and weird \left\
.
[1] https://en.wikibooks.org/wiki/LaTeX/Mathematics#Brackets.2C_braces_and_delimiters
Current custom control would be cumbersome to use to produce paragraphs of text with inline math or longer flowing text with math as separate lines. See example below
http://marked2app.com/help/images/mathjax2.jpg
A control based on, e.g., a textbox, but with added handles such as [$, $] that uses the renderer would be a very useful addition.
EDIT
Did some research on this. Perhaps a using BlockUIContainer and InlineUIContainer inside a FlowDocument is a better way to go.
My mistake
We're currently providing some TTF files, but I can't find their license (it'd be unusual to find that the fonts are licensed by GPL, too). Some of them looks like Computer Modern (which is distributed under something marked as "Knuth license"). We need to find the source and properly attribute these files.
A better parser infrastructure for TeX syntax already exists in the MathTeX.NET project, which I worked on around the same time as the original version of WPF-Math. I don't mind using an alternative, but I do think we should refactor the parsing code into a proper, extensible project in another project, and have the core layout/rendering library only take an AST (abstract syntax tree) as input. That way we can then add other input syntaxes in a nice way (e.g. MathML). Of course, the rendering will later be split off from the core library too, but that can come later.
It might be nice to add support for MathML parsing as an alternative to TeX input. Just a thought. This is certainly not a priority, in my mind.
Trying the following string will yield an error:
d_{f,t}(u,v) = \sum_{x, y}\left(f(x, y) - t(x - u, y - v)\right)^2
I'd like the people from the outdated launchpad page to be aware about this resurrection of the original project. For that, I'd like the project description on Launchpad to include a link to GitHub.
To change the Launchpad description, I'd like to cooperate with the original project developer, @alexreg.
@alexreg, Alexander, hello and huge big thank you for your work on the original project! Could you please edit the project description on the Launchpad page?
I'm sort of library archaeologist, and I'm going to maintain the library fork, making it available on the new platforms and generally patch it the best I can.
Hello!
Please implement \overline
. This command doesn't work now.
Thanks.
While the copyright statement on the readme.md notes that the files from the JMathTeX project are licensed in MIT, this repository does not contain the permission notice.
I ask about this matter here.
Could you please add a communication trace of this permission to this repository, or a link to this permission? Our corporate overlords may then accept use of this library. Lots of thanks in advance!
I believe that we should highlight the minimal code sample to use our new formula control.
Hi,
Currently formulas are rendered pretty blurred.
Toying with the v0.3 version now it seems I'm unable to influence the rendering of the formula with any of the usual options, RenderOptions, TextOptions, UseLayoutRounding. I tried basically all combinations but to no avail. Can you give any hint on how to reduce the blur?
Btw, thx for the lightning speed in releasing v0.3 👍
To reduce boilerplate like this, I'd like to introduce simple macro support into TexPredefinedFormulaParser
. These should become simply like
<ApplyMacro name="simpleFunction"><MacroArgument value="sin" /></ApplyMacro>
<ApplyMacro name="simpleFunction"><MacroArgument value="cos" /></ApplyMacro>
so on.
(With simpleFunction
macro defined in the same file, of course.)
To avoid polluting our main formula dictionary (i.e. PredefinedTexFormulas.xml
) with various localized formula names (like this), I propose to add a dictionary extension mechanism.
Users should be able to provide theirs own dictionary files that will be merged with the existing definitions.
Also, these Russian localized definitions should be extracted from the default dictionary and should became opt-in functionality (I still want to redistribute them alongside WPF-Math because personally I need those, and I think they're generally useful for people around the world).
And don't forget to add end-user documentation explaining how to make and apply these definition files!
There are a lot of similar exceptions at start.
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'WpfMath.FormulaNotFoundException' in WpfMath.dll
I have the feature request from Russian F# StackOverflow chat: add arctg
and arcctg
functions. I think that's time to review the functions we have and add those trigonometric functions we still haven't.
Please note that the ordinary notation for tangent is tan
, but tg
is also a common extension I think.
Probably these should go into PredefinedTexFormulas.xml
.
My general experience about parsing dictates one simple rule: every parser should have a set of unit tests. Parsers are usually very complex beasts, but it's not that hard to test them: you just pass in some text sequences and compare parser output with stuff you expect.
I think that we'll add unit tests (and will set up CI to execute them) in #14.
Suppose I want to render LaTeX formula including Cyrillic characters: ЭЭ_E = t \cdot ПДУ
. WPF-Math should fall back to the default font or (preferably) allow the user to specify fallback, and it should actually render the text.
Texpaste allows this, for example (and it looks like it uses system-default fallback):
Currently WPF-Math fails with the "Unknown character" error on this formula.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.