[texhax] combing adjacent macros

Dorothy Jammins dorothy.jammins at yahoo.com
Sat May 30 00:29:17 CEST 2009


Sorry I should have read it again before clicking send. Going back to the OP he wanted to achieve:

\hyph\var -> (hyph., var)Using the same definition for \hyph and \var, I was wondering if it was possible to achieve this:

\hyph\var -> $_{hyph., var}$ i.e. to combine the two and make them subscript at the same time whether they are already in a math environment or not.

Thanks for the tip with the apostrophe though. It gave me an idea for something else I needed to do.

d


----- Original Message ----
From: Donald Arseneau <asnd at triumf.ca>
To: texhax at tug.org; Toby Cubitt <toby-dated-1243764067.f1a243 at dr-qubit.org>
Sent: Thursday, May 28, 2009 2:58:38 PM
Subject: Re: [texhax] combing adjacent macros

Dorothy Jammins <dorothy.jammins at yahoo.com> writes:

> Can this be used to combine subscripts in equations? I've tried but 
> couldn't figure out how to ensure that the whole group would be in 
> math mode and subscript.

The subscript designator (_) is not usually a macro, so
it isn't redefined.  If you make it an active character
with a macro definition, then sure, you would look ahead
for another _ character (but no need for \expandafter).

What are you trying to achieve?  I don't understand that
second sentence at all.  I would think you would need
to look beyond intervening superscripts.

By the way, ' (apostrophe) has a definition in math
that does ^{\prime} but it looks ahead for another '
and combines them to give ^{\prime\prime}.  Maybe
you just want to copy that definition.

-- 
Donald Arseneau                          asnd at triumf.ca
_______________________________________________
TeX FAQ: http://www.tex.ac.uk/faq
Mailing list archives: http://tug.org/pipermail/texhax/
More links: http://tug.org/begin.html

Automated subscription management: http://tug.org/mailman/listinfo/texhax
Human mailing list managers: postmaster at tug.org



      



More information about the texhax mailing list