Open main menu

Changes

1,108 bytes added ,  22:47, 3 November 2012
no edit summary
= First Approach =Sometimes the bibliography needs to be more flexible in the bibliographic item description. Often the aviable data does not fit into the Bibtex schema; or text needs to be written inside the bibliography list. For this case exists the module simplebib.
(Version 0.04)==Items==
Sometimes the The bibliography needs to can be more flexible. For this case here is a simple module listed in one block or distributed over several block in the document (still in development) to helpe. It is also a good starting-point for your own adaptiong.at the end of every chapter):
Still open points:<texcode>... \startbibliography...\stopbibiography ...* interface should be multilingual (this version has german output, but it can be replaced easily)* \item[startbibliography...\stopbibiography ...] should be rightaligned* modulesparamter refcolor is always empty - so not working</texcode>
Inside the bibliography environment you can specify bibliographic items via <code>\bibitem</code>.
<texcode>
\startmodulebibitem[simplebibreference=,label=,author=,editor=,year=,title=,in=,number=,series=,volume=,magazine=,edition=,revedition=,datedition=,publisher=,place=,isbn=,url=,pages=,access=]</texcode>
\unprotectMost attributes should be self explaining. A speciality is the <code>in</code> attribute. Often you have to cite an article that is published in a journal, compendium etc. So you use the "normal" attributes to specify the article and via the <code>in</code> attribute you specify the book with the same attributes inside:
<texcode>\setupmodulebibitem[itemspacereference=12bpf,refcolorlabel=grey{BüPrFr},author={Büchel, Christian; Price, Cathy J und Friston, Karl},year={1998},title={A multimodal language region in the ventral visual pathway},in={{title=Nature},volume={394},pages={274-277}}]</texcode>
If the label should be numbered automaticly just remove the <code>label</code> attribute of the <code>\definecolor[grey][s=bibitem</code> entity.35]
\defineitemgroup[bibliography]\setupitemgroup[bibliography][levels=1,left={[},rightReferencing={]},stopper=]\expanded{\setupitemgroup[bibliography][1][n,\currentmoduleparameter{itemspace}*broad]}
For referencing simplebib is using the [[Cross Referencing|crossref]] module. For the lazy ones it provides <code>\bibtex</code> what is nothing else than a <code>\crossref</code> with <code>type=external</code> preset.
\def\bibitem[#1]#2{\doifemptyelse{#2}% {\item[#1]}% {\sym{\cap{#2}}\textreference[#1]{\cap{#2}}}}%So in following example both blocks do the same:
\def<texcode>\bibref[#1ref1]#2{\doifemptyelse{#2} {\colorbibref[grau]detail={[\in[#1]]}p. 38} {\color[grau]{[\in[#1], #2ref1]}}}
\def\cbibrefcrossref[#1type=external][#2ref1]#3{\doifemptyelse{#3} {\colorcrossref[#1]type=external,detail={[\in[#2]]p. 38}} {\color[#1]{[\in[#2ref1], #3]}}}</texcode>
Here a simple usage example:
\def\decodebibsource#1[#2]<texcode> {\getparametersusemodule[tmpsimplebib][author=,editor=,year=,title=,in=,series=,volume=,magazine=,edition=,revedition=, datedition=,publisher=,place=,isbn=,url=,pages=,#2]% \doifnot{\tmpauthor}{} {\tmpauthor\doifnot{\tmpyear}{}{ }}% \doifnot{\tmpeditor}{}{\doifnot{\tmpauthor}{}{ - }\tmpeditor~(Hrsg.)\doifnot{\tmpyear}{}{ }}% \doifnot{\tmpyear}{} {(\tmpyear)}% \doifelse{\tmpauthor}{} {\doifelse{\tmpeditor}{}% {\doifnot{\tmpyear}{}{: }}{: }}{: }% \doifnot{\tmptitle}{} {{\it \tmptitle}}% \doifnot{\tmpseries}{} { aus der Reihe {\it \tmpseries}}% \doifnot{\tmpvolume}{} { (Band~\tmpvolume)}% \doifnot{\tmpmagazine}{} { (Heft~\tmpmagazine)}% \doifnot{\tmpedition}{}{, \tmpedition.~Auflage}% \doifnot{\tmprevedition}{}{, \tmprevedition.~überarbeitete Auflage}% \doifnot{\tmpdatedition}{}{, Auflage vom \tmpdatedition}% \doifelse{\tmppublisher}{}{\doifnot{\tmpplace}{}{,}}{,}% \doifnot{\tmppublisher}{} { \tmppublisher}% \doifnot{\tmpplace}{} { \tmpplace}% \doifnot{\tmpisbn}{} {, ISBN~\tmpisbn}% \doifnot{\tmppages}{} {, S.~\tmppages}% \doifnot{\tmpurl}{} {, \tmpurl}% \doifnot{\tmpin}{} { in \expanded{\decodebibsource[\tmpin]}} }
\def\bibsource#1[#2] {\getparameters[tmp][key=,abbr=,#2] \doifelse{\tmpabbr}{} {\item[\tmpkey]} {\sym{\cap{\tmpabbr}}\expanded{\textreference[\tmpkey]{\cap{\tmpabbr}}}}% \decodebibsource[#2] }\protect\stopmodule\endinputstarttext
\bibref[brk]
\bibref[detail={p. 275}][bpf]
 
\starttext
\startbibliography
 
\bibitem[reference=brk,label={Brk\-01},author={Brinker, Klaus},year={2001},title={Linguistische Textanalyse: Eine Einführung in Grundbegriffe und Methoden},series={Grundlagen der Germanistik},volume={29},revedition={5},publisher={Schmidt Verlag},place={Berlin},isbn={3-503-04995-9}]
 
\bibitem[reference=bpf,label={BüPrFr\-98},author={Büchel, Christian; Price, Cathy J und Friston, Karl},year={1998},title={A multimodal language region in the ventral visual pathway},in={{title=Nature},volume={394},pages={274-277}}]
 
\stopbibliography
\stoptext
</texcode>
= Another Approach =Settings== To adjust the space for the bibitem labels you can specify the: * <code>labelSpace</code> with a natural number (the default is 12).
Here is another manual approach for simple bibliographies.They are defined as parameters of the module:
<texcode>
\definereferenceformatusemodule[citecrossref][leftlabelSpace={[},right={]}...]\defineitemgroup [bibliography] [levels=1]...\setupitemgroup [bibliography] </texcode> [symbol=n, Depending on label definition or label numbering a text left={[}, and right={]}, width=1of the label can be defined via <code>labelLeft</code> and <code>labelRight</code>.5em, stopper=, itemalign=flushright, inbetween={\blank[4pt]}]If brackets are needed they can be set with:
<texcode>\defsetupsimplebibtext[labelLeft={[}]\bibitemsetupsimplebibtext[labelRight={\item]}]
</texcode>
Now you The language depending texts can use be set via:
<texcode>
\sectionsetupsimplebibtext[en][editor={Referencesed.}]\startbibliographysetupsimplebibtext[en][number={number}] \bibitemsetupsimplebibtext[ref1en][fromSeries={from series}] This is my first reference \bibitemsetupsimplebibtext[en][ref2volume={volume}] This is the second reference\stopbibliographysetupsimplebibtext[en][magazine={magazine}]\setupsimplebibtext[en][edition={edition}]\setupsimplebibtext[en][revedition={reviewed edition}]\setupsimplebibtext[en][datedition={edition from}]\setupsimplebibtext[en][isbn={ISBN}]\setupsimplebibtext[en][pages={p.}]\setupsimplebibtext[en][access={last access}]\setupsimplebibtext[en][in={in}] \setupsimplebibtext[de][editor={Hrsg.}]\setupsimplebibtext[de][number={Nummer}]\setupsimplebibtext[de][fromSeries={aus der Reihe}]\setupsimplebibtext[de][volume={Band}]\setupsimplebibtext[de][magazine={Heft}]\setupsimplebibtext[de][edition={Auflage}]\setupsimplebibtext[de][revedition={überarbeitete Auflage}]\setupsimplebibtext[de][datedition={Auflage vom}]\setupsimplebibtext[de][isbn={ISBN}]\setupsimplebibtext[de][pages={S.}]\setupsimplebibtext[de][access={letzter Zugriff}]\setupsimplebibtext[de][in={in}]
</texcode>
 
and use <code>\cite[ref1]</code> etc to refer to bibliography items.
98

edits