inchar, outchar and linechar



On Tue, 2004-05-11 at 16:53, Jay Belanger wrote:

> On the off chance that my analysis is correct, here's a patch.
> It also checks to make sure that $inchar is not longer than mexplabel.

The more I look at this problem, the less clear I am on the desired
output. With your patch, I get the following:

---------------------------------------------------------
(%i1) x+y;

(%o1)                                y + x
(%i2) tex(%i1);


|(%i1) y+x;|
(%o2)                                (%i1)
(%i3) tex(%o1);

$$y+x\leqno{\tt (\%o1)}$$
(%o3)                               (\%o1)
---------------------------------------------------------

I think that is correct, so I am applying your patch.

On Tue, 2004-05-11 at 17:02, Jay Belanger wrote: 
> James Amundson <amundson@users.sourceforge.net> writes:
> ...
> > Unfortunately, it still gets the wrong answer when I set inchar to
> > foo and outchar to foobar. Suggestions welcome.
> 
> I suppose, if mexplabel matches inchar, it could check to see if
> mexplabel matches outchar, also.  The relevant part of tex1 (in
> mactex.lisp) could become
> 
> 	      ((and
> 		itsalabel ;; but is it a user-command-label?
>                 (<= (length (string $inchar)) (length (string mexplabel)))
> 		(eq (getchars $inchar 2 (1+ (length (string $inchar))))
> 		    (getchars mexplabel 2 (1+ (length (string $inchar)))))
>                 ;; Check to make sure it isn't an outchar in disguise
>                 (not
>                  (and
>                   (<= (length (string $outchar)) (length (string mexplabel)))
>                   (eq (getchars $outchar 2 (1+ (length (string $outchar))))
>                       (getchars mexplabel 2 (1+ (length (string $outchar))))))))
> 	       ;; aha, this is a C-line: do the grinding:
> 	       (format texport "~%|~a " mexplabel) ;delimit with |marks
> 	       (mgrind mexp texport) ;write expression as string
> 	       (format texport ";|~%"))

This looks good, too. I think you've covered my main concerns. Thanks!

--Jim