Hi there,My question is just the title of my post.
--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.
I have few more questions. AMS bulletin requires for some reason that all \def should be substitute by \newcommand. They write that using of \def code reduce the quality of text. This is not clear but this is their requirement.
In some cases this is possible. But difference here is that \def I can repeat as much as I need. But if I use \newcommand second time I should write \renewcommand.
Also for me is not clear how I can use \newcommand instead of \def in code like
\def\LanguagePrefix{R}
\def\StartCite{[}%
\def\citeBib#1{\protect\showCiteBib#1,endCite,}%
\def\endCite{endCite}%
\def\showCiteBib#1,{\def\temp{#1}%
\ifx\temp\endCite
]%
\def\StartCite{[}%
\else
\StartCite\LanguagePrefix \ref{\LanguagePrefix bibitem: #1}%
\@ifundefined{\LanguagePrefix ViewCite#1}{%
\NameDef{\LanguagePrefix ViewCite#1}{}%
}{%
}%
\def\StartCite{, }%
\expandafter\showCiteBib%
\fi}%
Aleks Kleyn
--
I have few more questions. AMS bulletin requires for some reason that all \def should be substitute by \newcommand. They write that using of \def code reduce the quality of text. This is not clear but this is their requirement.
In some cases this is possible. But difference here is that \def I can repeat as much as I need. But if I use \newcommand second time I should write \renewcommand.
Also for me is not clear how I can use \newcommand instead of \def in code like
I use both amsbook and amsart. This macros I when communicate with this group sometime ago. The main here that I work with array. I removed unimportant macros. The problem as I understand in lines marked by %+ because they create loop which leads to error with \newcommand.
\def\StartCite{[}%
\def\citeBib#1{\protect\showCiteBib#1,endCite,}%+
\def\endCite{endCite}%
\def\showCiteBib#1,{\def\temp{#1}%+
\ifx\temp\endCite
]%
\def\StartCite{[}%
\else
\StartCite \ref{ bibitem: #1}%
\def\StartCite{, }%
\expandafter\showCiteBib%+
\fi}%
Aleks Kleyn
http://sites.google.com/site/AleksKleyn/
http://AleksKleyn.blogspot.com/
From: latexus...@googlegroups.com [mailto:latexus...@googlegroups.com] On Behalf Of Peter Flynn
Sent: Monday, December 20, 2010 4:30 AM
To: latexus...@googlegroups.com
Subject: Re: [latexusersgroup] what is the difference among \let, \def and \newcommand?
On Mon, Dec 20, 2010 at 1:10 AM, Aleks Kleyn <Aleks...@mailaps.org> wrote:
--
Last year I sent fragment bellow to ask how to implement it using renewcommand. Nobody answered, and I tried it myself. Mainly I succeeded but one place still is not clear for me. I have wrote next text
\newcommand\StartCite{}
\newcommand\citeBib[1]{}
\newcommand\showCiteBib[1]{}
\newcommand\endCite{endOfCite}%
\newcommand\Temp{}
\newcommand\Semafor{}
\renewcommand\StartCite{[}%
\renewcommand\citeBib[1]{\protect\showCiteBib#1,endOfCite,}%
\renewcommand\showCiteBib[1],{\renewcommand\Temp{#1}%
\ifx\Temp\endCite
]%
\renewcommand\StartCite{[}%
\else
\StartCite \ref{bibitem: #1}%
\renewcommand\StartCite{, }%
\expandafter\showCiteBib%
\fi}%
The problem I see in the line
\renewcommand\showCiteBib[1],{\renewcommand\Temp{#1}%
Because I cannot put “,” between command ID and its body. When I use \def this way I can sent list of words separated by “,” as parameter of def. how I can do this for the command.
Last year I sent fragment bellow to ask how to implement it using renewcommand. Nobody answered, and I tried it myself. Mainly I succeeded but one place still is not clear for me. I have wrote next text
\newcommand\StartCite{}
\newcommand\citeBib[1]{}
\newcommand\showCiteBib[1]{}
\newcommand\endCite{endOfCite}%
\newcommand\Temp{}
\newcommand\Semafor{}
\renewcommand\StartCite{[}%
\renewcommand\citeBib[1]{\protect\showCiteBib#1,endOfCite,}%
\renewcommand\showCiteBib[1],{\renewcommand\Temp{#1}%
\ifx\Temp\endCite
]%
\renewcommand\StartCite{[}%
\else
\StartCite \ref{bibitem: #1}%
\renewcommand\StartCite{, }%
\expandafter\showCiteBib%
\fi}%
The problem I see in the line
\renewcommand\showCiteBib[1],{\renewcommand\Temp{#1}%
Because I cannot put “,” between command ID and its body. When I use \def this way I can sent list of words separated by “,” as parameter of def. how I can do this for the command.