-4

Using a minimal template \documentclass{article}\begin{document}\end{document}, suppose I want the following in the text:

As (Gettier, 1963), 122, points out.

Suppose moreover, that I want the following in the bibliography:

Gettier, E. (1963) Is Justified True Belief Knowledge? Analysis, 23(6):121-123.

By means of

As \cite{Gettier1963}, p. 122, points out, 

\begin{thebibliography}{11}

\bibitem[Gettier, 1963]{Gettier1963}
\noindent Is Justified True Belief Knowledge? 
\emph{Analysis},  23 (6):121-123.

\end{thebibliography}

I get:

As [Gettier, 1963], 122, points out. in the text, and [Gettier, 1963] Is Justified True Belief Knowledge? Analysis, 23(6):121-123. in the bibliography.

MWE

\documentclass{article}

\makeatletter \def\@biblabel#1{#1} \makeatother 



\begin{document}

\nocite{Gettier1963}(Gettier, 1963) is a famous article in modern epistemology. 


\begin{thebibliography}{11}

\bibitem[Gettier, E. (1963)]{Gettier1963} ``Is Justified True Belief Knowledge?'' 
In \emph{Analysis},  23 (6):121-123. 
    
\end{thebibliography}   

\end{document}
8
  • 2
    Are you sure about all that? Wouldn't it usually be „As E. Gettier (1963, p. 122) pointed out …“ or similar? Either way, please show as a minimal working example.
    – Ingmar
    Nov 23, 2021 at 18:36
  • @Ingmar I showed the code I used, so in this context that is the mwe, which can be used in virtually all document structures. Something like your (E. Gettier, 1963, 122) might be preferable. But that is a separate point, which should be treated on its own. Nov 23, 2021 at 18:57
  • 4
    No, an MWE is a fully contained working example that we can compile and run. tex.meta.stackexchange.com/questions/228/… At this point we don't even know what document class you are using; BibTeX/BibLaTeX, what have you …
    – Ingmar
    Nov 23, 2021 at 19:00
  • I know very well what an mwe is. I said that in this context that is the mwe, which can be used in virtually all document structures. The point is that what document structure you make use of does not matter. So use a minimal one: \documentclass{article}\begin{document}\end{document}. BibTeX and BibLatTeX are excluded here, as the title, and my code for a manual bibliography indicate. Nov 23, 2021 at 19:17
  • 2
    So you're doing the bibliography manually? The parentheses are usually controlled by your bibliography package. And the style you're showing in the bibliography itself seems very non-standard; items are usually formatted last name first (at least for the first author), and the author and year are not usually in brackets/parentheses together (usually just the year). Can you point to a particular place where this style is described?
    – Alan Munn
    Nov 23, 2021 at 19:36

3 Answers 3

10

Without using any bibliography package or using BibTeX, the default definition of \@biblabel and \@cite are:

\def\@biblabel#1{[#1]}
\def\@cite#1#2{[{#1\if@tempswa , #2\fi}]}

So if you merely want to change the remove the brackets or and change the citations to use parentheses, you can add the following to your preamble.

\makeatletter
\def\@biblabel#1{#1}
\def\@cite#1#2{({#1\if@tempswa , #2\fi})}
\makeatother

Why you should not do this

What you're asking to do will give you far more headaches than using BiBTeX and a proper bibliography package natbib or biblatex. To see this consider the fact that the element inside the label in the bibliography should contain the author(s)' names and initials, followed by the date, but the citation callout in the text should usually just show the author(s)' last name without the initials. So you're trying to imitate quite complicated formatting manually, and you will likely fail as a result. For example, your in text citation for the article you in your example should be:

(Gettier, 1963) or Gettier (1963)

but the bibliography should be:

Gettier, E., 1963 Is Justified True Belief Knowledge? Analysis, 23(6):121-123.

There are many Author/Year bibliography styles around that should work for you. You claim to have problems with them, but it seems like you should ask about solving those problems instead of trying to (badly) reinvent the wheel by doing things manually.

6
  • You succeeded with changing from [] to () in the bibliography, which is great! Thanks! Nov 23, 2021 at 23:51
  • May one (1) have the same change from [] to () in the in-line citation, and perhaps (2) at the same time (2) get rid of the parentheses altogether in the bibliography? Nov 23, 2021 at 23:52
  • I solved my question (2) by writing \makeatletter \def\@biblabel#1{#1} \makeatother Nov 24, 2021 at 0:03
  • That leaves only (1) unaccounted for. :) Nov 24, 2021 at 0:03
  • At any rate, I succeeded with what I wanted, in a somewhat roundabout way. I put \bibitem[Gettier, E. (1963)]{Gettier1963}, and get rid of the square parentheses in the bibliography by means of \makeatletter \def\@biblabel#1{#1} \makeatother. I use \nocite{Gettier1963}(Gettier, 1963) when I want to refer to Gettier's paper in the text. With this little work-around, I obtain the desired output! :) Thanks for your help! Nov 24, 2021 at 3:20
4

In principle thebibliography is little more than an enumerate list with some additional syntactic sugar. \bibitem works pretty much like \item in enumerate with the addition that its mandatory argument defines an implicit label (similar to \label) that can later be referenced.

\cite then is pretty much a \ref to the \label implied by \bibitem.

The standard thebibliography/\bibitem combination will generate numeric citation labels.

Just like with enumerate and \item you can use the optional argument of \bibitem to force a particular label that does not follow the usual numbering scheme.

\documentclass{article}

\begin{document}
\cite{Gettier1963}

\begin{thebibliography}{MyOwnLabel}
\bibitem[MyOwnLabel]{Gettier1963}
Gettier, E. (1963). ``Is Justified True Belief Knowledge?'' 
In \emph{Analysis}, 23 (6):121-123.
\end{thebibliography}
\end{document}

