Re: @macro to accept hyphen

2020-11-09 Thread Christopher Dimech
> Sent: Monday, November 09, 2020 at 10:22 PM
> From: "Patrice Dumas" 
> To: "Gavin Smith" 
> Cc: "Christopher Dimech" , "help-texinfo gnu" 
> 
> Subject: Re: @macro to accept hyphen
>
> On Mon, Nov 09, 2020 at 08:07:02PM +, Gavin Smith wrote:
> > On Sun, Nov 08, 2020 at 10:56:46AM +0100, Christopher Dimech wrote:
> > > Have not seen a mathematical expression in the manual. Thusly I have 
> > > provided
> > > you with one.  Works perfectly, no problem with it. 
> > > 
> > > You have this sentence in the macro. 
> > > 
> > > To get a single ‘\’ in the macro expansion, use ‘\\’
> > > 
> > > Although the information is there, it is very cryptic.  If we include an 
> > > indented
> > > example with a real math expression, users will be immediately drawn to 
> > > it.   
> > 
> > I don't know if your use of math inside macros is likely to be
> > prevalent enough to warrant special mention.

In many Gnu Packages, much math expressions are not necessary.  But will become 
more
prevalent as more work is done on geophysical software (e.g., Gnu Behistun).
 
> I think that a special mention would stil be good even if it is likely
> that math in a macro is not prevalent, as it is probably the main case
> with \ appearing naturally in text.

Yep, it is very natural and a good example for many who want to use math 
expressions.
Macros become important for fundamental expressions that occur frequently in a 
given
field because they would have the advantage of simply calling them using 
popular names.
  

 
> -- 
> Pat
>



Re: @macro to accept hyphen

2020-11-09 Thread Patrice Dumas
On Mon, Nov 09, 2020 at 08:07:02PM +, Gavin Smith wrote:
> On Sun, Nov 08, 2020 at 10:56:46AM +0100, Christopher Dimech wrote:
> > Have not seen a mathematical expression in the manual. Thusly I have 
> > provided
> > you with one.  Works perfectly, no problem with it. 
> > 
> > You have this sentence in the macro. 
> > 
> > To get a single ‘\’ in the macro expansion, use ‘\\’
> > 
> > Although the information is there, it is very cryptic.  If we include an 
> > indented
> > example with a real math expression, users will be immediately drawn to it. 
> >   
> 
> I don't know if your use of math inside macros is likely to be
> prevalent enough to warrant special mention.

I think that a special mention would stil be good even if it is likely
that math in a macro is not prevalent, as it is probably the main case
with \ appearing naturally in text.

-- 
Pat



Re: @macro to accept hyphen

2020-11-09 Thread Gavin Smith
On Sun, Nov 08, 2020 at 10:56:46AM +0100, Christopher Dimech wrote:
> Have not seen a mathematical expression in the manual. Thusly I have provided
> you with one.  Works perfectly, no problem with it. 
> 
> You have this sentence in the macro. 
> 
> To get a single ‘\’ in the macro expansion, use ‘\\’
> 
> Although the information is there, it is very cryptic.  If we include an 
> indented
> example with a real math expression, users will be immediately drawn to it.   

I don't know if your use of math inside macros is likely to be
prevalent enough to warrant special mention.



Re: @macro to accept hyphen

2020-11-08 Thread Christopher Dimech
Have not seen a mathematical expression in the manual. Thusly I have provided
you with one.  Works perfectly, no problem with it. 

You have this sentence in the macro. 

To get a single ‘\’ in the macro expansion, use ‘\\’

Although the information is there, it is very cryptic.  If we include an 
indented
example with a real math expression, users will be immediately drawn to it.   



> Sent: Sunday, November 08, 2020 at 10:02 AM
> From: "Gavin Smith" 
> To: "Christopher Dimech" 
> Cc: "help-texinfo gnu" 
> Subject: Re: @macro to accept hyphen
>
> On Sun, Nov 08, 2020 at 01:15:06AM +0100, Christopher Dimech wrote:
> > Did not know about the doubling \\.  How is that?
> 
> It's explained in the manual.
> 
> > Could you include an example
> > of a macro with Mathematical expression?  Have written an example for you.
> > 
> > 
> > @macro Mtk
> > @tex
> > In spherical coordinates, the Laplacian Operator is $\\nabla^2 \\phi(r)$.
> > $$\\nabla^2 \\phi(r) =
> >   {1 \\over r^2} {\\partial \\over \\partial r}
> >   \\bigg\\lbrack r^2 {\\partial \\phi \\over \\partial r}\\bigg\\rbrack$$
> > @end tex
> > @end macro
> > 
> > @Mtk
> 
> Your example works perfectly; what is the problem with it?
>



Re: @macro to accept hyphen

