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

Suggestion: use another symbol for Mathpad expressions #4

Open
ThiagoRangel7 opened this issue Dec 2, 2022 · 3 comments
Open

Suggestion: use another symbol for Mathpad expressions #4

ThiagoRangel7 opened this issue Dec 2, 2022 · 3 comments

Comments

@ThiagoRangel7
Copy link

Mathpad uses the same symbols as the Markdown inline code and code blocks use (the backtick ` for inline and triple backticks ``` for code block) to identify expressions that should be evaluated.

The problem is: suppose I want to write an inline code like x+3==?, that is NOT a Mathpad expression, and should NOT be rendered to LaTeX or evaluated. I just want to show the code inline.

That's impossible, because Mathpad will automatically render it as:
$$x+3=x+3$$

Suggestion: use another symbol for Mathpad expressions instead of the backtick `.
For example: @x+3==?@ instead of `x+3==?` and

@@@
  a:=10
  f(x):=x+3
  f(a)==?
@@@

instead of using triple backticks ```

@Canna71
Copy link
Owner

Canna71 commented Dec 11, 2022

Thank you for your feedback. Mathpad is leveraging the already existing support for code blocks and inline code that Obsidian provides. Switching to a different syntax would mean to re-do a lot of the extension to the CodeMirror grammar that Obsidian already did.
What I was planning on doing is to make some of the syntax configurable, so that - for example - in order to evaluate an expression you could also write: x+3%^$ or anything you fancy.

Would that be OK?

@ThiagoRangel7
Copy link
Author

Thank you for your feedback. Mathpad is leveraging the already existing support for code blocks and inline code that Obsidian provides. Switching to a different syntax would mean to re-do a lot of the extension to the CodeMirror grammar that Obsidian already did. What I was planning on doing is to make some of the syntax configurable, so that - for example - in order to evaluate an expression you could also write: x+3%^$ or anything you fancy.

Would that be OK?

I imagined that there would be a limitation like that.

I think codeblocks are actually fine the way they are, since we have to type "mathpad" after the three backticks in order for it to be evaluated (like ```mathpad).

For inline code, I liked your idea of making it configurable, but I would like to suggest the ability to place something before and after the expression instead of only after it (keeping it inside the backticks). For example: `@mathpad@ x+3=?` (which is configured to evaluate if there's @mathpad@ before the expression) or even `@ x+3=? $` (which is configured to evaluate if there's a @ before, and if there's a $ after the expression.

Then these "configurable" characters should be hidden on Live Preview and Reading modes, to show only the expression and the result.

Of course I don't know if there are any limitations that make it impossible, so it's just an idea.

@Canna71
Copy link
Owner

Canna71 commented Dec 14, 2022

That should be feasible, of course I would add it as an optional configuration, since - at least for me - it is important to be able to insert calculation as simply as possible.
I'll work on that.

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

2 participants