Difference between revisions of "Bibliography mkii"

From Wiki
Jump to navigation Jump to search
(fix link)
(Add tip: \def\onlinecite#1{\cite[left=,right=][#1]})
Line 66: Line 66:
 
</texcode>
 
</texcode>
  
 +
== Other tips ==
 +
 +
* To refer directly to a reference number (called inline or online cite), you can do <tt>\cite[left=,right=][myRef]</tt> or simply define
 +
<texcode>
 +
\def\onlinecite#1{\cite[left=,right=][#1]}
 +
 +
\onlinecite[myRef]
 +
</texcode>
  
 
[[Category:Modules]]
 
[[Category:Modules]]

Revision as of 17:46, 9 May 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).

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]
\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)

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]