🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #10225

What's wrong with the following macro?

#10225
From: Young U. Ryu
Date: Wed, 12 Jun 1991 20:35
87 lines
3372 bytes
The following is a part of a version of newapa.sty (or
its modification) which generates APA style citations.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\let\@internalcite\cite
%
% comment: \cite -> (Author List, Year)
% comment: \citeA -> Author List (Year)
% comment: \citeauthor -> Author List
\def\cite{\def\@citeseppen{-1000}%
    \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}
    \def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
\def\citeA{\def\@citeseppen{-1000}%
    \def\@cite##1##2{{##1}\if@tempswa , ##2)\else)\fi}
    \def\citeauthoryear##1##2##3{##1 (##3}\@citedata}
\def\citeauthor{\def\@citeseppen{-1000}%
    \def\@cite##1##2{##1\if@tempswa , ##2\fi}
    \def\citeauthoryear##1##2##3{##1}\@citedata}
%
\def\@citedata{\@ifnextchar[{\@tempswatrue\@citedatax}{\@tempswafalse\@citedatax[]}}
%
\def\@citedatax[#1]#2{%
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  \def\@citea{}\@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{, }\@ifundefined
       {b@\@citeb}{{\bf ?}\@warning
       {Citation `\@citeb' on page \thepage \space undefined}}
{\csname b@\@citeb\endcsname}}}{#1}}
%
\def\@citex[#1]#2{%
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  \def\@citea{}\@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{; }\@ifundefined
       {b@\@citeb}{{\bf ?}\@warning
       {Citation `\@citeb' on page \thepage \space undefined}}%
{\csname b@\@citeb\endcsname}}}{#1}}
%
%
\def\@biblabel#1{}
\newlength{\bibhang}
\setlength{\bibhang}{2em}
%
\def\thebibliography#1{\chapter*{Bibliography}
 \addcontentsline{toc}{chapter}{Bibliography}
  \list
  {\relax}{\setlength{\labelsep}{0em}
    \setlength{\itemindent}{-\bibhang}
    \setlength{\leftmargin}{\bibhang}}
    \def\newblock{\hskip .11em plus .33em minus .07em}
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

It can be used with bibligraphy entries
generated by BiBTeX with newapa.bst
and also works with the following manual entries:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{thebibliography}{}

\bibitem[\protect\citeauthoryear{Anderson}{Anderson}{1958}]{Anderson58}
Anderson, A.~R. (1958).
\newblock A reduction of deontic logic to alethic modal logic.
\newblock {\em Mind}, {\em 67\/}(265), 100--103.

\bibitem[\protect\citeauthoryear{Anderson}{Anderson}{1967}]{Anderson67}
Anderson, A.~R. (1967).
\newblock The formal analysis of normative system.
\newblock In Rescher, N. (Ed.), {\em The Logic of Decision and Action}.
  Pittsburgh, PA: Univ.\ of Pittsburgh Press.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Now, the problem is that when the above macro generates
a citation, it places some extra space before it:
For example:

	blah blah \cite{Anderson67} blah blah

results in:

	blah blah   (Anderson, 1967) blal blah
                 ^^^Here a Big space.

What's wrong with the above macro?

Young U. Ryu
young@emx.utexas.edu
Technical Details
Message-ID: <50415@ut-emx.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!emx.utexas.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!emx.utexas.edu
From: young@emx.utexas.edu (Young U. Ryu)
Newsgroups: comp.text.tex
Subject: What's wrong with the following macro?
Message-ID: <50415@ut-emx.uucp>
Date: 12 Jun 91 20:35:12 GMT
Sender: young@ut-emx.uucp
Organization: The University of Texas at Austin; Austin, Texas
Lines: 87