For Programmers: Free Programming Magazines  


Home > Archive > Tex > October 2006 > how to gobble options in an environment









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to gobble options in an environment
steve

2006-10-30, 7:44 pm

I find that I use some environments with the same options all the time.
I would like to replace

\begin{A}[X=x,Y=y]
stuff...
\end{A}

with

\begin{B}
stuff...
\end{B}

Is there an easy way to do this?

Steve
Enrico Gregorio

2006-10-30, 7:44 pm

steve <fisk@bowdoin.edu> wrote:

> I find that I use some environments with the same options all the time.
> I would like to replace
>
> \begin{A}[X=x,Y=y]
> stuff...
> \end{A}
>
> with
>
> \begin{B}
> stuff...
> \end{B}
>
> Is there an easy way to do this?


\newenvironment{B}{\begin{A}[X=x,Y=y]}{\
end{A}}

Or is there something that I don't understand?

Ciao
Enrico
David Kastrup

2006-10-30, 7:44 pm

Enrico Gregorio <gregorio@math.unipd.it> writes:

> steve <fisk@bowdoin.edu> wrote:
>
>
> \newenvironment{B}{\begin{A}[X=x,Y=y]}{\
end{A}}
>


It may be better to do
\newenvironment{B}{\A[X=x,Y=y]}{\endA}
since special code for ending environments might then work somewhat
closer to expectations.

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Enrico Gregorio

2006-10-30, 7:44 pm

David Kastrup <dak@gnu.org> wrote:

> Enrico Gregorio <gregorio@math.unipd.it> writes:
>
>
> It may be better to do
> \newenvironment{B}{\A[X=x,Y=y]}{\endA}
> since special code for ending environments might then work somewhat
> closer to expectations.


I was uncertain to write the same as you did; I thought not to reveal
the tricks. It depends on the inner environment, of course.

Ciao
Enrico
steve

2006-10-30, 7:44 pm

Here's an example of what I was trying to do. Latex reports 'runaway
argument?".



\documentclass{powerdot}
\newenvironment{B}[1]{\slide[toc=,bm=]{#
1}}{\endslide}
%\newenvironment{B}{\A[X=x,Y=y]}{\endA}

\begin{document}

\begin{B}{abc}
cc
\end{B}

\end{document}
David Kastrup

2006-10-30, 7:44 pm

steve <fisk@bowdoin.edu> writes:

> Here's an example of what I was trying to do. Latex reports 'runaway
> argument?".
>
>
>
> \documentclass{powerdot}
> \newenvironment{B}[1]{\slide[toc=,bm=]{#
1}}{\endslide}
> %\newenvironment{B}{\A[X=x,Y=y]}{\endA}
>
> \begin{document}
>
> \begin{B}{abc}
> cc
> \end{B}
>
> \end{document}


Are you sure that
\begin{slide}[toc=,bm=]{abc}
cc
\end{slide}

would work? If yes, the definition of \slide might be at fault.

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
steve

2006-10-30, 7:44 pm

Yes, your example works fine.

David Kastrup wrote:
> steve <fisk@bowdoin.edu> writes:
>
>
> Are you sure that
> \begin{slide}[toc=,bm=]{abc}
> cc
> \end{slide}
>
> would work? If yes, the definition of \slide might be at fault.
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com