0

I put a bibliography.bib file in my project, the content is as follow:

@inproceedings{hitaj2017deep,
  title={Deep models under the GAN: information leakage from collaborative deep learning},   
  author={Hitaj, Briland and Ateniese, Giuseppe and Perez-Cruz, Fernando},
  booktitle={Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security},    
  pages={603--618},
  year={2017},
  organization={ACM}
}

@inproceedings{shokri2015privacy,
  title={Privacy-preserving deep learning},
  author={Shokri, Reza and Shmatikov, Vitaly},
  booktitle={Proceedings of the 22nd ACM SIGSAC conference on computer and 
communications security},
  pages={1310--1321},
  year={2015},
  organization={ACM}
}

then I cite the reference, in the .tex:

A book on game theory is \cite{shokri2015privacy}.

\bibliographystyle{plain}    
\bibliography{bibliography.bib}

but I get an error:

(no line number):
This is BibTeX, Version 0.99d (TeX Live 2016/Debian)
Capacity: max_strings=100000, hash_size=100000, hash_prime=85009
The top-level auxiliary file: sample-sigconf.aux
The style file: plain.bst
I found no \citation commands---while reading file sample-sigconf.aux
Database file #1: acmart.bib
You've used 0 entries,
            2118 wiz_defined-function locations,
            497 strings with 4007 characters,
and the built_in function-call counts, 18 in all, are:
= -- 0
> -- 0
< -- 0
+ -- 0
- -- 0
* -- 2
:= -- 7
add.period$ -- 0
call.type$ -- 0
change.case$ -- 0
chr.to.int$ -- 0
cite$ -- 0
duplicate$ -- 0
empty$ -- 1
format.name$ -- 0
if$ -- 1
int.to.chr$ -- 0
int.to.str$ -- 0
missing$ -- 0
newline$ -- 3
num.names$ -- 0
pop$ -- 0
preamble$ -- 1
purify$ -- 0
quote$ -- 0
skip$ -- 1
stack$ -- 0
substring$ -- 0
swap$ -- 0
text.length$ -- 0
text.prefix$ -- 0
top$ -- 0
type$ -- 0
warning$ -- 0
while$ -- 0
width$ -- 0
write$ -- 2
(There was 1 error message)
/usr/share/texlive/texmf-dist/tex/latex/biblatex/biblatex.sty:462:
LaTeX Error:
 Command \bibhang already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.462 \newlength{\bibhang}

I don't know how to solve it.

moewe
  • 175,683
  • 2
    Welcome to TeX.SE! Please do not add code as image here. Simply show us at the best an short compilable code we can test on our own computer. In your case please add both bib antrys as code to your question! – Mensch Oct 22 '18 at 01:47
  • 2
    Looking at the error messages though; have you perhaps loaded both the biblatex and natbib packages in your preamble? They can't be used together. – imnothere Oct 22 '18 at 03:04
  • \bibliographystyle{plain} shows that you want to use BibTeX (with, for example natbib) to produce a bibliography, yet the log file shows that you also load biblatex as LianTze Lim points out. These packages are incompatible and the compilation throws errors. Furthermore, the citations are not processed as intended since the two packages overwrite each other's definitions. Don't load biblatex if you don't want to use it. BTW: It should be \bibliography{bibliography} without the .bib extension. – moewe Oct 22 '18 at 05:39

1 Answers1

2

The snippet from your .tex file

A book on game theory is \cite{shokri2015privacy}.

\bibliographystyle{plain}
\bibliography{bibliography.bib}

(note that it should be \bibliography{bibliography}, the file name in \bibliography does not take the file extension) suggests that you are using traditional BibTeX to build your bibliography and citations. You are probably loading a dedicated additional package like natbib or cite.

Additionally, your .log shows that you are loading biblatex. biblatex uses a completely different system to create bibliographies and citations and is not compatible with the BibTeX approach and its packages (cite, natbib, jurabib, ...). The .log message strongly suggests you are loading a package like natbib before you load biblatex. Since the two packages are incompatible, you get an error

 Command \bibhang already defined.
           Or name \end... illegal, see p.192 of the manual.

This error is not very informative, but the next version of biblatex will make incompatibility errors more useful: https://github.com/plk/biblatex/pull/751.

Long story short, you load biblatex and use traditional BibTeX techniques for your bibliography, those two interfere and cause errors. You need to decide whether you want to use biblatex or traditional BibTeX.

  1. If you want to use traditional BibTeX it should be enough to just remove the call to biblatex in your preamble. You must be loading it somewhere and you should be able to put an end to that.

  2. Switch to biblatex. For all I know this is going to require more change to your document than dropping biblatex, but maybe you want to use one of biblatex's features that BIbTeX does not have. In that case I suggest you follow What to do to switch to biblatex?.

moewe
  • 175,683