2

[So I am new to LaTex. I am self taught, so I apologize ahead of time if I am difficult to work with.]

I am trying to write a paper for a class, and I'd like to cite my sources using a bib file. I am able to do the basics, but for some reason my TeX studio will not compile my document. It appears to stop near the top, at the " \begin{document}" line, and I cannot figure out why. Here is what I have:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[
    backend=bibtex,
    style=alphabetic,
    sorting=nyt,
]{biblatex}
\bibliography{wage.bib}
\title{title}
\author{name}
\date{date}


\begin{document}

\maketitle

... [content]

\printbibliography[title=Works Cited]

\end{document}

I keep getting an error that says "! File ended while scanning use of \field", with the "begin document" line highlighted in red. Here is my bib file:

@article{poverty,
author =       "John Addison and Mickinley Blackburn",
title =        "Minimum Wages and Poverty",
journal =      "Industrial Labor Relations Review",
volume =       "52",
number =       "3",
pages =        "891--921",
year =         "1999",
}

@article{realwage,
author =       "Orley Ashenfelter",
title =        "Comparing Real Wage Rates",
journal =      "American Economic Association",
volume =       "102",
number =       "2",
pages =        "891--921",
year =         "2012",
}

@article{hours,
author =       "Kenneth Couch and David Wittenburg",
title =        "The Resposne of Hours of Work to Increase in the Minimum Wage",
journal =      "Southern Economic Journal",
volume =       "68",
number =       "1",
pages =        "891--921",
year =         "2001",
}

@article{profits,
author =       "Mirko Draca and Stephen Machin and John Van Reenen",
title =        "Minimum Wages and Firm Profitability",
journal =      "American Economic Association",
volume =       "3",
number =       "1",
pages =        "891--921",
year =         "2011",
}

@article{ninefity,
author =       "Joseph Sabia and RIchard Burkenhauser",
title =        "Minimum Wages and Poverty: Will a 9.50 Federal Minimum IWage Really Help the Working Poor?",
journal =      "Southern Economic Journal",
volume =       "76",
number =       "3",
pages =        "891--921",
year =         "2010",
}

@article{politics,
author =       "Russell Sobel",
title =        "Theory and Evidence on the Political Economy of the Minimum Wage",
journal =      "Journal of Political Economy",
volume =       "107",
number =       "4",
pages =        "891--921",
year =         "1999",
}

It was not too long ago when I was able to compile this document just fine. This trouble started when I copy and pasted some sources (in fact, the last two sources of my bib file) into the bib file. I discovered that they had the braces on, instead of the quotations. But after correcting this my document still won't print. This is very frustrating. I've plaid around with the biber / bibtex option, to no avail ; I have read somewhere that I need to change the compiling order under Options - Configure TeX - Build - Default Compiler, but I do not quite understand what this option is, nor does it appear to be doing much.

In addition, when I had a bibliography, I noticed that the bibliography would only print the things I cited within the paper, instead of all of the sources actually listed in my bib file. This was also frustrating.

To summarize, I just want to print/compile this document, with all of the sources in my bib file appearing, in alphabetical order. The contents of the paper is already prepared, it is just the compiling that I am having issue with.

Any and all help would be appreciated.

  • Welcome! Try deleting all generated files and recompiling. You need to make sure that your editor uses biber if you specify that backend or bibtex if you specify that one. Braces work fine in .bib files. I only ever use braces. I call them curly brackets, but that's just me. – cfr Nov 17 '16 at 2:57
  • 1
    Aren't most people who use LaTeX self-taught? – cfr Nov 17 '16 at 3:06
  • 1
    Note that the entry ninefity contains at least two small typos. See also Using BibTeX to make a list of references without having citations in the body of the document?. The \field error is not something we can replicate with the code you have given. Either it is not present any more and can be gotten rid of by deleting temporary (.aux, .bbl, .bcf) files and recompiling, or it lies with other .bib entries we can't see. Note that braces instead of quotation marks are valid, if done right. – moewe Nov 17 '16 at 7:59
  • If you are previewing your PDF in an External PDF reader that can prevent TexStudio from compiling. In that case shut down the external reader and recompile from TexStudio. – John Bentley Nov 23 '16 at 7:31
3

By default, only cited sources are included. If you wish to include everything add

\nocite{*}

somewhere.

You may need to remove generated files to get past the error. Delete the .bbl, .blg, .bcf and/or .aux file and try recompiling. You do need to ensure that your editor uses the correct backend i.e. if you specify biber (or nothing), it needs to use biber; if you specify bibtex, it needs to use bibtex.

Here's my version of your code, with all sources included.

\begin{filecontents}{\jobname.bib}
@article{poverty,
author =       "John Addison and Mickinley Blackburn",
title =        "Minimum Wages and Poverty",
journal =      "Industrial Labor Relations Review",
volume =       "52",
number =       "3",
pages =        "891--921",
year =         "1999",
}

@article{realwage,
author =       "Orley Ashenfelter",
title =        "Comparing Real Wage Rates",
journal =      "American Economic Association",
volume =       "102",
number =       "2",
pages =        "891--921",
year =         "2012",
}

@article{hours,
author =       "Kenneth Couch and David Wittenburg",
title =        "The Resposne of Hours of Work to Increase in the Minimum Wage",
journal =      "Southern Economic Journal",
volume =       "68",
number =       "1",
pages =        "891--921",
year =         "2001",
}

@article{profits,
author =       "Mirko Draca and Stephen Machin and John Van Reenen",
title =        "Minimum Wages and Firm Profitability",
journal =      "American Economic Association",
volume =       "3",
number =       "1",
pages =        "891--921",
year =         "2011",
}

@article{ninefity,
author =       "Joseph Sabia and RIchard Burkenhauser",
title =        "Minimum Wages and Poverty: Will a 9.50 Federal Minimum IWage Really Help the Working Poor?",
journal =      "Southern Economic Journal",
volume =       "76",
number =       "3",
pages =        "891--921",
year =         "2010",
}

@article{politics,
author =       "Russell Sobel",
title =        "Theory and Evidence on the Political Economy of the Minimum Wage",
journal =      "Journal of Political Economy",
volume =       "107",
number =       "4",
pages =        "891--921",
year =         "1999",
}
\end{filecontents}

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[
    backend=bibtex,
    style=alphabetic,
    sorting=nyt,
]{biblatex}
\bibliography{\jobname.bib}
\title{title}
\author{name}
\date{date}


\begin{document}

\maketitle

\nocite{*}

\printbibliography[title=Works Cited]

\end{document}

output with all sources

biber is recommended over bibtex, though, so I'd suggest changing backend=bibtex to backend=biber.

This produces a similar result:

Biber as backend

  • cfr wrote "You may need to remove generated files to get past the error". A tip for the OP, in TexStudio this can be done with the command Tools > Clean Auxiliary Files .... The shortcut is F2. But it's a good idea to keep a manual eye on the effect this has (e.g. through your OS's File Manager). – John Bentley Nov 23 '16 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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