# \newenvironment #37

Open
opened this Issue Sep 15, 2014 · 10 comments

Projects
5 participants

### felipellrocha commented Sep 15, 2014

 Are there any plans to add support for \newcommand, and \newenvironment?
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 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.
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 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.
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?
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.

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.
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.

Closed

Closed

Closed

Closed

Closed

### sebastianpantin pushed a commit to sebastianpantin/KaTeX that referenced this issue Sep 17, 2017

 Merge pull request KaTeX#37 from mrAlbert-development/20170621-getTut… 
…oredViews

20170621 get tutored views
 f5e9c21 

Closed

Closed

Member

### kevinbarabash commented May 28, 2018

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

Member

### ylemkimon commented Jun 7, 2018

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

Merged