TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Consider the following example (background in this question).






after running it through Mk-IV is shows the expected behavior:


Simply defining a macros by uncommenting define – without even using it – breaks it. (def does not help either).

enter image description here

How to define citation macros?

share|improve this question
That’s because \reference is an internal Context macro which is used to, well, place references (for internal links). Every entry in the bibliography happens to have such a reference, but as you changed the macro definition, breakage ensues as expected ... call it \bibref and things should work. – Philipp Gesang May 18 '12 at 8:07
Please make this an answer, so I can accept it and less people see what I have done... – Andy May 18 '12 at 8:17
Here you go. Also it would be more precise to remove the tag [bibtex] from this question as MkIV does not rely on Bibtex even though it takes .bib files as input. – Philipp Gesang May 18 '12 at 9:15
up vote 5 down vote accepted

To elaborate a bit on my comment: \reference is the Context user interface macro to the pdf hyperlink facility (for the curious: it is defined among similar commands in strc-ref.mkvi). It is used internally as well, for instance in the macro \thebibtexpublicationlistelement, which typesets a single entry of the bibliography list (cf. bibl-bib.mkiv).

For this reason, redefining \reference is a Bad Idea™: It will definitely break automatically generated references, the corrupted bibliography being collateral damage. If you use \define, Context will kindly give you a hint in the log file:

system          > command \reference is already defined

Choose a harmless macro identifier instead: Capitalization for instance will ensure that a macro never conflicts with any of the internals. Thus, \Reference is the preferable choice.

share|improve this answer

Your Answer


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.