2020-11-08 Thread Gavin Smith
On Sun, Nov 08, 2020 at 01:15:06AM +0100, Christopher Dimech wrote:
> Did not know about the doubling \\.  How is that?

It's explained in the manual.

> Could you include an example
> of a macro with Mathematical expression?  Have written an example for you.
> 
> 
> @macro Mtk
> @tex
> In spherical coordinates, the Laplacian Operator is $\\nabla^2 \\phi(r)$.
> $$\\nabla^2 \\phi(r) =
>   {1 \\over r^2} {\\partial \\over \\partial r}
>   \\bigg\\lbrack r^2 {\\partial \\phi \\over \\partial r}\\bigg\\rbrack$$
> @end tex
> @end macro
> 
> @Mtk

Your example works perfectly; what is the problem with it?



Re: @macro to accept hyphen

2020-11-07 Thread Christopher Dimech
Did not know about the doubling \\.  How is that?  Could you include an example
of a macro with Mathematical expression?  Have written an example for you.


@macro Mtk
@tex
In spherical coordinates, the Laplacian Operator is $\\nabla^2 \\phi(r)$.
$$\\nabla^2 \\phi(r) =
  {1 \\over r^2} {\\partial \\over \\partial r}
  \\bigg\\lbrack r^2 {\\partial \\phi \\over \\partial r}\\bigg\\rbrack$$
@end tex
@end macro

@Mtk



> Sent: Saturday, November 07, 2020 at 11:47 PM
> From: "Gavin Smith" 
> To: "Christopher Dimech" 
> Cc: "help-texinfo gnu" 
> Subject: Re: @macro to accept hyphen
>
> On Sat, Nov 07, 2020 at 11:29:54PM +0100, Christopher Dimech wrote:
> >
> > I have seen that mathematical expressions are not displayed
> > when called within a macro.
> >
> > @macro Regu
> > @tex
> > \alpha
> > @end tex
> > @end macro
> >
> > @Regu
> >
> > @tex
> > \beta
> > @end tex
>
> \alpha and \beta need to be in math mode, and the macro works OK if
> you double the backslash.
>
>
> @macro Regu
> @tex
> $\\alpha$
> @end tex
> @end macro
>
> @Regu
>
> @tex
> $\beta$
> @end tex
>
>



Re: @macro to accept hyphen

2020-11-07 Thread Gavin Smith
On Sat, Nov 07, 2020 at 11:29:54PM +0100, Christopher Dimech wrote:
> 
> I have seen that mathematical expressions are not displayed
> when called within a macro.
> 
> @macro Regu
> @tex
> \alpha
> @end tex
> @end macro
> 
> @Regu
> 
> @tex
> \beta
> @end tex

\alpha and \beta need to be in math mode, and the macro works OK if
you double the backslash.


@macro Regu
@tex
$\\alpha$
@end tex
@end macro

@Regu

@tex
$\beta$
@end tex




Re: @macro to accept hyphen

2020-11-07 Thread Christopher Dimech


I have seen that mathematical expressions are not displayed
when called within a macro.

@macro Regu
@tex
\alpha
@end tex
@end macro

@Regu

@tex
\beta
@end tex

> Sent: Saturday, November 07, 2020 at 10:38 PM
> From: "Gavin Smith" 
> To: "Christopher Dimech" 
> Cc: "help-texinfo gnu" 
> Subject: Re: @macro to accept hyphen
>
> On Sat, Nov 07, 2020 at 08:23:50PM +0100, Christopher Dimech wrote:
> > Would it be possible to allow macro names to use hyphens?
> >
> > @macro Regexp-EsnStruct
> >   Body
> > @end macro
>
> It's a reasonable question, but it could cause horrendous problems
> with TeX.  There is already special treatment of hyphens in various
> contexts (monospaced font, URL's, etc.) and trying to support hyphens
> in macro names could easily break in one of these contexts.  In fact,
> digits are not even supported: only the 26 lower-case letters and 26
> upper-case letters.
>



Re: @macro to accept hyphen

2020-11-07 Thread Gavin Smith
On Sat, Nov 07, 2020 at 08:23:50PM +0100, Christopher Dimech wrote:
> Would it be possible to allow macro names to use hyphens?
> 
> @macro Regexp-EsnStruct
>   Body
> @end macro

It's a reasonable question, but it could cause horrendous problems
with TeX.  There is already special treatment of hyphens in various
contexts (monospaced font, URL's, etc.) and trying to support hyphens
in macro names could easily break in one of these contexts.  In fact,
digits are not even supported: only the 26 lower-case letters and 26
upper-case letters.



@macro to accept hyphen

2020-11-07 Thread Christopher Dimech
Would it be possible to allow macro names to use hyphens?

@macro Regexp-EsnStruct
  Body
@end macro