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

Support UTF8 #82

Closed
abozanona opened this issue May 20, 2017 · 14 comments
Closed

Support UTF8 #82

abozanona opened this issue May 20, 2017 · 14 comments
Assignees

Comments

@abozanona
Copy link

Can you support UTF8 symbols? I can't add symbols from other languages than English!

@ForNeVeR
Copy link
Owner

Thanks for the report. That issue is definitely on the radar, see #35. In the meantime, please try to use \text{...} workaround as suggested in #35 (comment).

@alexreg
Copy link
Collaborator

alexreg commented May 20, 2017

Generally, the only symbols allowed in maths are the letters from the Latin, Greek, and occasionally Hebrew alphabets. Do we really need general support for other character sets?

@ForNeVeR
Copy link
Owner

ForNeVeR commented May 20, 2017

Yes, we need (if possible). I'm using Cyrillic in my maths all the time :)

Yes, Cyrillic characters are sometimes used as actual math symbols and not only text annotations; some of the areas in my scientific field (computational electrodynamics) are full of those ПЯП = ЮЭ² and so on.

@alexreg
Copy link
Collaborator

alexreg commented May 20, 2017

Hmm, I see. I guess it's only something done in countries where Cyrillic is the ordinary script anyway... explains why we never see it in the West. I wonder if Chinese characters are used, even...

Even in Russia, Latin characters are more common though, right?

@ForNeVeR
Copy link
Owner

ForNeVeR commented May 20, 2017

These are extremely rare in international papers, but they aren't uncommon in the local documentation (especially in government regulations and patent descriptions).

Also I have to translate these symbols myself when I'm writing papers for international journals, and that generally confuses everyone (both local and foreign reviewers, my teammates, myself).

Please note that in my experience TeX doesn't allow any non-standard characters outside of the \text{} blocks, so I'm not sure if we have to implement that as stated in #35. We'll probably need some additional research in that (e.g. how LuaTeX or XeTeX handles that; what about MathJAX, so on). We're open to suggestions.

@abozanona
Copy link
Author

abozanona commented May 20, 2017

I tried to use \text{SOME TEXT HERE} but it didn't work Unknown symbol or command or predefined TeXFormula: 'text'

If it's not allowed to use symbols other than the standard ones, maybe you could declare an array of the positions of non-standard symbols in the equation so We can replace it in the string by \text{number of cats}

@alexreg
Copy link
Collaborator

alexreg commented May 20, 2017

Can you post exactly what you're doing? The \text{...} command works just fine for us!

@abozanona
Copy link
Author

I've downloaded the WpfMath.dll file to my project from NuGet Manager V0.3.0, I'm using vb.net

Private Function ParseFormula(input As String) As TexFormula
    ' Create formula object from input text.
    Dim formula As TexFormula = Nothing
    Try
        txtEquation.ForeColor = Color.Black
        formula = Me.formulaParser.Parse(input)
    Catch ex As Exception
        txtEquation.ForeColor = Color.Red
    End Try

    Return formula
End Function

When I try to parse \text{abc} it gives me the exception Unknown symbol or command or predefined TeXFormula: 'text'

@abozanona
Copy link
Author

I tried to type the same command on the application I downloaded from here and it gives me the same error
image

@alexreg
Copy link
Collaborator

alexreg commented May 20, 2017

Try 0.3.1 for a start.

@abozanona
Copy link
Author

I tried now to upgrade to 0.3.1 from NuGet manager but it didn't work either.

@alexreg
Copy link
Collaborator

alexreg commented May 20, 2017

Okay. @ForNeVeR can answer this hopefully. You've definitely set something up wrong on your end, however...

@ForNeVeR ForNeVeR self-assigned this May 21, 2017
@ForNeVeR ForNeVeR removed their assignment May 21, 2017
@ForNeVeR ForNeVeR self-assigned this May 22, 2017
ForNeVeR added a commit that referenced this issue May 27, 2017
@ForNeVeR
Copy link
Owner

ForNeVeR commented May 27, 2017

Well, it won't be an easy task. I've started the work in the branch, and currently I'm struggling with TexFontInfo. It seems that we'll need to somehow extract TexFontInfo from the real system fonts.

@ForNeVeR
Copy link
Owner

ForNeVeR commented Jun 17, 2017

Well, guys, we have rudimentary support for UTF-8 now.

I wasn't able do everything in one go, so now new features in that direction will depend on our dear users' needs. Feel free to open new tickets regarding concrete features we lack.

As an example, this will now work:

\frac{\text{ЭЭ}}{\text{ЭЭ}_{2}}

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

No branches or pull requests

3 participants