Difference between revisions of "Bibliography mkii"

From Wiki
Jump to navigation Jump to search
m (Reverted edits by 85.18.190.7 (Talk); changed back to last version by Patrick Gundlach)
Line 14: Line 14:
 
The PDF manual can be found on the [[modules:bib| bib module]] page or in your ConTeXt installation.  For me (ConTeXt installed in my home directory), it's in <tt>~/texmf/doc/context/bib/bibmod-doc.pdf</tt>
 
The PDF manual can be found on the [[modules:bib| bib module]] page or in your ConTeXt installation.  For me (ConTeXt installed in my home directory), it's in <tt>~/texmf/doc/context/bib/bibmod-doc.pdf</tt>
  
<u style="display: none;">... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ...  </u>== Example of use with bibtex ==
+
== Example of use with bibtex ==
  
 
Bibtex support is not integrated in texexec (yet), so you have to run bibtex by hand.
 
Bibtex support is not integrated in texexec (yet), so you have to run bibtex by hand.
Line 20: Line 20:
 
Assuming you have saved this bit of code as bibdemo.tex:
 
Assuming you have saved this bit of code as bibdemo.tex:
 
<texcode>
 
<texcode>
Semodule[bib]
+
\usemodule[bib]
Semodule[bibltx]
+
\usemodule[bibltx]
setupbibtex[database=xampl]
+
\setupbibtex[database=xampl]
starttext
+
\starttext
As te[article-full] already indicated, bibtex is a atex-centric program.
+
As \cite[article-full] already indicated, bibtex is a \LaTeX-centric program.
�mpletepublications
+
\completepublications
stoptext
+
\stoptext
 
</texcode>
 
</texcode>
  
then you have to run the following three commands:
+
Then you have to run the following three commands:
 
<pre>
 
<pre>
 
texexec --once bibdemo
 
texexec --once bibdemo
Line 35: Line 35:
 
texexec bibdemo
 
texexec bibdemo
 
</pre>
 
</pre>
to get the typeset result. xampl.bib comes with the bibtex distribution, it should be on your harddisk somewhere already.  on my tetex 3.0 system, <tt>/usr/share/texmf-tetex/bibtex/bib/base/xampl.bib</tt> is the location.
+
To get the typeset result. xampl.bib comes with the bibtex distribution, it should be on your harddisk somewhere already.  On my teTeX 3.0 system, <tt>/usr/share/texmf-tetex/bibtex/bib/base/xampl.bib</tt> is the location.
  
the <code>semodule[bibltx]</code> line is needed because <tt>xampl.bib</tt> uses latex commands and defines them using latex syntax.  the <tt>bibltx</tt> module allows context to understand some such constructions (which is enough for it to work with <tt>xampl.bib</tt>).  newer versions of context don't include <tt>t-bibltx.tex</tt>.  however, on the mailing list taco said he'd restore it in due course.  meanwhile [[image:t-bibltx.tex|here]] is the previous version, which you can put in the <tt>tex/context/bib/</tt> directory of your context installation.
+
The <code>\usemodule[bibltx]</code> line is needed because <tt>xampl.bib</tt> uses LaTeX commands and defines them using LaTeX syntax.  The <tt>bibltx</tt> module allows ConTeXt to understand some such constructions (which is enough for it to work with <tt>xampl.bib</tt>).  Newer versions of ConTeXt don't include <tt>t-bibltx.tex</tt>.  However, on the mailing list Taco said he'd restore it in due course.  Meanwhile [[Image:t-bibltx.tex|here]] is the previous version, which you can put in the <tt>tex/context/bib/</tt> directory of your ConTeXt installation.
  
 
== Changing the way you show the publication list ==
 
== Changing the way you show the publication list ==

Revision as of 15:16, 2 August 2006

< Modules | User:Taco/Bib >

The bib module provides the \cite and \placepublications commands, in addition to some setup commands, for collecting and referencing bibliography. Single references can be supplied by special commands, or by using BibTeX databases.

As of Context 2005.01.13, this module is part of the standard distribution, but the latest version is not yet included. It can be downloaded from the modules:bib site (Hans picks up the zip from that location as well, so from now on the latest version will always be in the modules section).

The PDF manual can be found on the bib module page or in your ConTeXt installation. For me (ConTeXt installed in my home directory), it's in ~/texmf/doc/context/bib/bibmod-doc.pdf

Example of use with bibtex

Bibtex support is not integrated in texexec (yet), so you have to run bibtex by hand.

Assuming you have saved this bit of code as bibdemo.tex:

\usemodule[bib]
\usemodule[bibltx]
\setupbibtex[database=xampl]
\starttext
As \cite[article-full] already indicated, bibtex is a \LaTeX-centric program.
\completepublications
\stoptext

Then you have to run the following three commands:

texexec --once bibdemo
bibtex bibdemo
texexec bibdemo

To get the typeset result. xampl.bib comes with the bibtex distribution, it should be on your harddisk somewhere already. On my teTeX 3.0 system, /usr/share/texmf-tetex/bibtex/bib/base/xampl.bib is the location.

The \usemodule[bibltx] line is needed because xampl.bib uses LaTeX commands and defines them using LaTeX syntax. The bibltx module allows ConTeXt to understand some such constructions (which is enough for it to work with xampl.bib). Newer versions of ConTeXt don't include t-bibltx.tex. However, on the mailing list Taco said he'd restore it in due course. Meanwhile here is the previous version, which you can put in the tex/context/bib/ directory of your ConTeXt installation.

Changing the way you show the publication list

If you use bibtex and you want to change the way you show the publication list you might want to look at the following example, it will change the publication list showing the surname in uppercase.

(Credits go to Taco Hoekwater)

%D Copied from \invertedshortauthor, with an extra \uppercase
%D \type{#1} = firstnames
%D \type{#2} = von
%D \type{#3} = surname
%D \type{#4} = inits
%D \type{#5} = junior

\unprotect\def\UCauthor#1#2#3#4#5%
   {\bibdoif{#2}{#2\bibalternative\c!vonsep}%
    \uppercase{#3}\bibalternative\c!surnamesep    
    \bibdoif{#5}{#5\bibalternative\c!juniorsep}%
    \bibdoif{#4}{#4\unskip}}
\protect

After that, you can do:

\setuppublicationlist
    [artauthor=\UCauthor,
     editor=\UCauthor,
     author=\UCauthor]

Other tips

  • To refer directly to a reference number (called inline or online cite), you can do \cite[left=,right=][myRef] or simply define
\def\onlinecite#1{\cite[left=,right=][#1]}

\onlinecite[myRef]
  • To add further information to a reference, such as a page number within a book, do
\cite[extras={, page 275}][your-book-reference]