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

Missing infix operators for mathematics #246

Closed
joshniemela opened this issue Feb 1, 2023 · 5 comments
Closed

Missing infix operators for mathematics #246

joshniemela opened this issue Feb 1, 2023 · 5 comments

Comments

@joshniemela
Copy link

latexify("a ∈ b") results in L"$\in\left( a, b \right)$" and should probably return L"$a \in b$".
\forall and \exists and probably other infix operators result in a crash.

@gustaphe
Copy link
Collaborator

gustaphe commented Feb 3, 2023

Neither \forall nor \exists are infix in julia:

julia> Meta.isbinaryoperator.((:∀, :∃))
(false, false)

, but \forall could be implemented. Do you think \exists should be treated as infix? I can't recall ever seeing it used as such. And do you have other ideas for operators that should be infixed?

@joshniemela
Copy link
Author

joshniemela commented Feb 4, 2023

Yep you're right, exists isn't supposed to be infix but the others should be, I don't really have any operators in mind at the moment, maybe a lot of the logical operators if they don't already infix themselves. I'm currently working on a project: https://github.com/joshniemela/ProgrammaticLaTeX.jl/ and ideally i'll use latexify instead of having to rewrite it all for my own purposes which are mostly computer science and theoretical mathematics / probability theory.

@jakobjpeters
Copy link

jakobjpeters commented Mar 11, 2023

My package wants to handle infix operators too, which is done incorrectly.

EDIT: I'm not currently aware of any way to generate the correct latex from something like p ∧ q

@jakobjpeters
Copy link

I discovered that you need to wrap the string in a Symbol. This should be documented though.

julia> latexify(Symbol("a ∈ b"))
L"$a \in b$"

@gustaphe
Copy link
Collaborator

Could I ask you guys to try out #296 ? It's difficult to test if this works right, since it is partially taste.
Specifically, I want to know if parentheses work as you expect, and if there are any operators you miss.

@gustaphe gustaphe closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants