2

This may seem an easy problem to you but for me I am struggling with it!.I need a little help with adding references in my report. I am able to compile and get a pdf doc but my problem is how to cite. I used \cite{ref1} but it does connect with the .bib file. I am getting [ref1] instead of [1].

\documentclass[a4paper]{report}
 \usepackage{graphicx}
 \usepackage[latin1]{inputenc}
 \usepackage[T1]{fontenc}
 \usepackage[english]{babel}
 %\usepackage[style=authortitle-icomp]{biblatex}
 \usepackage{lmodern}
 \usepackage[backend=biber,bibencoding=latinl]{biblatex}
 %\addbibresource{folder/references.bib}
 \begin{document}
my report here
\printbibliography
\end{document}

% Here is the references.bib file in which I have the citation %both the main file and bib file are saved in the same folder

@book{ref1,
isbn = {3-662-45239-1},
title = {Scanning Probe Microscopy},
language = {eng},
author = {Voigtländer, Bert},
publisher = {Springer Berlin Heidelberg},
}
Naema
  • 2,305
  • Should be in any decent LaTeX article book /article about bibliography. Maybe something like \cite{ref1} see a.o. https://en.wikibooks.org/wiki/LaTeX/Bibliography_Management but also the documetation of the biblatex packack – albert Oct 23 '18 at 14:45
  • Maybe you find more information here. – Karlo Oct 23 '18 at 14:46
  • Please have a look at https://tex.stackexchange.com/q/13509/35864. The symptoms suggest you did not run Biber, see https://tex.stackexchange.com/q/63852/35864 and https://tex.stackexchange.com/q/154751/35864. But your encoding settings should be checked. The ä in Voigtländer seems wrong. Nowadays most editors use UTF-8 instead of latin1 (ISO 8859-1). If the encoding of your .bib file and your .tex as declared with \usepackage[...]{inputenc} coincide, there is no need for the bibencoding option. – moewe Oct 23 '18 at 14:49
  • 2
    You need a line \addbibresource{references.bib} to tell biblatex which file to look for. – Andrew Swann Oct 23 '18 at 14:49
  • 1
    Andrew Swann I did this \addbibresource{references.bib} it did not give error but no pdf is produced – Naema Oct 23 '18 at 14:55
  • https://en.wikibooks.org/wiki/LaTeX/Bibliographies_with_biblatex_and_biber – Johannes_B Oct 24 '18 at 05:59

1 Answers1

2

Your are close, but there are two errors

  1. you need a line \addbibresource{references.bib} so biblatex finds the bib file

  2. latinl is not a valid encoding, it should be latin1 (or switch to the default utf8)

Here is a minimal document

Sample text

Sample bib

\documentclass[a4paper]{report}

\usepackage[backend=biber,bibencoding=latin1]{biblatex}
\addbibresource{references.bib}

\begin{document}

My report here \cite{ref1}.

\printbibliography

\end{document}

with references.bib

@book{ref1,
  isbn =     {3-662-45239-1},
  title =    {Scanning Probe Microscopy},
  language =     {eng},
  author =   {Voigtländer, Bert},
  publisher =    {Springer Berlin Heidelberg},
}
Andrew Swann
  • 95,762
  • Thanks Andrew!. I did it but I had another error it is : \textcurrency unavailable in encoding T1 – Naema Oct 23 '18 at 15:02
  • Did you also correct the name of the bibencoding? – Andrew Swann Oct 23 '18 at 15:03
  • \documentclass[a4paper]{report} \usepackage{graphicx} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} %\usepackage[style=authortitle-icomp]{biblatex} \usepackage{lmodern} \usepackage[backend=biber,bibencoding=latin1]{biblatex} \addbibresource{references.bib} \begin{document} – Naema Oct 23 '18 at 15:05
  • You should double check the file encodings, cf. https://tex.stackexchange.com/q/194083/15925 – Andrew Swann Oct 23 '18 at 15:08
  • sorry, I did not apply your solutions properly. Now , I simply copied and pasted your code above and it works!. I have a doc with citation .I can see [1] there. However, the command \printbibliography gives an error ( Package inputenc Error: Unicode character ¤ (U+A4) (inputenc) not set up for use with LaTeX.See the inputenc package documentation for explanation) – Naema Oct 23 '18 at 15:53
  • Good to hear. You may well have to remove the auxillary files .aux, .bbl etc. when you change an encoding. Old files with a previous chosen encoding will cause confusion. – Andrew Swann Oct 23 '18 at 16:05