2

This question already has an answer here:

This will be a basic question. Have searched and read a ton of questions and still don't know what my problem is because I don't understand how to use bibtex properly. I will explain all that has happened till now.

I have a tex file called "magneto.tex", after I ran it the first time a "magnetoNotes.bib" appeared and I assumed was the one needed to be changed to cite things, so I started adding my references there. Now I don't think that is the way it's done because whenever I would compile my tex the "magnetoNotes.bib" would weight 0 bytes... so created a new file called "biblio.bib" with the references and now I am using that to reference instead.

At the beginning putting my references in "magnetoNotes.bib" would work most times, what I did then was run bibtex on the .bib file and then run bibtex and fast compilation on my .tex . At the beginning when there were few references it would do it just fine, but now that my references are more it just shows "?" instead. Searched what that meant and it said there was an error in the process, and that the proper way to do things is to compile in latex, then bibtex, then latex again. And that if the error persisted the .bbl file would give indications of what's wrong... checked my folder (first deleted everything that wasn't the two files and then ran my files as bibtex on the .bib and fast compilation on the .tex) and there wouldnt be a .bbl file, which meant I hadn't actually ran bibtex according to the questions/answer I was looking at. So obviously that meant I had to run bibtex in my .tex file (which was not clear for me at all when reading about it). So I thought maybe I had to compile in that order the .tex file and not the .bib file.

Now, doing that (fast compilation, bibtex, fast compilation on .tex) and using as the bibliography the new biblio.bib file I get the error

! Package inputenc Error: Unicode char \u8:− not set up for use with LaTeX. 

and the references still show up with "?".

I have no clue what's wrong. Use fast compilation because can't compile in Latex, there is an error because of a .png image... if I do pdflatex, bibtex, pdflatex on my .tex file I get the same error as well.

I have no clue what any of this means or if I am now doing things properly. Have read almost all the pages that teach you how to use bibtex from the basics and still dont get it.

My document class is

\documentclass[aip, apl, reprint, numerical]{revtex4-1}
\usepackage[utf8]{inputenc}
\usepackage[spanish,english]{babel}
\usepackage{graphicx}

\setcitestyle{numbers,square}

\begin{document}

\section{Introduction: }
bla bla \cite{Kitanovski1}


\bibliographystyle{unsrt}
\bibliography{biblio} 

\end{document}

Few of the things in the bibliography are:

     @Inbook{Kitanovski1,
     author="Kitanovski, Andrej
     and Tu{\v{s}}ek, Jaka   
     and Tomc, Urban  
     and Plaznik, Uro{\v{s}}
     and O{\v{z}}bolt, Marko
     and Poredo{\v{s}}, Alojz",
     title="The Thermodynamics of Magnetocaloric Energy Conversion",
     bookTitle="Magnetocaloric Energy Conversion: From Theory to Applications",
     year="2015",
     publisher="Springer International Publishing",
     address="Cham",
     pages="1--21",
     isbn="978-3-319-08741-2",
     doi="10.1007/978-3-319-08741-2_1",
     url="http://dx.doi.org/10.1007/978-3-319-08741-2_1"
     }

     @article{weiss,
     author = "Weiss P 
     and Piccard A",
     title = "Lé phénoméne magnétocalorique",
     journal = "J. Phys (Paris)",
     year = "1917",
     volume = "7",
     number = " ",
     pages = "103-109"
     }

There are mostly article ones, a few books referenced.

marked as duplicate by user36296, Stefan Pinnow, Werner, Zarko, Mensch Aug 23 '16 at 21:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You should search TeX.SX for questions about biblatex as your question is almost certainly answered somewhere. Currently you have given no information about how you have configured your bibliography so it will be very hard for people to help you. Please post a minimal working example if you'd like more precise help. – Andrew Aug 18 '16 at 4:39
  • 1
    Short answers to your question are that the ?s appear the first time you latex your file, or if bibtex cannot find the reference. The ?'s are replaced by citations on the second compile. The font encoding problems are almost certainly due to some strange characters, probably in your bibliography but it is impossible to say more without more details. Please give a minimal working example! – Andrew Aug 18 '16 at 4:39
  • Is that what you needed to know more? There should be no problems in the code in the bib file since it used to cite before, don't know why it did though cuz it seems I wasn't doing it correctly. So is the latex, bibtex, latex compilation have to be done in the .tex file? I still dont understand that. Does it work if instead of Latex you do a quick compilation? – M.O. Aug 18 '16 at 5:09
  • 1
    In the weiss entry, the author field should either be "Weiss, P. and Piccard, A." or "P. Weiss and A. Piccard"; "Weiss P, Piccard A" is not correct. Separately, in your write-up you state the filename of the bib file as magnetoNotes.bib, but in the code you post it as just biblio[.bib] -- what gives? – Mico Aug 18 '16 at 5:28
  • 1
    @Mariel The errormessage means there is a symbol which is not suitable for tex and/or the encoding of your file. A wild guess, try to remove all the é from the title of the article and test if this works. Or maybe it's one of the -. – user36296 Aug 18 '16 at 8:41
2

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

I encounter no errors when compiling the following document with latex, bibtex, and latex twice more.

Note that I've corrected the author field of the second entry and, additionally, changed the entry type of the first entry from @inbook to @incollection. Furthermore, as the unsrt bibliography style is not capable of any citation call-out style other than numerical, I've omitted that option from the \documentclass instruction. Finally, I've commented out the redundant instruction \setcitestyle{numbers,square}.

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{biblio.bib}
     @Incollection{Kitanovski1,
     author="Kitanovski, Andrej and Tu{\v{s}}ek, Jaka   
        and Tomc, Urban and Plaznik, Uro{\v{s}}
        and O{\v{z}}bolt, Marko and Poredo{\v{s}}, Alojz",
     title="The Thermodynamics of Magnetocaloric Energy Conversion",
     bookTitle="Magnetocaloric Energy Conversion: From Theory to 
        Applications",
     year="2015",
     publisher="Springer International Publishing",
     address="Cham",
     pages="1--21",
     isbn="978-3-319-08741-2",
     doi="10.1007/978-3-319-08741-2_1",
     url="http://dx.doi.org/10.1007/978-3-319-08741-2_1"
     }
     @article{weiss,
     author = "Weiss, P. and Piccard, A.",
     title = "Lé phénoméne magnétocalorique",
     journal = "J. Phys (Paris)",
     year = "1917",
     volume = "7",
     number = " ",
     pages = "103-109"
     }
\end{filecontents}

\documentclass[aip, apl, reprint]{revtex4}
\usepackage[utf8]{inputenc}
\usepackage[spanish,english]{babel}
\usepackage{graphicx}
\bibliographystyle{unsrt}

%\setcitestyle{numbers,square}  % redundant

\begin{document}
\cite{Kitanovski1}, \cite{weiss}

\bibliography{biblio} 
\end{document}
  • I got the numerical out of the document class and compiled again and it still returns the same error. I have the bib as a separate file, not in the tex itself, does that matter? – M.O. Aug 18 '16 at 5:49
  • @Mariel - "it still returns the same error": Can you be more specific, please? Is your bib file called biblio.bib? Did you run latex, bibtex, and latex twice more? – Mico Aug 18 '16 at 6:13
  • The bib file is called like that. I ran the quick compilation option, not the latex because of what I said in the post. Did quick compilation, bibtex, and quick compilation again. The first quick compilation is fine, no errors and the "?" appears in the pdf, then bibtex, and then when I try the quick compilation again I get the error mentioned. Same happens if I compile with pdflatex instead of latex. Making sure of course all of the .aux and complementary files are deleted before compiling for the first time... Once I get the error there is no way of compiling without it appearing again. – M.O. Aug 18 '16 at 6:23
  • @Mariel - What is "quick compilation"? And, why would you run "quick compilation" (whatever it is...) instead of latex? Please state the exact error message you're getting. As i've stated, I have no problems at all compiling the code I've posted -- please see the screenshot to verify this claim. If you're experience problems, it must be because you're not running latex/bibtex/latex/latex. – Mico Aug 18 '16 at 6:38
  • The error was written in the post, it's "! Package inputenc Error: Unicode char \u8:− not set up for use with LaTeX. ". I dont know what quick compilation is in english, my compiler is in spanish so that's the translation to english of what I use. I use texmaker and It's the first option of compilation, the second option is Latex. – M.O. Aug 18 '16 at 6:41

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