Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give a range of source string to Box #115

Closed
yamamoto-reki opened this issue Feb 22, 2018 · 19 comments · Fixed by #123
Closed

Give a range of source string to Box #115

yamamoto-reki opened this issue Feb 22, 2018 · 19 comments · Fixed by #123
Assignees

Comments

@yamamoto-reki
Copy link
Contributor

yamamoto-reki commented Feb 22, 2018

Hello!

I think it would be better Box has range information of source string.
Because it is very convenient when making formula editor.
What do you think about that ?

Thanks.

@ForNeVeR
Copy link
Owner

Well, that's a good idea and it's a direction I'd like the project to evolve.

Yes, we could add a source range information to Atoms and, in extension, to Boxes. It shouldn't be too hard to implement (although it'll be a bit tricky in the command handling code because currently it loses the original source information inside of the command).

@alexreg
Copy link
Collaborator

alexreg commented Feb 22, 2018

Definitely. I think these are generally called source “spans” in compiler terminology. We’d probably want to transition to a proper parser first though, to make the job easier. @ForNeVeR, how far did you get with integrating TeX.NET into this project?

@ForNeVeR
Copy link
Owner

@alexreg it looks like you missed the word "parser" in your comment ,)

Unfortunately, I haven't integrated anything from TeX.NET. I think I've built the project though, and that's all for now.

@yamamoto-reki
Copy link
Contributor Author

Actually I've already coded it. Can I do the pull request?

@ForNeVeR
Copy link
Owner

That's great. Yes, sure, please send a PR!

@alexreg
Copy link
Collaborator

alexreg commented Feb 22, 2018

@ForNeVeR Yep, oops, that's what happens when I type on mobile... well, you got the point. :-)

yamamoto-reki added a commit to yamamoto-reki/wpf-math that referenced this issue Feb 23, 2018
@ForNeVeR
Copy link
Owner

@yamamoto-reki hi, if you need any help on making your first pull request, I'm ready to provide assistance 😄

I can see that you've forked the project and added a commit to address this issue. Are you aware that now you should send a pull request using the "New pull request" button here?

image

yamamoto-reki added a commit to yamamoto-reki/wpf-math that referenced this issue Feb 23, 2018
@yamamoto-reki
Copy link
Contributor Author

@ForNeVeR Thank you very much.
I was a little nervous because I was the first pull request.
As much as possible, I tried hard not to disturb the structure of the original code, how about you?

@ForNeVeR
Copy link
Owner

@yamamoto-reki you did everything well. Allow me to congratulate you on making your first pull request 🥇

I have a small comment though (no need to change anything right now, just consider for future pull requests): it's advisably to always make new branch in your git repository (e.g. text-spans) and send a pull request from that branch and not directly from master. That'll help you to separate your new changes (if any) from the pull request.

I'll review the changes in more detail a bit later (ETA ≤ 6 hours). At a first glance, your changes are good and I'll likely merge them, so thank you! 👍

@ForNeVeR ForNeVeR self-assigned this Feb 23, 2018
@yamamoto-reki
Copy link
Contributor Author

I'm sorry.
I missed out some code on pull request. (Mainly inside of CharAtom.CreateBox().)
I'll fix it tomorrow. Also, I correspond to various Atoms / Boxes.

I want to make Formula editor quickly.

@ForNeVeR
Copy link
Owner

@yamamoto-reki you can push new commits to your master branch and they will automatically be added to your pull request. That's okay, take your time 😄

@ForNeVeR
Copy link
Owner

@yamamoto-reki also you should take a look at https://github.com/verybadcat/CSharpMath library. I'm not sure what will be better for your formula editor, but I'd like to keep you informed.

@Happypig375
Copy link

CSharpMath currently only has a Xamarin.iOS backend, but I am currently developing a SkiaSharp backend, which will work on Xamarin.Mac+Xamarin.iOS+Xamarin.Android+Windows(WPF or UWP)+Xamarin.Forms, which hopefully will help. 😉

@yamamoto-reki
Copy link
Contributor Author

@ForNeVeR @Happypig375
Thank you for telling me the existence of CSharpMath. I would like to refer to it.
Perhaps I may be able to help with CSharpMath.

Actually I have already made an editor for LaTeX that can use the formula palette. I am currently using WpfMath for preview.

I think that highlights are synchronized between the preview and mathematical text, and if it can be entered on the preview side, it will be a very rich editor.

@Happypig375
Copy link

/cc @charlesroddie

@charlesroddie
Copy link

@yamamoto-reki Very interested in an editor. CSharpMath is a port of iosMath and MathEditor extends iosMath. So there is a path to get an editor to CSharpMath. I only had some initial thoughts on an editor, which I was going to do in F# eventually, but it may be easier to get an editor onto CSharpMath by porting MathEditor.

How far progressed is your own editor and is that also in C#?

@alexreg
Copy link
Collaborator

alexreg commented Feb 24, 2018

Let's keep discussion here to WPF-Math and it's derivatives, please.

@yamamoto-reki
Copy link
Contributor Author

@alexreg Thank you. I will discuss it here.

@charlesroddie The Formula Editor I'm creating did not refer to any other editors at all.
Development is done in C #.

The formula editor consists of a TextBox, a palette with buttons for inserting and replacing expressions and symbols, and a preview with WpfMath.
I implemented it to share the highlight between preview and TextBox.

However, there is a problem with its function, I have not disclosed it to the public.
The editor has its own LaTeX parser different from WpfMath.
This is to synchronize the preview highlight with the text highlight.
However, due to some differences between WpfMath and my parser, this feature was incomplete.

So, I thought that extending this function with WpfMath is correct, proposed here and started the implementation.

By implementing this function you can publish the formula editor.

@charlesroddie
Copy link

charlesroddie commented Feb 25, 2018

OK I was looking to have a single visual editor which may have a palette but doesn't show any LaTeX to users or require them to know or use LaTeX. MathQuill does this in the javascript world and MathEditor on iOS. #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants