Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
argument in end-part of newenvironment
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Francisco Canedo  
View profile  
 More options Apr 13 2001, 2:14 pm
Newsgroups: comp.text.tex
From: Francisco Canedo <can...@ano.ano>
Date: Fri, 13 Apr 2001 20:13:04 +0200
Local: Fri, Apr 13 2001 2:13 pm
Subject: argument in end-part of newenvironment
Hi y'all,

I'm trying to make a new environment that uses the verbatim environment
and puts a
line above and under it. The next environment accomplishes that:

\newenvironment{srclist}
{\hline\verbatim}
{\endverbatim
\hline}

Now I want to add a title at the end of this environment and I want to
be able to specify
this title as an argument to the environment command. Here are some
things I tried and
don't work:

% This doesn't work because you can't use the
% argument in the end-part
\newenvironment[1]{srclist}
{\hline\verbatim}
{\endverbatim
\hline #1}

% This doesn't work because LaTeX thinks '#1'
% is the argument to the new '\srctitle' command
% and  we didn't specify any
\newenvironment[1]{srclist}
{\newcommand{\srctitle}{#1}\hline\verbatim}
{\endverbatim
\hline\srctitle}

Does anyone have any idea on how to do something like this?

TIA,

Francisco

PS: I'll be monitoring  the group but replies to my e-mail are
appreciated.
Don't use the address in the sender/reply to, use this: fcanedo at
mediaport dot organisation


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Donald Arseneau  
View profile  
 More options Apr 14 2001, 7:44 am
Newsgroups: comp.text.tex
From: Donald Arseneau <a...@triumf.ca>
Date: 14 Apr 2001 04:42:39 -0700
Local: Sat, Apr 14 2001 7:42 am
Subject: Re: argument in end-part of newenvironment

Francisco Canedo <can...@ano.ano> writes:
> % This doesn't work because LaTeX thinks '#1'
> % is the argument to the new '\srctitle' command
> % and  we didn't specify any
> \newenvironment[1]{srclist}
> {\newcommand{\srctitle}{#1}\hline\verbatim}
> {\endverbatim
> \hline\srctitle}

Your statement about what LaTeX "thinks" is incorrect:
The #1 does refer to the environment parameter.

In fact, I expect this really does work.

What you have wrong is using \hline outside of a {tabular}.
Use a \rule command, or raw TeX \hrule (if you understand
the spacing issues).

Donald Arseneau                          a...@triumf.ca


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Francisco Canedo  
View profile  
 More options Apr 16 2001, 5:28 pm
Newsgroups: comp.text.tex
From: Francisco Canedo <can...@ano.ano>
Date: Mon, 16 Apr 2001 23:24:17 +0200
Local: Mon, Apr 16 2001 5:24 pm
Subject: Re: argument in end-part of newenvironment

Donald Arseneau wrote:
> Francisco Canedo <can...@ano.ano> writes:

> > % This doesn't work because LaTeX thinks '#1'
> > % is the argument to the new '\srctitle' command
> > % and  we didn't specify any
> > \newenvironment[1]{srclist}
> > {\newcommand{\srctitle}{#1}\hline\verbatim}
> > {\endverbatim
> > \hline\srctitle}

> Your statement about what LaTeX "thinks" is incorrect:
> The #1 does refer to the environment parameter.

> In fact, I expect this really does work.

You're right! What I was doing wrong, was that I was trying to
use the environment without specifying an argument. Which was
the title that I so desperately wanted!!!!

Someone who replied directly to my e-mail pointed this out to me
after I sent him the rest of my code.

This makes me curious about something else though: What if I was
trying to use an argument for the command also?
i.e.:

\newenvironment{srclist}[1]
{\newcommand{\srctitle}[1]{#1}.......

Thanks for your info,

Francisco


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Donald Arseneau  
View profile  
 More options Apr 17 2001, 4:08 am
Newsgroups: comp.text.tex
From: Donald Arseneau <a...@triumf.ca>
Date: 17 Apr 2001 01:07:08 -0700
Local: Tues, Apr 17 2001 4:07 am
Subject: Re: argument in end-part of newenvironment

Francisco Canedo <can...@ano.ano> writes:
> This makes me curious about something else though: What if I was
> trying to use an argument for the command also?

> \newenvironment{srclist}[1]
> {\newcommand{\srctitle}[1]{#1}.......

 \newenvironment{srclist}[1]
 {\newcommand{\srctitle}[1]{The #1 title is ##1}.......

Parameters get their # doubled for every level of nesting
within nested definitions.  So ##1 is the parameter for
\srctitle and #1 is the parameter for srclist.  A three-deep
definition would have a first parameter marked by ####1.

Donald Arseneau                          a...@triumf.ca


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »