On Fri, 27 Jun 2008, Andrea Valle wrote:

>> Suppose your file is called thesis.tex (Ok, I had to test things to ensure
>> what I was saying was true, and that is the only test file that I have
>> currently :). Now run
>>      $context thesis
>> This will create a lot of warnings about missing references, ignore them.
>> Then run
>>      $bibtex thesis
>> This will create tesis.bbl. Now run context, and all those warnings will
>> be gone. You only need to run bibtex once (unless you change your bib
>> file).
>> 
>
> So, it's like latex?

Well, not exactly. Let me explain how bibtex works in latex, and then how 
it works in context.

In latex, you write \cite{ref1}, \cite{ref2}, etc. to cite a document, 
\bibliographystyle{style} to tell the style of the references, and 
\bibliography{bib-file} to tell the name of the bib database. When you run 
latex on this file, for each \cite{ref1} latex writes \citation{ref1} into 
the aux file; for \bibliographystyle{style} it writes \bibstyle{style} and 
for \bibliography{bib-file} it writes \bibdata{bib-file}. Latex aux file 
contains all sort of auxillary information, but bibtex only reconizes the 
about three commands. When you run bibtex, it translates the references 
included in \citation from the bib-file to latex markup, as specified by 
the style file. These are stored in the bbl file.

All these features are hardcoded in bibtex, so it makes it difficult to 
use bibtex with anything other than latex. The bib module exploits a 
feature in bibtex to make it work with context. If you write \cite{*} in 
your latex document, latex writes \citation{*} in the aux file, and bibtex 
translates *all* the enteries in the bib-file to latex markup. So, the bib 
module writes \citation{*} to the aux file. Next, in order to get the 
references in a manner that context can understand, Taco has written a bib 
style file that translates the bib file to \start \stop publication style.
So, in terms of interaction with bibtex, bib module creates a very simple 
aux file

\citation{*}
\bibstyle{cont-no}
\bibdata{bib-file}

When you run bibtex on this, bibtex translates *all* the references in 
your bib file to context markup. On the second run, the bib module reads 
these commands, and stores everything as registers internally and uses 
ConTeXt inbuilt functions for sorting etc.

> Have I to specify that I'm using the bib module?

Usually, you only need to do:

\usemodule[bib]
\setupbibtex[database=bib-file]
\setuppublications[alternative=ieee] % ieee is my own bib style
                                      % see documentation for other options

Normally (that is in mkii), context (rather texexec) runs bibtex after the 
first run behind the scenes. In mkiv running is not implemented in 
mtx-context script yet. So you need to run bibtex *once* after the first 
run. This will create the bbl file, which contains *all* your references 
in the bib file, so until you change your bib file, you do not need to run 
bibtex again. Again, this is temporary; once mtx-context allows for 
commands to be executed inbetween context runs, you will not need to run 
bibtex by hand.

> I mean, this:
>
> \usemodule[bibltx]

Normally you should not need to include the bibltx module. The bibltx 
module reads the bbl files created by bibtex for latex. Suppose you have 
an old latex project, and you only have its bbl file but not the bib file. 
Suppose you want to translate the project to context. 
Then rather than translating all your references back to bib 
format, the bibltx module allows you to use the bbl file created for 
latex. You should not need to do this for new projects.

> \setupbibtex[database=semiotiche]

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to