jed-users mailing list

[2011 Date Index] [2011 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [Jed-users-l] [PATCH] TeX mode: Replace three dots by \ldots instead of {\ldots}


On Thu, 12 May 2011 at 11:15:20 -0400, John E. Davis wrote:
> Carlos R. Mafra <crmafra2@xxxxxxxxx> wrote:
> > diff --git a/lib/texcom.sl b/lib/texcom.sl
> > index 4a75906..5f0151b 100644
> > --- a/lib/texcom.sl
> >+++ b/lib/texcom.sl
> > @@ -236,7 +236,7 @@ define tex_ldots ()
> >  	  {
> >  	     go_left (2);
> >  	     deln (2);
> > -	     insert ("{\\ldots} ");
> >+	     insert ("\\ldots ");
> >  	     return;
> >  	  }
> >       }
> 
> How do you feel about using "\\ldots{}" instead?  Note that I
> purposely omitted the trailing space.

Now that you mention, I'd prefer

+	     insert ("\\ldots");

instead; ie no trailing space nor {}.

I always find myself typing things like (inside math mode)

A(1,2,..., N) and T_{12... n}

and that should ideally become

A(1,2,\ldots, N) and T_{12\ldots n}
 
> I like your idea of using \cdots if proceeded by a binary operator.

Nice! That's Knuth's recommendation on p.172 of "The TeXbook".

I guess one could have something like:

define tex_ldots ()
{
   if (blooking_at (".."))
     {
	ifnot (tex_is_verbatim_environment ())
	   {
	     if (tex_is_after_binary_operator ())
	       {
	         go_left (2);
	         deln (2);
	         insert ("\\cdots");
	         return;
	       } else {
	         go_left (2);
	         deln (2);
	         insert ("\\ldots");
	         return;
	       }
	  }	  
     }
   insert_char ('.');
}

but I don't know enough to come up with tex_is_after_binary_operator().
_______________________________________________
Jed-users-l mailing list
Jed-users-l@xxxxxxxx
http://mailman.jtan.com/mailman/listinfo/jed-users-l


[2011 date index] [2011 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]