Update: after some research, I found a solution for the "optional arguments".
\makeatletter
\newenvironment{wannabe-environment}{
\def\Name##1{\gdef\@Name{##1}}
\def\@Name{\@latex@error{No \noexpand\Name given}\@ehc}
\def\Surname##1{\gdef\@Surname{##1}}
\def\@Surname{\@latex@error{No \noexpand ...
Search found 4 matches
- Thu Jun 24, 2010 1:42 pm
- Forum: General
- Topic: Is this possible? Through a new environment or other means?
- Replies: 4
- Views: 2676
- Wed Jun 23, 2010 10:19 pm
- Forum: General
- Topic: Is this possible? Through a new environment or other means?
- Replies: 4
- Views: 2676
Is this possible? Through a new environment or other means?
And what if I wanted to introduce optional arguments? So to speak, arguments that could or could not be included in my {wannabe-environment} but in any case should not raise errors? An example:
\begin{wannabe-environment}
\Name{Alfred}
\Surname{Hitchcock}
\Age{89}
\Nationality{English}
\end ...
\begin{wannabe-environment}
\Name{Alfred}
\Surname{Hitchcock}
\Age{89}
\Nationality{English}
\end ...
- Wed Jun 23, 2010 8:49 am
- Forum: General
- Topic: Is this possible? Through a new environment or other means?
- Replies: 4
- Views: 2676
Re: Is this possible? Through a new environment or other mea
That was insightful! As I guessed, it needed a greater knowledge of LaTeX than mine, but now that I have an example I can start to work from here.
Thanks a lot!
Thanks a lot!

- Tue Jun 22, 2010 4:49 pm
- Forum: General
- Topic: Is this possible? Through a new environment or other means?
- Replies: 4
- Views: 2676
Is this possible? Through a new environment or other means?
Hi!
I am relatively new to LaTeX, and I have a very "strange" question. I tried a forum search, but I did not found an answer.
My question is: is there a way or a package (or something similar) to create this effect?
Code:
\begin{wannabe-environment}
\Name Alfred
\Surname Hitchcock
\Age 89
\end ...
I am relatively new to LaTeX, and I have a very "strange" question. I tried a forum search, but I did not found an answer.
My question is: is there a way or a package (or something similar) to create this effect?
Code:
\begin{wannabe-environment}
\Name Alfred
\Surname Hitchcock
\Age 89
\end ...