BibTeX, biblatex and bibercan't make the bibliography ...

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

can't make the bibliography ...

Post by paulosousa »

Hello all, I need some help...

I want this output for the bibliography

Code: Select all

Hyder, Adnan A.  \emph{et al}. (2007) The impact of traumatic brain injuries: A global perspective. \emph{NeuroRehabilitation}; 22(5): 341--353 
and this in the text: Write here the text (Hyder et al, 2007).

What I must do?

minimal example:

Code: Select all

\documentclass[12pt, twoside, a4paper]{book}
\usepackage[portuguese,english]{babel}
\usepackage[applemac]{inputenc}
\usepackage{amsmath,amssymb,amsfonts,textcomp}
\usepackage{natbib}
\bibliographystyle{plainnat}


\begin{document}

\section{A}
Write here the text \citep{Hyder2007}.

\begin{thebibliography}{}
\bibitem{Hyder2007} Hyder, Adnan A.  \emph{et al}. The impact of traumatic brain injuries: A global perspective. \emph{NeuroRehabilitation} 2007; 22(5): 341--353 
\end{thebibliography}{}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

can't make the bibliography ...

Post by Johannes_B »

If you have the freedom of choice, use biblatex in conjunction with biber. It will be much easier to change the look of entries.

Using natbib this could be quite hard.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

can't make the bibliography ...

Post by paulosousa »

In the preamble changed natbib for

Code: Select all

\usepackage[style=authoryear,sorting=nyt]{biblatex}
\addbibresource{biblio.bib}
but how I must do to create the biblio.bib ?
(I am using texmaker)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: can't make the bibliography ...

Post by Johannes_B »

I just realised you typed in your bibliographic information directly. Are you doing this everytime, or was that just an example? If you are doing this by hand every time, it is an awful lot of work.

The bib file is a simple text database including the bibliographic information. You can usually download the entries along with the articles pdf.
The database can be modified using any text or teX-editor or using a specialised tool like Jabref.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

can't make the bibliography ...

Post by paulosousa »

Don't understand what you mean with
Johannes_B wrote:I just realised you typed in your bibliographic information directly. Are you doing this everytime, or was that just an example? If you are doing this by hand every time, it is an awful lot of work.
Now I am changing the bibliography style, before I used only

Code: Select all

\begin{thebibliography}{}
\bibitem{Hyder2007} Hyder Adnan A.  \emph{et al}. The impact of traumatic brain injuries: A global perspective. \emph{NeuroRehabilitation} 2007; 22(5): 341--353 
\bibitem{Mazzeo2011} Mazzeo A T. \emph{et al}. Heart rate variability: a diagnostic and prognostic tool in anesthesia and intensive care. \emph{Acta Anaesthesiologica Scandinavica} 2011; 55(7): 797--811 
\bibitem{Lingsma2010} Lingsma H F \emph{et al}. Early prognosis in traumatic brain injury: from prophecies to predictions. \emph{The Lancet Neurology}, 2010; 9(5): 543--554
\bibitem{Shoukri2011} Shoukri MM. Measures of Interobserver Agreement and Reliability. Chapman $\&$ Hall/CRC \emph{Biostatistics Series}, 2nd ed. 2011; 91--117
\end{thebibliography}{}
and in the text typing

Code: Select all

\cite{Hyder2007}
I got [1], but now I need to get (Hyder et al, 2007)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

can't make the bibliography ...

Post by Johannes_B »

You can use the optional argument for bibitem.
But i really don't understand, why you are doing the bibliography by hand.

Code: Select all

\documentclass{book}
\begin{document}
\section{A}
Write here the text \cite{Hyder2007}.

\begin{thebibliography}{}
\bibitem[Hyder et al, 2007]{Hyder2007} Hyder, Adnan A.  \emph{et al}. The impact of traumatic brain injuries: A global perspective. \emph{NeuroRehabilitation} 2007; 22(5): 341--353 
\end{thebibliography}{}

\end{document}
Before starting your next project, please have a look at biblatex.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

can't make the bibliography ...

Post by paulosousa »

Johannes_B wrote: But i really don't understand, why you are doing the bibliography by hand.
What I must do instead of this?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

can't make the bibliography ...

Post by Johannes_B »

Prepare a database in key-value-pairs for the single entries.
Please have a look at TeX.SX.

But i think it is a little late to change now. But you should give it a try for your next project.

Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

can't make the bibliography ...

Post by paulosousa »

It's not late because I have only 10 references at the moment...
Please let me know what I must do to print the references (must be named References)in the document and to have exactly (Hyder, 2007) after "have here the text " in the abstract.

Code: Select all

\documentclass[12pt, twoside, a4paper]{book}
\usepackage[portuguese,english]{babel}
\usepackage[applemac]{inputenc}
\usepackage{amsmath,amssymb,setspace,color}
\usepackage[style=authoryear,sorting=nyt]{biblatex}
\addbibresource{bibfile.bib}

\addto\captionsenglish{%
\renewcommand{\bibname}{References}}

\begin{document}
\onehalfspacing
\linespread{1.5}

\pagenumbering{Roman}
\section*{Abstract}
have here the text \cite{Hyder2007}.

\clearpage 
\tableofcontents
\newpage
\pagenumbering{arabic}

\chapter{Introduction}

\end{document}
In the bibfile.bib I have:

Code: Select all

@article{Hyder2007,
  title={The impact of traumatic brain injuries: a global perspective},
  author={Hyder, Adnan A and Wunderlich, Colleen A and Puvanachandra, Prasanthi and Gururaj, G and Kobusingye, Olive C},
  journal={NeuroRehabilitation},
  volume={22},
  number={5},
  pages={341--353},
  year={2007},
  publisher={IOS Press}
}
please please help me.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

can't make the bibliography ...

Post by Johannes_B »

I used the filecontents environment to keep my testing dir nice an clean. Everybody is naming his/her file somelithing like bib.bib or lit.bib.

Code: Select all

\begin{filecontents}{\jobname.bib}
	@article{Hyder2007,
		title={The impact of traumatic brain injuries: a global perspective},
		author={Hyder, Adnan A and Wunderlich, Colleen A and Puvanachandra, Prasanthi and Gururaj, G and Kobusingye, Olive C},
		journal={NeuroRehabilitation},
		volume={22},
		number={5},
		pages={341--353},
		year={2007},
		publisher={IOS Press}
	}
\end{filecontents}
\documentclass{article}%just for the mwe
\usepackage[portuguese,english]{babel}
\usepackage[style=authoryear,sorting=nyt,backend=biber]{biblatex}
\addbibresource{\jobname.bib}

\addto\captionsenglish{%
	\renewcommand{\bibname}{References}}
	\usepackage{hyperref}
	\begin{document}
		have here the text \cite{Hyder2007}.\par
	Or with parenthesis \parencite{Hyder2007}\par
	Or cite the author: \citeauthor{Hyder2007},
	or just cite the title: \citetitle{Hyder2007}.\par
	You can find guidelines on how to change biblatex styles
	at \url{http://tex.stackexchange.com/questions/12806/}
	\printbibliography[title=References]
	\end{document}
This is just the basic, which should come close to what you want. See the link inside the MWE to find out how to customize biblatex styles. I ususally don't see any reason to tinker with the default.

There are many more useful commands described in the documentation of package biblatex. Be sure to update both biblatex and biber to get the best results.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply