[LyX/master] Implement properly \limits and \nolimits

Jean-Marc Lasgouttes lasgouttes at lyx.org
Wed Sep 9 10:01:32 UTC 2020


Le 09/09/2020 à 11:00, Enrico Forestieri a écrit :
>> Do you have a concrete case in mind where deriving requirements from the
>> contents of the macro goes wrong? Note that in this case, we could decide
>> that the requirements given to the macro override whatever is decided from
>> its contents.
> 
> The point is that the macros defined in the symbols file are only used
> for on-screen representation. Their definition will never appear in the
> output. So, if \int is defined in the symbols file as
> 
> \def\int{\intop\nolimits}	esint|amsmath
> 
> meaning that it requires either esint or masmath, the requirements for
> \intop should not be taken into account because \intop will never
> appear in the latex file. 

But \intop can appear in a LaTeX file, and it should work. So we have to 
set the requirements of \intop anyway.

> Here, the definition of \int is only used
> for representing it on the screen. For example, if you define
> 
> \def\int{\vcentcolon}		esint|amsmath
> 
> because you like to see \vcentcolon instead of \int on screen, then
> you would get the package mathtools as a requirement. But \vcentcolon
> does not really appear in the output and that requirement is bogus.

I understand that but:

1/ we do not want to do such bogus things in symbols file, unless you
    have a better use case in mind.

2/ this is why I proposed that in the case where requirements are given
    for the macro, the requirements induced by the definition are
    skipped.

The proposal 2/ is of course not 100% precise, since it is difficult to 
make a difference between "no requirement needed" and "no requirement 
given".

But in practice it seems easier in terms of maintenance to let LyX infer 
the requirements.

JMarc


More information about the lyx-devel mailing list