[MyOwnLabel]

With this simple setup you will only ever realistically have one (automatic) way to cite each work.

But there are ways to offer more citation options.

APA style for example has broadly speaking two ways of referencing

  • narrative citations of the form <author> (<year>), e.g. "Gettier (1963)"
  • parenthetical citations of the form (<author>, <year>), e.g. "(Gettier, 1963)"

crucially citations always consist of the same data (author and year) just presented in different ways.

The idea is now to use the optional argument of \bibitem not to force a specific output, but to pass the author and year data on to LaTeX so that several different cite commands can use these two pieces of information to print the different citation styles.

This is what natbib does. Indeed while natbib is most often used together with BibTeX (and its \bibliography and \bibliographystyle) commands, it need not be and can be used together with a manually curated thebibliography environment.

natbib.sty explains the format \bibitem expects

 % If author-year citations are selected, \bibitem must have one of the
 %   following forms:
 %   \bibitem[Jones et al.(1990)]{key}...
 %   \bibitem[Jones et al.(1990)Jones, Baker, and Williams]{key}...
 %   \bibitem[Jones et al., 1990]{key}...
 %   \bibitem[\protect\citeauthoryear{Jones, Baker, and Williams}{Jones
 %       et al.}{1990}]{key}...
 %   \bibitem[\protect\citeauthoryear{Jones et al.}{1990}]{key}...
 %   \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}...
 %   \bibitem[\protect\citename{Jones et al., }1990]{key}...
 %   \harvarditem[Jones et al.]{Jones, Baker, and Williams}{1990}{key}...
 %
 % This is either to be made up manually, or to be generated by an
 % appropriate .bst file with BibTeX.

natbib then defines (amongst other commands) the two commands \citet and \citep in analogy to APA's narrative and parenthetical citations.

Thus

\documentclass{article}
\usepackage{natbib}

\begin{document}
\citep{Gettier1963}

\citet{Gettier1963}

\begin{thebibliography}{}
\bibitem[Gettier(1963)]{Gettier1963}
Gettier, E. (1963). ``Is Justified True Belief Knowledge?'' 
In \emph{Analysis}, 23 (6):121-123.
\end{thebibliography}
\end{document}

gives

(Gettier, 1963)
Gettier (1963)

For APA style there is the added complication that the delimiter between authors changes depending on whether you are in \citet or \citep. With some tricks that can be faked as well

\documentclass{article}
\usepackage{natbib}

\usepackage{etoolbox}
\makeatletter
\newrobustcmd{\myand}{%
  \ifNAT@swa
  \&%
  \else
  and%
  \fi
}
\makeatother

\begin{document}
\citep{Gettier1963}

\citet{Gettier1963}

\begin{thebibliography}{}
\bibitem[Gettier \myand\ Bettier(1963)]{Gettier1963}
Gettier, E. \& Bettier, B. (1963). ``Is Justified True Belief Knowledge?'' 
In \emph{Analysis}, 23 (6):121-123.
\end{thebibliography}
\end{document}

(Gettier & Bettier, 1963)
Gettier and Bettier (1963)

So even if you use a manual thebibliography there are ways to have different in-text citation styles.


The strength of BibTeX is that it automatically sorts your references and allows you to input only the raw data for the entry. The tedious formatting is taken care of by the BibTeX styles.

3
  • "With this simple setup you will only ever realistically have one way to cite each work." At the step: Next, when citing in the text, write \nocite{Gettier1963}(Gettier, 1963)., my answer shows how to cite each work just as you want. Dec 1, 2021 at 1:00
  • Notice that I put \makeatletter \def\@biblabel#1{#1} \makeatother in the preamble to get rid of the []-parentheses you had on [MyOwnLabel]. Dec 1, 2021 at 1:05
  • "The strength of BibTeX is that it automatically sorts your references and allows you to input only the raw data for the entry. The tedious formatting is taken care of by the BibTeX styles." My bibliographies are so short that it is not strainful. Dec 1, 2021 at 1:08
-3

To make matters clearer, I write up an answer. Most of what I write here can also be found in some of the comments.

Use a minimal template

\documentclass{article}\begin{document}\end{document}, 

and do the bibliography manually. Put

\bibitem[Gettier, E. (1963)]{Gettier1963} 

in the bibliography.

Next, put

\makeatletter \def\@biblabel#1{#1} \makeatother 

in the preamble, to get rid of the square brackets

[Gettier, E (1963)] 

in the bibliography.

Next, when citing in the text, write

\nocite{Gettier1963}(Gettier, 1963). 

We may continue like this for other items to obtain a bibliography and reference-style which abides by the APA-guidelines.

10
  • 5
    Try to format the code parts as code to help with readability. See How do I format code blocks?
    – user202729
    Nov 24, 2021 at 3:50
  • 3
    The preamble contains code and \makeatletter definitly fulfills the definition of being code, thus program instructions.
    – Roland
    Nov 24, 2021 at 4:12
  • 3
    My point is that your statement "There is no code part in my answer" is incorrect and the comment of @user202729 has its justification .
    – Roland
    Nov 24, 2021 at 4:38
  • 3
    I do not really know what you are talking about with “language use”. I am referring to LaTeX code in your answer ( e.g. \makeatletter or \nocite{Gettier1963}) which is LaTeX code and thus should/could be formatted as the link, provided by user202729, explains. This would at least make your answer more readable.
    – Roland
    Nov 24, 2021 at 5:00
  • 4
    In my opinion it is now much more readable, yes.
    – Roland
    Nov 24, 2021 at 5:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .