Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Could someone explain meaning of parameters is 3rd argument of the ENTRY declaration that appear in some BST files? Here is small extract from unsrtnat.bst:

ENTRY
  { address
    annote
    . . .
  }
  {}
  { label extra.label sort.label short.list }

I guess that label, extra.label, sort.label, short.list are computed by bibtex.exe but how? The label parameter seems to be ordinal number of current reference. Where one could find complete description of the ENTRY command?

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

The ENTRY function takes three arguments

  1. External string variables - usually the fields
  2. Internal integer variables - usually empty
  3. Internal string variables - usually the label and so forth

These are all variables associated with each entry separately, rather than variables used in the process of calculations. So you need to declare a variable here for each field you want to work with.

In the case of external variables, the list given for ENTRY defines which fields are read from the .bib file. On the other hand, the internal variables have to be calculated somewhere in the .bst file. For example, in unsrtnat.bst you will find

FUNCTION {calc.label}
{ calc.short.authors
  short.list
  "("
  *
  year duplicate$ empty$
  short.list key field.or.null = or
     { pop$ "" }
     'skip$
  if$
  *
  'label :=
}

which is itself called by

FUNCTION {presort}
{ calc.label
  label sortify
  "    "
  *
  seq.num #1 + 'seq.num :=
  seq.num  int.to.fix
  'sort.label :=
  sort.label *
  #1 entry.max$ substring$
  'sort.key$ :=
}

ITERATE {presort}

Notice that just defining the function does not do anything: it is only because ITERATE is used that label is calculated.

There is more on BibTeX in the document Tame the BeaST

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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