0

I want to display the bibiolgraphy as shown in this figure. Figure 1

I would like to have the year directly after the author's name, and the title of paper without "." What command can I put into the preamble of my .tex file to enforce this?

\documentclass {article}   
 \usepackage[round]{natbib}   
 \bibliographystyle{apalike}

  \begin{document}
  \cite{Sampson1989}
  \bibliography{my_bibtex}
  \end{document}

My file my_bibtex.bib

@article{Sampson1989,
author = {Sampson, R J and Groves, W B},
year = {1989},
title = {Community structure and crime: testing social-disorganization theory},
volume = {94},
number = {4},
journal = {Am J Soc},
pages = {774}
 }

What I obtain is:

enter image description here

  • 1
    Please complete your code snippet to a compilable minimal working example, so that we can see which documentclass you use, wich bibliography relevant packages you use aund how you cite. Then we can play with your MWE and can help you ... – Mensch Nov 11 '14 at 14:15
  • Your sample bib entry is missing the journal field. Please provide the missing information. There's a comma missing at the end of the number field. Separately, the syntax in the author field is almost certainly incorrect; it should probably be author = {Sampson, R J and Groves, W B},. – Mico Nov 11 '14 at 15:50
  • Thanks for response. I want to display my references as shown in figure 1: lastname1 firstname1, lastname2 firstname2 (date) Title. This is a style recommended by: Data mining and knowledge discovery journal – Sam Faith Nov 11 '14 at 16:20
  • Rather than hack the apalike bibliography style to obtain the desired style, I suggest you run the makebst utility (part of the custom-bib package) to create your very own bespoke bibliography style. The makebst utility will pose a number of multiple-choice type questions and will create a bst file that incorporates all of your choices regarding topics such as abbreviating first names, using (or, rather, not using) dots at the end of the abbreviated first and middle names, not italicizing the names of journals, etc etc. – Mico Nov 11 '14 at 16:45
1

Here is a way of obtaining what you want with biblatex-apa and some patches:

\documentclass{article}
\usepackage[style=apa]{biblatex}
\usepackage[american]{babel}
\DeclareLanguageMapping{american}{american-apa}

\usepackage{filecontents}%
\begin{filecontents*}{apabibli1.bib}
@article{Sampson1989,
author = {Sampson, R J and Groves, W B},
year = {1989},
title = {Community structure and crime: testing social-disorganization theory},
volume = {94},
number = {4},
journal = {Am J Soc},
pages = {774}
}
\end{filecontents*}

\addbibresource{apabibli1.bib}

\renewcommand*{\labelnamepunct}{\addspace}

\usepackage{xpatch}

\xpatchbibmacro{author}
{%
\newunit\newblock
}
{%
\setunit{\addspace}\newblock
}{}{}

\xpatchbibmacro{name:apa:last-first}
{%
\addcomma\addlowpenspace\mkbibnamefirst{#3}\isdot
}
{%
\addlowpenspace\mkbibnamefirst{#3}\isdot
}{}{}

\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addspace\thinspace}%
\iffieldundef{series}
{}
{\newunit
 \printfield{series}
 \setunit{\addspace}}%
\printfield{volume}%
\printfield{number}%
\setunit{\addspace}\newblock
\usebibmacro{issuename}%
\newunit}

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\renewcommand{\finalnamedelim}{\ifnum\value{liststop}>2 \finalandcomma\fi\addspace and\space}%
   \usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {}
  {\usebibmacro{postnote}%
   \usebibmacro{cite:post}}

    \AtBeginBibliography{\renewcommand*{\finalnamedelim}{%
    \ifthenelse{\value{listcount}>\maxprtauth}
      {}
      {\ifthenelse{\value{liststop}>2}
         {\addcomma\space}%
         {\addcomma\space}}}}

    \renewcommand\bibinitperiod{}
\renewcommand\bibinitdelim{}
\renewcommand\bibpagespunct{\addcolon\space}


\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat[article]{volume}{\apanum{#1}}

\setlength{\bibhang}{1.2em}
\let\cite\parencite

\usepackage{hyperref} \hypersetup{ colorlinks = true, citecolor = blue,}

\begin{document}

\cite{Sampson1989}

\printbibliography

\end{document} 

enter image description here

  • @Sam Faith: Sorry, I used the preamble of another file to test, and it used the erewhon font, which is a recent extension to Adobe Utopia (with true small caps, cyrillic and the like). You can remove it, or replace it with heuristica if you have it installed. Or simply remove the whole second line. – Bernard Nov 12 '14 at 23:43
  • Did you compile exactly the code in my answer? \addbibresource is defined by biblatex. Also, just in case, compile the bibliography with biber, or add backend=bibtex to the options to biblatex. – Bernard Nov 13 '14 at 0:25
  • When I compile using bibtex I obtain : The top-level auxiliary file: test.aux I found no \citation commands---while reading file test.aux I found no \bibdata command---while reading file test.aux I found no \bibstyle command---while reading file test.aux (There were 3 error messages) – Sam Faith Nov 13 '14 at 0:50
  • OK, I checked the docs: biblatex-apa requires biber as backend (it's the default). Can you try with biber? Anyway it has much more functionalities than bibtex and understands utf8. Don't forget to delete all auxiliary files first. – Bernard Nov 13 '14 at 1:12
  • In my WinEdt, i haven't the compiler option : biber. – Sam Faith Nov 13 '14 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.