The following example has one relevant entry for this question, the year field.

    author={de Oliveira, W.R. and De Souto, M. C P and Ludermir, T.B.},
    booktitle={Neural Networks, 2002. SBRN 2002. Proceedings. VII Brazilian Symposium on},
    title={Turing machines with finite memory},
    keywords={Turing machines;finite automata;neural nets;noise;DTM;FSA;TM;Turing         computability;computational equivalence;finite state automaton;finite-memory Turing machine;limited weight precision;neural networks;noise;Analog computers;Automata;Biology computing;Computer networks;Humans;Magnetic heads;Neural networks;Neurons;Turing machines;Writing},

When I put the BibTeX entry as posted, my editor will recognise the left hand side of the = and perform syntax highlighting, but do nothing for the right hand side. If I remove the curly brackets to make the field year=2002,, my editor recognises the number 2002 and performs adequate syntax highlighting.

For the regular expression detecting numbers for syntax highlighting, dealing with {} is not that big of a deal. So I am wondering: is this just an issue with my editor, or does BibTeX treat naked numbers, i.e. year=2002, differently from enclosed ones, i.e. year={2002},?

I can see why you need {} for data with spaces and I understand author={Some Name} vs. autor={{Some Name}}, but neither helps understanding the brackets around simple numbers ...


From the useful bibtex document Tame the BeaST:

• For numerical values, curly braces and double quotes can be omitted.

bibtex can be programmed to behave in many ways, but as Joseph Wright points out the above is independent of the styles used. In both this document and the user guide "Bibtexing" in btxdoc.pdf numerical year fields are written without braces as standard.

Delving deeper into bibtex.web we find

Each field consists of a field name, an |equals_sign|, and nonempty list of field tokens separated by |concat_char|s. Each field token is either a nonnegative number, a macro name (like `jan'), or a brace-balanced string delimited by either |double_quote|s or braces.

The processing in the file concatenates the field tokens into a string. In particular, unquoted digits are just added as characters to the string giving the same result as if they had been a quoted field.

  • 2
    As BibTeX processes the .bib file before the styles see the data, I'd say this is entirely independent of the style in use. – Joseph Wright May 20 '14 at 8:19
  • @JosephWright Many thanks - reading through bibtex.web confirms that. Answer updated. – Andrew Swann May 20 '14 at 9:04

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.