# How to edit apalike style to show the year at the end?

In apalike style, year appears just after author names:

[Doe, 2016] Doe, J. (2016). some article. Name of journal.

How to edit it so that year appears at the end (without parentheses)? i.e. sth like this:

[Doe, 2016] Doe, J. some article. Name of journal, 2016.

Edit: Suppose reference.bib includes:

@article{Auth123,
author  = "A. Auth1 and B. Auth2 and C. Auth3",
title   = "title",
journal = "journal",
year    = "2016"}


The following code

\documentclass{article}
\begin{document}
\cite{Auth123}
\bibliography{references}
\bibliographystyle{apalike}
\end{document}


results in

If I chage apalike to plainnat (as suggested in the comments), I will get this:

This moved the year to the end (which was what I wanted), but it repeated the names of authors which is not good.

If in addition I add \usepackage{natbib}, I get this:

I want sth like the first picture but with year moved to the end.

• Since this format is how APA style works, perhaps you should find a different style instead. The plainnat style does this. If you need citations in ( ) pass the round option to natbib when you load it. – Alan Munn Jul 21 '16 at 0:23
• @AlanMunn Thanks. The only problem now is that when there are more than two authors it shows sth like: [author1 et al.(year) author 1, author2 and author3]. Any fix for this? – LoMaPh Jul 21 '16 at 0:32
• @LoMaPh: Could you post a MWE which shows the problem. – Jagath Jul 21 '16 at 2:01
• @Jagath I added MWE. – LoMaPh Jul 21 '16 at 7:18
• @LoMaPh: For this you need to make a local copy of apalike.bst and need to edit it. Do you want to do that? – Jagath Jul 21 '16 at 7:42

The requirement is to have the following output:

%[Auth1 et al., 2016] Auth1, A., Auth2, B., and Auth3, C. The article title. My Simple Journal, 16:19–24, 2016.
\bibitem[Auth1 et~al., 2016]{Auth123}
Auth1, A., Auth2, B., and Auth3, C.
\newblock The article title.
\newblock {\em My Simple Journal}, 16:19--24, 2016.


%[Auth1 et al., 2016] Auth1, A., Auth2, B., and Auth3, C. (2016). The article title. My Simple Journal, 16:19–24.
\bibitem[Auth1 et~al., 2016]{Auth123}
Auth1, A., Auth2, B., and Auth3, C. (2016).
\newblock The article title.
\newblock {\em My Simple Journal}, 16:19--24.


Before we start editing the bst file, we need to rename the file to apalike-edited.bst, since the copyright says:

% Copyright (C) 1988, 2010 Oren Patashnik.

% Unlimited copying and redistribution of this file are permitted as long as

% it is unmodified. Modifications (and redistribution of modified versions)

% are also permitted, but only if the resulting file is renamed.

The following changes need to be done:

1. In the FUNCTION {output.year.check}, change the line " (" year * extra.label * ")" * to ", " year * extra.label * "" *. So the function will now become:

FUNCTION {output.year.check}
{ year empty${ "empty year in " cite$ * warning$} { write$
", " year * extra.label * "" *
mid.sentence 'output.state :=
}
if$}  If you do not need comma before year and need a full point, then you can change ", " year * extra.label * "" * to ". " year * extra.label * "" *. Now one problem is fixed, which is year without parenthesizes. 2. Next we need to set the year at the end of reference list. For this we need to go an edit functions which creates various types of reference list like article, book, booklet, inbook, incollection, inproceedings, manual, masterthesis, misc, phdthesis, proceedings, techreport and unpublished. I will show how to fix this for article. Likewise, you need to fix it for all the above reference types. Search for output.year.check in the function FUNCTION {article} and cut that line from there. Place that line just before fin.entry. So that the function will now become:  FUNCTION {article} { output.bibitem format.authors "author" output.check author format.key output % special for new.block format.title "title" output.check new.block crossref missing$
{ journal emphasize "journal" output.check
format.vol.num.pages output
}
{ format.article.crossref output.nonnull
format.pages output
}
if$new.block note output output.year.check % apalike fin.entry }  which was earlier:  FUNCTION {article} { output.bibitem format.authors "author" output.check author format.key output % special for output.year.check % apalike new.block format.title "title" output.check new.block crossref missing$
{ journal emphasize "journal" output.check
format.vol.num.pages output
}
{ format.article.crossref output.nonnull
format.pages output
}
if\$
new.block
note output
fin.entry
}


Repeat this process for all types of references and save the file.

I am assuming you have the following MWE:

\documentclass{article}

\begin{filecontents}{references.bib}
@article{Auth123,
title   = {The Article Title},
author  = {A. Auth1 and B. Auth2 and C. Auth3},
journal = {My Simple Journal},
volume = {16},
pages = {19--24},
year    = "2016"}
\end{filecontents}

\begin{document}
\cite{Auth123}
\bibliography{references}
\bibliographystyle{apalike-edited}
\end{document}


Hope this helps.

• Thanks. Just a minor edit: In the final part when u say "Search for output.year.check in the function FUNCTION {article} and copy it. Place that line just before fin.entry". In fact it is a cut instead of copy. If someone doesn't look at the code provided, they may just copy that line. – LoMaPh Jul 23 '16 at 17:45
• @LoMaPh: Oops! Sorry. I will correct that. – Jagath Jul 24 '16 at 4:18