1

I'm trying to get working bibliography in this APS journal template (https://it.sharelatex.com/templates/journals/aps).

Using commands for BibTex found online it's not working. For example:

\cite{comune:1}

Just before \end{document}:

\bibliography{bib}

And after \begin{document}:

\bibliographystyle{plainnat}

So in the same folder i put a file bib.bib that contains the entry:

@ONLINE {comune:1,
    author = "Comune di Manfredonia",
    title  = "Preferenze Consiglio comunale - Riepilogo generale per Lista",
    month  = "may",
    year   = "2015",
    url    = "http://www.comune.manfredonia.fg.it/attivitaservizi/elettorale/ele2015/index.htm"
}

But this way it just doesn't show anything. What is going on?? Thank you

[UPDATE] Compiling BibTex (F11) and then two time PDFLatex (F6) i had the bibliography. But why link is splitted over two columns?

enter image description here

7
  • do you have a \bibliographystyle{} commands?
    – Guido
    May 7, 2016 at 15:02
  • Yes, just after \begin{document}. Added in the original question.
    – slash89mf
    May 7, 2016 at 15:04
  • I'm not able to reproduce the problem. It works for me (tested on sharelatex)
    – Guido
    May 7, 2016 at 15:15
  • Can you link me you source code? I can't get it working on sharelatex too
    – slash89mf
    May 7, 2016 at 15:17
  • 1
    Restricted, i can't access it. Click on Share, then make it public.
    – slash89mf
    May 7, 2016 at 15:39

1 Answer 1

1

(Too long for a comment, hence posted as an answer.)

In the following example, I load the revtex4-1 document class, since that's also the document class loaded by the template file you've provided a link to.

Observe that I would encase the contents of the author and title fields in curly braces in order to (a) inform BibTeX that the author is a "corporate" author (rather than a person whose first name is "Comune", whose "von" component is "di", and whose surname is "Manfredonia") and (b) to prevent BibTeX from lower-casing the words in the title field. I would further like to recommend you issue the instruction \raggedright immediately before \bibliography.

The following code appears to compile fine under ShareLaTeX.

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{bib.bib}
@misc{xyz,author="ABC",title="DEF",year=3001}
@ONLINE{comune:1,
    author = "{Comune di Manfredonia}",
    title  = "{Preferenze Consiglio comunale---Riepilogo generale per Lista}",
    month  = "Maggio",
    year   = "2015",
    url    = "http://www.comune.manfredonia.fg.it/attivitaservizi/elettorale/ele2015/index.htm"
}
\end{filecontents}

\documentclass[ reprint,amsmath,amssymb, aps]{revtex4-1}
\bibliographystyle{plainnat}
\usepackage[italian]{babel}

\begin{document}
\cite{comune:1}, 
\cite{xyz} % dummy entry

\raggedright  % <- recommended
\bibliography{bib}
\end{document}
4
  • Ok, compiling BibTex and then two times pdflatex now i'm getting the bibliography. But the link is splitted over two columns (see original question). How can i get it like your image?
    – slash89mf
    May 7, 2016 at 17:46
  • @slash89mf - Do you have just 1 bib entry, or more than 1? (Note that my example code used 2 entries; the screenshot showed only a part of the page generated by the mini-document.)
    – Mico
    May 7, 2016 at 17:49
  • Just one. Do i need at least two entries?
    – slash89mf
    May 7, 2016 at 17:50
  • @slash89mf - If you change my example to have only one \cite instruction, the remaining bib entry will be split across two columns. How serious/bad is this, in the grand design of things?
    – Mico
    May 7, 2016 at 17:52

You must log in to answer this question.

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