BibTeX, biblatex and biberUse of \@year@ doesn't match its definition.

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
faun
Posts: 14
Joined: Thu Apr 28, 2011 1:13 pm

Use of \@year@ doesn't match its definition.

Post by faun »

Good day,

Everytime I try to use Bibtex for my references I get the same error.
Use of \@year@ doesn't match its definition.
You can find information in the screenshots here:

The Error:
http://i.imm.io/QPY5.jpeg
error.jpeg
error.jpeg (41.76 KiB) Viewed 20497 times
My BIB-file
http://i.imm.io/QPY2.jpeg
bib.jpeg
bib.jpeg (22.97 KiB) Viewed 20497 times
Just for information, here is my latex code:

Code: Select all

\documentclass[11pt,a4paper,oneside]{book}
\usepackage{parskip}					%paragraph ruimte
\usepackage{a4wide}                     % Iets meer tekst op een bladzijde
\usepackage[dutch]{babel}               % Voor nederlandstalige hyphenatie (woordsplitsing)
\usepackage{amsmath}                    % Uitgebreide wiskundige mogelijkheden
\usepackage{amssymb}                    % Voor speciale symbolen zoals de verzameling Z, R...
\usepackage{apacite}					% APA citaten!
\usepackage{makeidx}                    % Om een index te maken
\usepackage{url}                        % Om url's te verwerken
\usepackage{titlesec}					% hoofdstukken dinges
\usepackage{graphicx}                   % Om figuren te kunnen verwerken
\usepackage[small,bf,hang]{caption}     % Om de captions wat te verbeteren
\usepackage{xspace}                     % Magische spaties na een commando
\usepackage{float}                      % Om nieuwe float environments aan te maken. Ook optie H!
\usepackage{flafter}                    % Opdat floats niet zouden voorsteken
\usepackage{listings}                   % Voor het weergeven van letterlijke text en codelistings
\usepackage[nottoc]{tocbibind}		% Bibliografie en inhoudsopgave in ToC; zie tocbibind.dvi
\usepackage{eurosym}                    % om het euro symbool te krijgen
\usepackage{textcomp}                   % Voor onder andere graden celsius
\usepackage{fancyhdr}                   % Voor fancy headers en footers
\usepackage[Gray,squaren,thinqspace,thinspace]{SIunits} % Om elegant eenheden te zetten
\usepackage[version=3]{mhchem}          % Voor elegante scheikundige formules
\usepackage{setspace}
\setlength{\headheight}{15pt}

\begin{document}

\chapter{chapter1}

Some random text

\citeA{ganser}


\bibliographystyle{plain}
\bibliography{example}


\end{document}

Latex code for my BIB-file:

Code: Select all

@book{ganser,
   author = {DANIELE, G.},
   title = {NATO's Secret Army: Operation Gladio and Terrorism in Western Europe},
   publisher = {Routledge},
   year = {2005}
}
Last edited by cgnieder on Sat Dec 29, 2012 11:51 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Use of \@year@ doesn't match its definition.

Post by CrazyHorse »

faun wrote: Everytime I try to use Bibtex for my references I get the same error.
Use of \@year@ doesn't match its definition.
the package apacite requires the bst file of the same name:

Code: Select all

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{ganser,
author = {DANIELE, G.},
title = {NATO's Secret Army: Operation Gladio and Terrorism in Western Europe},
publisher = {Routledge},
year = {2005},
}
\end{filecontents*}

\documentclass[11pt,a4paper,oneside]{book}
\usepackage[dutch]{babel} 
\usepackage{apacite}
\begin{document}

\chapter{chapter1}
Some random text

\citeA{ganser}

\bibliographystyle{apacite}
\bibliography{\jobname}

\end{document}
And by the way: you should use package geometry for setting margins instead of the deprecated a4wide.
faun
Posts: 14
Joined: Thu Apr 28, 2011 1:13 pm

Use of \@year@ doesn't match its definition.

Post by faun »

Still not working.
Used this code now:

Code: Select all

\documentclass[11pt,a4paper,oneside]{book}
    \usepackage{parskip}                                    %paragraph ruimte
    \usepackage{a4wide}                     % Iets meer tekst op een bladzijde
    \usepackage[dutch]{babel}               % Voor nederlandstalige hyphenatie (woordsplitsing)
    \usepackage{amsmath}                    % Uitgebreide wiskundige mogelijkheden
    \usepackage{amssymb}                    % Voor speciale symbolen zoals de verzameling Z, R...
    \usepackage{apacite}                                    % APA citaten!
    \usepackage{makeidx}                    % Om een index te maken
    \usepackage{url}                        % Om url's te verwerken
    \usepackage{titlesec}                                   % hoofdstukken dinges
    \usepackage{graphicx}                   % Om figuren te kunnen verwerken
    \usepackage[small,bf,hang]{caption}     % Om de captions wat te verbeteren
    \usepackage{xspace}                     % Magische spaties na een commando
    \usepackage{float}                      % Om nieuwe float environments aan te maken. Ook optie H!
    \usepackage{flafter}                    % Opdat floats niet zouden voorsteken
    \usepackage{listings}                   % Voor het weergeven van letterlijke text en codelistings
    \usepackage[nottoc]{tocbibind}          % Bibliografie en inhoudsopgave in ToC; zie tocbibind.dvi
    \usepackage{eurosym}                    % om het euro symbool te krijgen
    \usepackage{textcomp}                   % Voor onder andere graden celsius
    \usepackage{fancyhdr}                   % Voor fancy headers en footers
    \usepackage[Gray,squaren,thinqspace,thinspace]{SIunits} % Om elegant eenheden te zetten
    \usepackage[version=3]{mhchem}          % Voor elegante scheikundige formules
    \usepackage{setspace}
    \setlength{\headheight}{15pt}

    \begin{document}

    \chapter{chapter1}

    Some random text

    \citeA{ganser}


    \bibliographystyle{apacite}
    \bibliography{example}


    \end{document}
I don't understand the error. Why couldn't they the error more clearer to understand?

Also, I pasted your code and I ran into a bunch of errors as well.
Last edited by Stefan Kottwitz on Sat Dec 29, 2012 2:55 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Use of \@year@ doesn't match its definition.

Post by Stefan Kottwitz »

faun wrote:Still not working.
What does this mean? Do you get the same error message, or a different error message? What happened?
faun wrote:Also, I pasted your code and I ran into a bunch of errors as well.
Perhaps tell us the error messages. Otherwise the comment is pretty useless.

Both Herbert and your code work for me. I got error messages (macros already defined) but this was fixed after I updated apacite, earlier versions had compatibility issues with babel.

Stefan
LaTeX.org admin
faun
Posts: 14
Joined: Thu Apr 28, 2011 1:13 pm

Use of \@year@ doesn't match its definition.

Post by faun »

Same error message as in the screenshot:
Use of \@year@ doesn't match its definition.

What does that message mean exactly?

Not at home at this moment. I'll try again and give the error messages whwen I get home.


Thanks for your help.
Last edited by cgnieder on Tue Jan 01, 2013 8:54 pm, edited 1 time in total.
faun
Posts: 14
Joined: Thu Apr 28, 2011 1:13 pm

Use of \@year@ doesn't match its definition.

Post by faun »

First of all, happy new year to all.

Both codes say : "citation "ganser" undefined" after running in latex.
Last edited by faun on Wed Jan 02, 2013 2:41 pm, edited 4 times in total.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Use of \@year@ doesn't match its definition.

Post by CrazyHorse »

faun wrote:First of all, happy new year to all.

Here the error for the code from CrazyHorse:
http://i.imm.io/RgJd.jpeg

It seems to me he sees the citation undefined, but it is for sure in the file.
For _every_ first run a citation is _undefined_. And that is not an error it
is warning which is far different. All documents with citations or refences needs at least _two_ latex runs.
faun
Posts: 14
Joined: Thu Apr 28, 2011 1:13 pm

Re: Use of \@year@ doesn't match its definition.

Post by faun »

I've runned it already a dozen times. I get the same warning over and over.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Use of \@year@ doesn't match its definition.

Post by Stefan Kottwitz »

Did you run BibTeX? Besides compiling with LaTeX, you need to run BibTeX on the file, either via your editor (some can do it) or via the command line (bibtex documentname), another LaTeX run is required afterwards, to get the references.

Stefan
LaTeX.org admin
faun
Posts: 14
Joined: Thu Apr 28, 2011 1:13 pm

Re: Use of \@year@ doesn't match its definition.

Post by faun »

I am not sure I did. I'll try when I get home.

So I first need to run bibtex on test.bib, which was created during the first process?

Then I need to run latex again on my code from CrazyHorse?
Last edited by faun on Wed Jan 02, 2013 2:20 pm, edited 1 time in total.
Post Reply