Open main menu

Changes

m
no edit summary
< [[Bibliography mkii| Bibliographies in mkii]] | [[sample_bib| sample bib file]] >== Introduction ==__TOC__
TeX offers excellent ways to handle bibliographic references. bibTeX allows you to use a database to manage your references and to insert citations and a list of references into your document. If you're completely new to this subject, you should probably begin to read some basic hints about bibTeX databases. You will find a good selection of resources (most of them are free and available on-line) at the section "Bibliographies and Citations" of the [[http://www.tex.ac.uk/cgi-bin/texfaq2html UK TeX faq]]. A good place for beginners is Nicolas Markey’s [[http://mirror.ctan.org/info/bibtex/tamethebeast/ttb_en.pdf Tame the Beast]]. If you have TeXLive installed, it may already be on your hard disk.
In traditional ConTeXt mkii, support {{TwoColumnsUnderLevel1|Support for bibliographies was added by Tacois integrated in MkIV’s and LMTX’s core (for the curious, the files are named [https://source.contextgarden.net/&#63;search&#61;bibl-tra bibl-tra]. A a Two other important sources of information are: * [[Bibliography_mkiimanual:mkiv-publications.pdf|wiki pageBibliographies manual]] explains * [http://meeting.contextgarden.net/2014/talks/2014-09-09-alan-bibtex/From_BibTeX_to_ConTeXt_MKVI.pdf From BibTEX to ConTEXt mkiv], a few basic facts 2014 presentation about BibTeX and points you to the manual state of the moduleBibliography in MkIV.
For older ConTeXt MkII, support for bibliographies was added by Taco. The '''ConTeXt mkiv and LMTX[[Bibliography_mkii|Bibliography mkii]]''' has support for bibliographies integrated page explains a few basic facts and points you to the manual of the module.|TeX offers excellent ways to handle bibliographic references. BibTeX allows you to use a database to manage your references and to insert citations and a list of references into its core your document. If you’re completely new to this subject, you should probably begin to read some basic hints about BibTeX databases. You will find a good selection of resources (for most of them are free and available on-line) at the section “Bibliographies and Citations” of the curious[[http: the files are named <tt>bibl-tra//texfaq.net/index.html#Bibliographiesandcitations TeX faq]].<A good place for beginners is Nicolas Markey’s [[http://mirror.ctan.org/info/bibtex/tamethebeast/tt>ttb_en. '''This is pdf Tame the page for mkiv support'''Beast]]. If you have TeXLive installed, it may already be on your hard disk.}}
===Important page to link here===
* [[Simple Bibliography]]: A simple bibliography module without any database
* [[Manual Bibliography]]: A very simple bibliography in a few lines
=ConTeXt MkIV Bibliography= Please see* [http://pragma-ade.nl/general/manuals/mkiv-publications.pdf Publications manual]* [http://meeting.contextgarden.net/2014/talks/2014-09-09-alan-bibtex/From_BibTeX_to_ConTeXt_MKVI.pdf Presentation about BibTeX and the 2014 state of Bibliography in MkIV] ==Quickstart==
From the manual:
</texcode>
==Before using any database: the buffer method== Before using a bibliographic database built with tools such as [https://www.jabref.org/ JabRef] or [https://www.zotero.org/ Zotero] (among others), it is possible to use the BibTeX format for bibliographic data by buffering it. With ConTexT MKIV, a relatively simple document of a few pages can be composed with simple commands such as \startbuffer .... \stopbuffer, between which you copy all the bibliographic references to be used in the text like this : <texcode>\startbuffer[biblio] @Book{cicero-tuscu2011, author = {Cicero, Marcus Tullius}, editor = {Fohlen, G.}, publisher = {Les Belles Lettres}, title = {Tusculanes}, year = {2011}, address = {Paris}, edition = {7e tirage}, isbn = {9782251010830}, series = {œuvres philosophiques}, volume = {1}, ppn_gvk = {1823774121}, translator = {Jules Humbert},}</texcode> <texcode>@Book{Aristote2008, Title = {Les Politiques}, Author = {Aristote}, Editor = {Pellegrin, Pierre}, Publisher = {Garnier-Flammarion}, Year = {2008}, Address = {Paris, France}, Series = {Le monde de la philosophie}, Date = {2008}, ISBN = {978-2-08-121816-1}, Location = {Paris, France}, Pagetotal = {xxiii+518}, Translator = {Pierre Pellegrin}}\stopbuffer</texcode> * Next, we will write text between the starttext and stoptext tags, before defining how the references will be printed after the body of the text, in the area defined for the table of contents (and possibly the various indexes, index rerum and index nominum). For the simplest texts, the bibliographic references after the \stopbuffer command can, for example, be defined (with our example) as follows:  <texcode>\usebtxdataset[ancient philosophy][biblio.buffer] \usebtxdefinitions[apa] \definebtxrendering[ancient philosophy][apa][dataset=ancient philosophy] \setupbtxrendering[continue=yes] </texcode> * As you can see, the memory buffer named 'biblio' will be associated with a database named 'ancient philosophy'; the format will follow the American Psychological Association (APA) model. We are writing a short text on Aristotle and Cicero with two bibliographical references in footnotes (one for each philosopher). * Then, we have to give place to what is called 'backmatter', say the the space where the bibliographic references given in the text will be printed, either in the body of the text or, as in our example, as footnotes. In this way, at the end of the document, all the references used from the buffer are summarised. Personally, I find the buffer method simple and easy, but much less powerful and convenient than the method of feeding a bibliographic file, constructed in the form *.bib, using software such as JabRef. ConTeXt will fetch the references from this file as and when they are called up using the \cite command, instead of having to copy each reference into the buffer. Below is a complete sample using a buffer method: <texcode>\startbuffer[biblio] @Book{cicero-tuscu2011, author = {Cicéron, Marcus Tullius}, editor = {Fohlen, G.}, publisher = {Les Belles Lettres}, title = {Tusculanes}, year = {2011}, address = {Paris}, edition = {7e tirage}, isbn = {9782251010830}, series = {œuvres philosophiques}, volume = {1}, ppn_gvk = {1823774121}, translator = {Jules Humbert},} @Book{Aristote2008, Title = {Les Politiques}, Author = {Aristote}, Editor = {Pellegrin, Pierre}, Publisher = {Garnier-Flammarion}, Year = {2008}, Address = {Paris, France}, Series = {Le monde de la philosophie}, Date = {2008}, ISBN = {978-2-08-121816-1}, Location = {Paris, France}, Pagetotal = {xxiii+518}, Translator = {Pierre Pellegrin}}\stopbuffer \usebtxdataset[ancient philosophy][biblio.buffer] \usebtxdefinitions[apa] \definebtxrendering[ancient philosophy][apa][dataset=ancient philosophy] \setupbtxrendering[continue=yes] \starttext \startchapter[title={An Introduction To Philosophy}] In the notes that follow, we will focus on philosophical thought as political philosophy. Aristotle, the Greek philosopher who published and commented on the Constitutions of the ancient Greek cities, begins his work {Politics} with the thesis that {man is a political animal}\footnote{\cite[alternative=entry][ancient philosophy::Aristote2008]}.  Cicero, the great politician and scholarly writer, had the well-known phrase, \quotation{Socrates brought philosophy down from heaven to earth.}\footnote{\cite[alternative=entry][ancient philosophy::cicero-tuscu2011]}, which refers to the fundamental question of philosophy's interest in {\it human things}.  \stopchapter \starttext \startbackmatter \startchapter[title={Bibliographie}] \startsection[title={Ancient Philosophy}]  \placelistofpublications[ancient philosophy][method=local] \stopsection \stopchapter \stopbackmatter \stoptext</texcode> Here is another, more minimal example that additionally sets a default dataset and enables some tracing:<texcode>\startbuffer[testdata]@Book{sometag, author = {Some Person}, title = {An awesome title}, year = {1900}, publisher = {Foo},}@Article{someother, author = {Some Otherperson}, title = {Another title}, year = {1900},}\stopbuffer % enable tracing\enabletrackers[publications, publications.crossref, publications.details, publications.cite, publications.strings] \usebtxdataset[main][testdata.buffer]\usebtxdefinitions[aps]\setupbtx[dataset=main]\definebtxrendering[bibrendering][aps][dataset=main] \starttext Some person said something \cite[sometag]. \placelistofpublications[bibrendering] \stoptext</texcode> =Database Formats==
ConTeXt MkIV Bibliography can read several different formats of bibliographic databases:
===BibTeX .bib format===
ConTeXt is independent from the BibTeX program, but can read .bib databases, if it’s they’re not too polluted with non-standarddized standardized (LaTeX) commands.
This format is the oldest, but supported by most bibliography management programs. The other supported formats use the same structure of records, just ported to different “languages”.
ConTeXt understands UTF-8 encoded bib files as well as old fashioned TeX accent combinations.
====;Fields==== : Some known fields of {{code|@Article}} are (see [http://pragma-ade.nl/general/manuals/mkiv-publications.pdf#&#91;19,{%22name%22:%22Fit%22}&#93; manual p.1419])::* Title (also Title:en, Title:de etc.), Subtitle:* Author (see manual for possible formats):* Journal, Type, Number, Volume, Pages, Review:* Year, Month, Day:* Warning, Comment, Note:* XCrossref:* Doi:* Keywords:* Language:* Url :* author, editor: fields are parsed as "Firstname(s) Lastname", multiple entries separated by 'and' (see manual p.6/14):* keywords: separated by semicolons : There’s a (complete?) overview of categories and their fields in the manual on page 18 (Table 3.2). ====Commands in entries====
You ;Commands in entries: you can define unknown commands like this:
<texcode>
\definebtxcommand\<#1>{\type{#1}}
</texcode>
: btx commands use a separate namespace.
btx commands use a separate namespace. ===MkII .bbl format===
This intermediate format is still supported, but obsolete. Just an example to let you know what it means:
</texcode>
===Lua tables===
Since internally everything anyway are Lua tables, you can use them directly as a database format:
}
===XML===
<xmlcode>
</xmlcode>
==Setup==
<texcode>
</texcode>
===sorttypes===
* default, none, cite, list: don’t sort, use original order
* authoryear: sort by author(s) and publication year
===bib list rendering===
See manual, p.24ff.
* aps (used in physical sciences)
* vancouver (used in biological sciences)
* [https://github.com/jjmccollum/context-sbl sbl] (used in theology), external project
Note: Only apa , aps, and aps chicago styles are currently provided as a showcase.
===Language===
Bibliography lists and citations are rendered in the language of the document (`\mainlanguage`). If an entry includes a language field, this can be used, depending on the rendering specification.
You can define and use translated titles with language modifiers, e.g. `title:de` or `booktitle:fr`.
===Complex example===
To see how the concepts play together, here a relatively complete example:
</texcode>
==Citations==
See p.31ff. of the manual.
The first argument defaults to the default citation rendering, as defined by `\setupbtx[default:cite][alternative=num]`.
==Custom bibliographical styles==
Users who wish to develop their own custom styles could start with the files in the distribution, copy them to different names and then modify them (e.g., the files `publ-imp-apa.lua` and `publ-imp-apa.mkvi`). However, these files contain a number of advanced code to deal with the numerous exceptions and rules. Hence, in some cases, it may be easier to write your own custom style. Here, I will provide you with an example what a minimal setup will be to get you started. Once you have a style in place and understand what's needed, it is easy to experiment further.
===Files===
For every style, you will need two files: one with the TeX setups and one with the Lua definitions. They have to follow the naming conventions that the bibliographic subsystem expects so they can be found. If your style is called `mycustom`, these two files should be `publ-imp-mycustom.mkiv` and `publ-imp-mycustom.lua`.
===The Lua code===
A minimal Lua file can be very brief. It has to contain a little bit of boiler plate with the required tables and the "categories" (i.e. publication types) that your bibliography will process. A minimal example will look like this:
For every type `publicationtype` you want processed, you need an entry `categories.publicationtype`. This entry needs to have a list of fields that will be processed, divided into "required" fields (that every entry needs to have) and "optional" fields (that they may or may not have). Every book needs to have a title, but not necessarily an author. Remember: only types that have a category will be processed. Only fields that are listed in the category will be processed.
===The TeX code===
The TeX file is where the formatting is done. Again, you need to start with a few lines that make the `publ-imp-mycustom.mkiv` file work:
[specification=mycustom,
numbering=yes]
 
\stopbtxrenderingdefinitions
</texcode>
<texcode>
% LMTX: \tolerant\def\dostartbibitemstartbibitem[#1]#*[#2]%LMTX!
{\doifsomethingelse{#2}%
{\startBibItem[reference={#1},title={#2}]}%
{\startBibItem[reference={#1},title={#1}]}%
}
\def\startbibitem{\dodoubleempty\dostartbibitem}
\def\stopbibitem{\stopBibItem}
 
% MkIV:
%\def\dostartbibitem[#1][#2]%
% {\doifsomethingelse{#2}%
% {\startBibItem[reference={#1},title={#2}]}%
% {\startBibItem[reference={#1},title={#1}]}%
%}
%\def\startbibitem{\dodoubleempty\dostartbibitem}
%\def\stopbibitem{\stopBibItem}
\definedescription[BibItem][
</texcode>
 
See also : [[Simple_Bibliography]]
[[Manual_Bibliography|Here’s a similar approach]] using {{cmd|defineitemgroup}}.
 
[[Category:Bibliography]]
4

edits