Open Happypig375 opened 5 years ago
Please can you keep the "Core" of the CSharpMath, out of the need for "Rendering and editor" as this allows it to be used for other frameworks, i.e. Services only.
What are these services and how would CSharpMath be used without rendering?
@charlesroddie
MathList etc.
- using internal methods - into different usage and logic trees, dependent on wrapped metadata and context.Other frameworks can still be used.
Editing capabilities will be baked into MathAtoms.
Streamline the use of CSharpMath APIs.
Very good but not sure about the example. I don't think that we should add extension methods to string
! If you are creating object B from A then B.FromA(a:A)
is often better because usually A can be defined without reference to B but not vice versa.
Replace mutable global variables with settings objects.
Sounds good.
Reduce legacy boilerplate code from iosMath.
Great.
Simplify the NuGet chain. It's not obvious what CSharpMath.Rendering does based on its name. CSharpMath, CSharpMath.Editor and CSharpMath.Rendering should be merged into one. Typography should be integrated directly into CSharpMath because
That's not a significant problem for users. If the projects have a natural structure where later projects naturally depend on earlier ones, then having things in separate projects enforces that ordering, unlike C# code in the same project. I don't know if this is the case with the current CSharpMath projects though.
An update since the original post:
\def
, \DeclareMathOperator
etc.New items:
CSharpMath.Rendering.Text
into CSharpMath.Atom
. In LaTeX, \text
enables text-mode inside math-mode. With a separate implementation of CSharpMath.Rendering.Text
, this is impossible. It is also undesirable to maintain two LaTeX parsers and two LaTeX trees at the same time. Moreover, this results in difference functionality between CSharpMath.Atom
and CSharpMath.Rendering.Text
, e.g. CSharpMath.Atom
supports \colorbox
while CSharpMath.Rendering.Text
supports \fontsize
, when such functionality should be present on both implementations. With #143, the same parser can be reused for both math-mode and text-mode with swappable command dictionaries.An open question is whether to support (MathList->Text LaTeX) on top of (MathList->Math LaTeX). Math LaTeX seems enough for everyday use.
The remaining items will be done as "Parser refactor (part 2)", blocked on #143.
Note for implementing display math inside text: as seen in http://www.dfcd.net/articles/latex/latex.html, we can add a center
environment that helps the implementation.
Is your feature request related to a problem? Please describe. Currently, the APIs for CSharpMath are not intuitive at all. For example, to convert MathList->TeX, one has to call
MathListBuilder.MathListToString
which is a static method (not easy to discover), and its name doesn't imply anything about the result being a TeX string at all.Describe the solution you'd like
Streamline the use of CSharpMath APIs.
Replace mutable global variables with settings objects. e.g.
CSharpMath.Atoms.MathAtoms
contain multiple dictionaries that act as hidden dependencies. They should be made obvious.Reduce legacy boilerplate code from iosMath. e.g. Why do some math atoms have their respective interfaces? It's not like MathAtoms will have alternate implementations, they are just data containers. If they are to be extended, they can be inherited. e.g. Reduce boilerplate folders. They scare new contributors. Most folders in
CSharpMath/
contain few files anyway. e.g. Remove CSharpMath.Enumerations.MathAtomType. Use pattern matching on types instead.Simplify the NuGet chain. It's not obvious what
CSharpMath.Rendering
does based on its name.CSharpMath
,CSharpMath.Editor
andCSharpMath.Rendering
should be merged into one. Typography should be integrated directly into CSharpMath becauseSource: https://github.com/Jolg42/awesome-typography#c-2
It's not like there is or will be any other implementations for font reading of math fonts.
Describe alternatives you've considered Continuing the current API and result in a degraded user experience.
Difficulty: How difficult would it be? (Trivial, Very Easy, Easy, Moderate, Hard, Very Hard, Tedious, Backbreaking) Very hard. A lot of time will be needed to achieve this.
Additional context
57