-
Notifications
You must be signed in to change notification settings - Fork 38
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
Specialized Support for Arrays #15
Comments
I agree, this is a common pain point for me as well, and I've been mulling over solutions in my head for a while. Getting the workflow right is tricky, but I'm happy to discuss possibilities. Although the examples you listed share a common syntax, I think they appear in quite different contexts and will need to be handled differently. We will also be limited by the commands supported by KaTeX / MathJax.
|
Cool! Your points about differences in context implying differences in handling make a lot of sense to me. I'll mull over. Quick comments: quiver seems to generate tikz blocks, but katex does not support tikz's environments (I think). It seems they support the amscd "CD" environment (CD stands for commutative diagram), which is a very bare bones package that can express perhaps 80% of the simple diagrams a math student might draw and that can render them correctly perhaps 80% of the time. matrices as sub-expressions : the general design problem is as you mention tricky, so I'll discuss the much easier case where I'm allowed to overfit to my own tastes 😄. I would feel happy if the example given is auto formatted to look like
However, I can imagine folks and cases that favor a more compact style such as:
Here, only the "hard-to-parse" first matrix is formatted in an aligned way. I don't see how to approximate this latter style programatically --- or whether to so attempt would be useful. multiline derivations: i bet the following two rules are common to many personal styles:
For example, both hold in the example you showed (for for the two values of k, we have c=0 and then c=4). So perhaps something good here be to insert spaces according to this "weak rule" rather than insisting on a canonical form. Thus, the formatter would not override extra newlines and extra indentation provided by the user. Here's a simple example of what it would love to see when modifying a multiline derivation. Say we start with
Upon replacing "cow" by "iamafundamoomentallygoodcow", we see
Then, upon replacing the "\rangle" by ")", we see
|
As for diagrams, here are what some that come to mind. They go from most to least common and from least to most complex. From the implementation standpoint they are similar: each is a combination of basic parts. But from the usability standpoint each might say something different about what interfaces best aid mathematical writing. lifting diagram
causal model
naturality
finite-state automaton
|
Let me know if any of these ideas sounds like a good starting point that I might try to implement! |
I think we agree on the rough ux, so I'm happy to continue the feedback loop with you if you start on a prototype! Some things to ponder:
|
One of the most annoying-times-frequency things among my latex experiences is making 2d grids by describing them using 1d text. Such grids include matrices, commutative diagrams, tables, multi-line derivations whose terms are aligned, and more. It'd be neat to provide a special "array mode" for parsing and editing text of the form
This is the syntax for the latex body in each of all four examples above. The cells(' latex expressions) will typically all differ in length, creating a headache (do we spend time inserting white-space to align the columns, maintaining this alignment when we modify the cells? or do we ignore alignment issues in the source code and just count in our head when editing each row?)
It would be nice if when one's cursor enters a latex block of the above form, the cells in the latex block automatically align (wrt the ampersands and line-break symbols). If I correctly understand the spirit of prosemirror-math, one wants to avoid having popup dialog boxes or editors separate from the text. So perhaps the alignment could be as simple as inserting appropriate whitespace when the block is "active"!
The text was updated successfully, but these errors were encountered: