Discussion:
Remove parentheses from \cite?
(too old to reply)
Joseph Turian
2005-08-29 15:34:49 UTC
Permalink
Hi,

How can I remove the parentheses from a citation?
\cite puts them around the author and the year.

Alternately, how can I get parentheses around the year, but not the
author?

Ideally, I'd use natbib or custom-bib. Unfortunately, I am forced to
use the .bst and .sty file located here:
http://www.aclweb.org/acl2005/acl2005-styles-final/latex/

Can I define a new command to get the citation with no parens?

Thank you so much!

Joseph
Philipp Lehman
2005-08-29 16:29:00 UTC
Permalink
Post by Joseph Turian
How can I remove the parentheses from a citation?
\cite puts them around the author and the year.
\usepackage{cite}
\renewcommand*{\citeleft}{}
\renewcommand*{\citeright}{}

The documentation resides in the .sty file.
--
Sender address blackholed; do not reply to From address
You can still reach me at: plehman gmx net
Joseph Turian
2005-08-29 16:40:56 UTC
Permalink
Philipp,
Post by Philipp Lehman
\usepackage{cite}
\renewcommand*{\citeleft}{}
\renewcommand*{\citeright}{}
The documentation resides in the .sty file.
That didn't work.
I get the following error at my first citation:

! Undefined control sequence.
\@***@citeB ->\citename
{Fujisaki}1984
l.401 \cite{fujisaki84}


Regardless, thank you for the suggestion. I have 12 hours until the
camera-ready deadline, and I don't want to end up submitting one of
those ugly papers that reads "According to (Black, 1991), one can blah
blah blah." :(

Joseph
Philipp Lehman
2005-08-29 17:21:32 UTC
Permalink
Post by Joseph Turian
Philipp,
Post by Philipp Lehman
\usepackage{cite}
\renewcommand*{\citeleft}{}
\renewcommand*{\citeright}{}
The documentation resides in the .sty file.
That didn't work.
! Undefined control sequence.
{Fujisaki}1984
l.401 \cite{fujisaki84}
Try adding the following line:

\newcommand*{\citename}[1]{#1\space}
--
Sender address blackholed; do not reply to From address
You can still reach me at: plehman gmx net
Joseph Turian
2005-08-29 18:06:37 UTC
Permalink
Post by Philipp Lehman
\newcommand*{\citename}[1]{#1\space}
Okay, that worked.

However, now all of the citations have no parentheses. How can I mix
citation style throughout the document (have some with parens, and some
without)?
I looked at the documentation but couldn't figure it out.

Thanks!

Joseph
Philipp Lehman
2005-08-29 18:26:51 UTC
Permalink
Post by Joseph Turian
Post by Philipp Lehman
\newcommand*{\citename}[1]{#1\space}
Okay, that worked.
However, now all of the citations have no parentheses. How can I mix
citation style throughout the document (have some with parens, and
some without)?
I looked at the documentation but couldn't figure it out.
I suppose it's not supported. You could still define your own \citep
command on top of \cite to add the parentheses. However, after
finally testing what I suggested earlier, I found that the cite
package seems to break the \shortcite command of the package you're
using, so it's all in vein anyway.

Short of redefining the \cite internals, I guess you'll have to live
with the parentheses.
--
Sender address blackholed; do not reply to From address
You can still reach me at: plehman gmx net
Peter Flynn
2005-08-30 21:20:22 UTC
Permalink
Post by Joseph Turian
Post by Philipp Lehman
\newcommand*{\citename}[1]{#1\space}
Okay, that worked.
However, now all of the citations have no parentheses. How can I mix
citation style throughout the document (have some with parens, and some
without)?
I looked at the documentation but couldn't figure it out.
You need two commands, one to do Smith (2000) and the other to do (Smith,
2000). A number of us have been debating what to call these two for a while
now. Suggestions welcomed. I've been looking at

\Authorof{foo}............Smith
\authorof{foo}............Smith (2000)

The jurabib package has a \citefield command which lets you build your own
formats, eg
\newcommand{\something}[1]{\citefield{#1}{author}~(\citefield{#1}{year})}
(untested).

///Peter
Brooks Moses
2005-09-01 23:38:11 UTC
Permalink
Post by Peter Flynn
You need two commands, one to do Smith (2000) and the other to do (Smith,
2000). A number of us have been debating what to call these two for a while
now. Suggestions welcomed. I've been looking at
\Authorof{foo}............Smith
\authorof{foo}............Smith (2000)
I would suggest the following:

\authoronly(foo} ..... Smith
\yearonly{foo} ....... 2000
\authorandcite{foo} .. Smith (2000)
\cite{foo} ........... (Smith, 2000)

These names remain meaningful in the numerical-citation case as well,
which I think is an important consideration:

\authoronly(foo} ..... Smith
\yearonly{foo} ....... 2000
\authorandcite{foo} .. Smith [1]
\cite{foo} ........... [1]

I have no preference with regards to \authorof versus \authoronly, but I
do think that using both \authorof and \Authorof, with the commands
differing only in case, is liable to lead to confusion. As is using
\authorof for something that _also_ provides a citation.

- Brooks
--
The "bmoses-nospam" address is valid; no unmunging needed.
Peter Flynn
2005-09-03 12:54:07 UTC
Permalink
Post by Brooks Moses
Post by Peter Flynn
You need two commands, one to do Smith (2000) and the other to do (Smith,
2000). A number of us have been debating what to call these two for a
while now. Suggestions welcomed. I've been looking at
\Authorof{foo}............Smith
\authorof{foo}............Smith (2000)
\authoronly(foo} ..... Smith
\yearonly{foo} ....... 2000
\authorandcite{foo} .. Smith (2000)
\cite{foo} ........... (Smith, 2000)
These names remain meaningful in the numerical-citation case as well,
That's a very good suggestion, thanks.
Post by Brooks Moses
\authoronly(foo} ..... Smith
\yearonly{foo} ....... 2000
\authorandcite{foo} .. Smith [1]
\cite{foo} ........... [1]
I have no preference with regards to \authorof versus \authoronly, but I
do think that using both \authorof and \Authorof, with the commands
differing only in case, is liable to lead to confusion.
Yes, I'll keep \authorof for producing just the author's name in isolation
(it's very handy when you know the book but simply can't remember the
author while you're actually writing).

///Peter

Brooks Moses
2005-08-30 02:36:11 UTC
Permalink
Post by Joseph Turian
Regardless, thank you for the suggestion. I have 12 hours until the
camera-ready deadline, and I don't want to end up submitting one of
those ugly papers that reads "According to (Black, 1991), one can blah
blah blah." :(
12 hours? (Well, 2 now -- I hope this is in time!) In times like this,
the solution is to go through a printout of the paper, circle all of the
places where there are inappropriate parentheses, and then in the LaTeX
file, replace the corresponding \cite commands with the literal text
"Black (1991)" or whatever is appropriate.

Optionally, add a \nocite command for each of these to make sure that
the paper is still properly included in the bibliography.

There are times for the elegant programming solution, but I don't think
this is one of them.

- Brooks
--
The "bmoses-nospam" address is valid; no unmunging needed.
James Kim
2005-08-29 16:42:20 UTC
Permalink
Post by Philipp Lehman
\renewcommand*{\citeleft}{}
Forgive my poor knowledge in Tex, if the sequel is an easy question.
Why do we need to add asterisk (*) at the end of TeX command in many
cases? Especially, in this case what is the functionality of the
asterisk (*)?

-James (^o^)
Philipp Lehman
2005-08-29 17:14:40 UTC
Permalink
Post by James Kim
Post by Philipp Lehman
\renewcommand*{\citeleft}{}
Forgive my poor knowledge in Tex, if the sequel is an easy question.
Why do we need to add asterisk (*) at the end of TeX command in many
cases? Especially, in this case what is the functionality of the
asterisk (*)?
Latex's \newcommand* uses the Tex primitive \def (and checks if the
command is already defined). \newcommand (without the asterisk) uses
\long\def. If a macro is \long, it can take a \par token in its
argument.

If the command doesn't take an argument, the \long is excessive---but
it will not necessarily do any harm. In some cases, however, it has
unwanted side-effects. Typical examples are comparisons with \ifx.
Compare the following two examples:

\newcommand*{\testA}{test}
\newcommand*{\testB}{test}
\newcommand{\testC}{test}

\ifx\testA\testB
equal!
\else
not equal!
\fi

\ifx\testA\testC
equal!
\else
not equal!
\fi

There are also cases in which you don't want any \par tokens in the
argument. In this case, \newcommand* will make sure that Tex issues
an error message.
--
Sender address blackholed; do not reply to From address
You can still reach me at: plehman gmx net
Hendrik Maryns
2005-08-29 16:23:47 UTC
Permalink
Post by Joseph Turian
Hi,
How can I remove the parentheses from a citation?
\cite puts them around the author and the year.
Alternately, how can I get parentheses around the year, but not the
author?
Ideally, I'd use natbib or custom-bib. Unfortunately, I am forced to
http://www.aclweb.org/acl2005/acl2005-styles-final/latex/
Can I define a new command to get the citation with no parens?
The .bst defines how the citations look like, so if you have to use
those, you won't have a choice. Otherwise, you'll have to edit the .bst
file (or look for one that already does what you want).
--
Hendrik Maryns

==================
www.lieverleven.be
http://aouw.org
Donald Arseneau
2005-08-29 19:18:58 UTC
Permalink
Post by Joseph Turian
Ideally, I'd use natbib or custom-bib.
Can I define a new command to get the citation with no parens?
Look up the \bibpunct command
--
Donald Arseneau ***@triumf.ca
Continue reading on narkive:
Loading...