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

\newenvironment #37

Open
felipellrocha opened this Issue Sep 15, 2014 · 10 comments

Comments

5 participants
@felipellrocha
Copy link

felipellrocha commented Sep 15, 2014

Are there any plans to add support for \newcommand, and \newenvironment?

@xymostech

This comment has been minimized.

Copy link
Contributor

xymostech commented Sep 15, 2014

There are plans, but we're trying to figure out a good way to do this. For example, do we want to support such things inline or do they need to be included in the configuration? We'll keep this updated with info.

@felipellrocha

This comment has been minimized.

Copy link

felipellrocha commented Sep 15, 2014

It sounds like to me supporting both would be ideal. Order of priority would be, native, configuration, inline. Where native functions would get loaded first, overwritten by configuration, overwritten by inline. That way I could experiment inline (it just doesn't render anything on the page), and once I'm comfortable with that, I'd move things to the configuration side.

@xymostech

This comment has been minimized.

Copy link
Contributor

xymostech commented Sep 15, 2014

The problem with supporting things inline is if you have user input, then you don't want one user's macros to collide with your code. Maybe we could have a setting for disabling macros, or groups of code that should share macros?

@felipellrocha

This comment has been minimized.

Copy link

felipellrocha commented Sep 15, 2014

Though I still think a disabling option should be added for inlines, I think in latex, officially, you should only overwrite a defined macro if you use \renewcommand and \renewenvironment. If the user is using one of those two, they probably know what they're doing.

@xymostech

This comment has been minimized.

Copy link
Contributor

xymostech commented Sep 15, 2014

What if two users wanted to define the same macro? Would one of them not be able to? Even worse, would the macro that ends up being used depend on which expression was rendered first?

@sophiebits

This comment has been minimized.

Copy link
Contributor

sophiebits commented Sep 15, 2014

If we support \newcommand directly, I would lean towards scoping the definitions to the expression they're defined in, and perhaps there can be a separate global configuration for macros shared across the whole page.

@kevinbarabash

This comment has been minimized.

Copy link
Member

kevinbarabash commented Sep 18, 2014

I'm in the process implement \def. I have it working for simple macros without parameters. I need to do a little code cleanup and then I'll commit. I'd like to get some feedback before going further.
screen shot 2014-09-17 at 8 31 47 pm
screen shot 2014-09-17 at 8 31 49 pm

@kevinbarabash

This comment has been minimized.

Copy link
Member

kevinbarabash commented Sep 22, 2014

I had committed some code for this, but I had some issue with my fork so I ended up doing a hard reset. I still have the code locally, but the approach I was taking had a severe limitation. It wouldn't have been able to parse things like \def\oneover{\frac{1}}. There are some other smaller pull request that I want to get accepted first before I tackle this again.

@kevinbarabash

This comment has been minimized.

Copy link
Member

kevinbarabash commented May 28, 2018

Changing this to \newenvironment only since #250 covers \newcommand.

@kevinbarabash kevinbarabash added this to the Version 2.0 milestone May 28, 2018

@ylemkimon

This comment has been minimized.

Copy link
Member

ylemkimon commented Jun 7, 2018

Please note that \newcommand support has been added in #1382.

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