Help with Latex environments

2 views
Skip to first unread message

rsvaliveti

unread,
Jun 17, 2006, 6:11:52 PM6/17/06
to LaTeX Users Group
Hello,
I have been a Latex user for quite some time, but haven't done any
serious TeX macro programming etc. I want to define two new
environments as follows:

1) Tala
This environment is essentially a thin wrapper for the tabular
environment in LaTeX. This environment takes one mandatory argument
which consists of a list of comma separated integers specifying the
beat cycle. Thus for example, when this environment is invoked as
\begin{tala}{4,2,2}, it should translate to the LaTeX sequence
\begin{tabular}{lcccc| @{\hspace{0.5cm}} cc| @{\hspace{0.5cm} cc|}.
That is, each integer in the argument generates a number of columns in
the tabular environment; commas in the argument are used to generate
intercolumn gaps at the specified boundaries. The evironment adds one
more column to the list specified by the user; this is the first column
in the table, and is used to record a kind of ``measure number''.
end{tala} simply maps to \end{tabular}.

2) trans
I would like to define a new environment which processes the text
contained within the \begin{trans} and \end{trans} delimiters, and
alters it according to specific criteria. A simple example of this type
of processing would to to capitalize every letter in the text. For the
specific application I have in mind, I would like to translate
character sequences to other replacement strings. Thus, for example,
the string "sh" in the input would translate to \'s, which, when
processed, would produce the accented 's'. I would like that this
enviroment (a) works within the tabular environment and (b) Leaves all
command sequences unalterred. e.g.

\begin{tabular}{ccc}
\begin[trans}
abc & {\bf sh} & gu \\
\end{trans}
\end{tabular}

should produce output equivalent to that produced by:
\begin{tabular}{ccc}
abc & {\bf \'s} & gu \\
\end{tabular}

Any help you can offer in writing these environments is very
appreciated. It is enough if you can point to some examples; I can take
it from there.

thanks,
radha

Reply all
Reply to author
Forward
0 new messages