Dear all, I am in the process of learning how to use the bibliography mechanism in mkiv, and I would lik eto understand the meanings of the various parameters in the command: \setupbtxrendering [...,1,...] [..,..2=..,..] 1 NAME 2 textstate = start stop pagestate = start stop separator = COMMAND criterium = previous cite here all none filter = TEXT specification = NAME title = TEXT before = COMMAND after = COMMAND dataset = NAME method = dataset force local global none sorttype = short dataset list reference used default cite index repeat = yes no group = NAME numbering = yes no num index tag short page Indeed serveral of them are clear enough (such as dataset), some can be guessed by trial and error (such as numbering=yes or no) but some seem to me obscure or difficult to guess (what would numbering=page mean, or what would separator=COMMAND do, what does the title=TEXT corresponds to, etc). Has someone some examples to play with in order to learn the meaning of these options? Also, in real case document I would like to be able to typeset the bibliography with the following style: the autho's name is followed by a « : » the title of an article is in italic the title of a book is in slanted sans serif the number of the volume is in bold Is it possible to do this by an appropriate setting of btxrendering, without going into the BibTeX file? Thanks in advance for any help: OK
HANS: there is one specific comment for you, below.
On Sat, 17 Feb 2018 15:27:03 +0100
Otared Kavian
Dear all,
I am in the process of learning how to use the bibliography mechanism in mkiv, and I would lik eto understand the meanings of the various parameters in the command:
\setupbtxrendering [...,1,...] [..,..2=..,..] 1 NAME 2 textstate = start stop pagestate = start stop separator = COMMAND criterium = previous cite here all none filter = TEXT specification = NAME title = TEXT before = COMMAND after = COMMAND dataset = NAME method = dataset force local global none sorttype = short dataset list reference used default cite index repeat = yes no group = NAME numbering = yes no num index tag short page
Indeed serveral of them are clear enough (such as dataset), some can be guessed by trial and error (such as numbering=yes or no) but some seem to me obscure or difficult to guess (what would numbering=page mean, or what would separator=COMMAND do, what does the title=TEXT corresponds to, etc).
Has someone some examples to play with in order to learn the meaning of these options?
Also, in real case document I would like to be able to typeset the bibliography with the following style:
the autho's name is followed by a « : » the title of an article is in italic the title of a book is in slanted sans serif the number of the volume is in bold
Is it possible to do this by an appropriate setting of btxrendering, without going into the BibTeX file?
Thanks in advance for any help: OK
First of all, don't put any such formatting in the BibTeX file: that is a LaTeX-style hack, and we have designed the ConTeXt system to avoid any such need. The dataset should contain only data, and hacks should be avoided. There is some limitation to this. Say, for example that the title contains mathematical symbols. One would be hard pressed not to include dollar-sign delimiters and math syntax! Another example could be "edition={second}" and "edition={2\high{nd}}". Of course, one could introduce conversion sets (like for months), but this gets complicated. How about "edition={second, revised with corrections}"? Most of the customizations that you ask are obtained through setups: For the author's name, depends on what you want: " : " after the list of authors or after each author? If you want this after the list of authors, then one needs to redefine a setup: From publ-imp-authors.mkvi \startsetups \s!btx:\s!list:\s!author:others \ifcase\currentbtxoverflow \else \btxparameter\c!otherstext \fi \stopsetups (this gets called at the end of the author list construction). One could add at the end \btxcolon, defined (in publ-ini.mkiv) as \unexpanded\def\btxcolon {\removeunwantedspaces:\space} but you would want a space before, so you would probably want to add, rather "\space:\space" HANS: perhaps this requested use might call for a new parameter (separator:names:5=,) to be put at the *end* of an author list in *all* of the appropriate setups, rather than having to redefine the :others setup which is sort-of a hack? In this case, Otared would then use \setupbtx [apa:list:author] [separator:names:5={\space:\space}] (assuming that he uses the apa specification) DON'T try this, as we do not implement it (yet)! For the other requests: \setupbtx [apa:list:title] [style=italic] (the default for apa) \setupbtx [apa:list:title:book] [style={slanted,sans}] (untested) \setupbtx [apa:list:volume] [style=bold] (apa default is italic) On your other questions, a rendering uses the standard list mechanism, so some of the parameters (such as pagestate) get passed on. See \setuplist Others, such as numbering= yes no num index tag short page controls the numbering of the list. It is numbering=num (or yes for default and aps) but numbering=no (for apa). numbering=index puts the dataset index (which depends on an internal hash) rather than num which is a cite instance number. numbering=tag puts the bibtex tag (as used in \cite). numbering=short puts the short tag, for example KAV18, that is a short author-year concoction. numbering=page, I don't know what this does (in my test, it put "?"). Many (but not all) of the rendering parameters are described (somewhat) in the documentation, which of course is not perfect! Alan
On 2/17/2018 8:29 PM, Alan Braslau wrote:
HANS: there is one specific comment for you, below.
well, up to you to decide if it's auser overload (at some point we need to stop and users should copy/patch setups ... that's the idea concerning a title with commands ... no way around math in titles i guess (and tex math is sort of standard); we can think of having a "textitle" field, or abuse "title:en" for the formatted ones
On Sat, 17 Feb 2018 15:27:03 +0100 Otared Kavian
wrote: Dear all,
I am in the process of learning how to use the bibliography mechanism in mkiv, and I would lik eto understand the meanings of the various parameters in the command:
\setupbtxrendering [...,1,...] [..,..2=..,..] 1 NAME 2 textstate = start stop pagestate = start stop separator = COMMAND criterium = previous cite here all none filter = TEXT specification = NAME title = TEXT before = COMMAND after = COMMAND dataset = NAME method = dataset force local global none sorttype = short dataset list reference used default cite index repeat = yes no group = NAME numbering = yes no num index tag short page
Indeed serveral of them are clear enough (such as dataset), some can be guessed by trial and error (such as numbering=yes or no) but some seem to me obscure or difficult to guess (what would numbering=page mean, or what would separator=COMMAND do, what does the title=TEXT corresponds to, etc).
Has someone some examples to play with in order to learn the meaning of these options?
Also, in real case document I would like to be able to typeset the bibliography with the following style:
the autho's name is followed by a « : » the title of an article is in italic the title of a book is in slanted sans serif the number of the volume is in bold
Is it possible to do this by an appropriate setting of btxrendering, without going into the BibTeX file?
Thanks in advance for any help: OK
First of all, don't put any such formatting in the BibTeX file: that is a LaTeX-style hack, and we have designed the ConTeXt system to avoid any such need. The dataset should contain only data, and hacks should be avoided.
There is some limitation to this. Say, for example that the title contains mathematical symbols. One would be hard pressed not to include dollar-sign delimiters and math syntax! Another example could be "edition={second}" and "edition={2\high{nd}}". Of course, one could introduce conversion sets (like for months), but this gets complicated. How about "edition={second, revised with corrections}"?
Most of the customizations that you ask are obtained through setups:
For the author's name, depends on what you want: " : " after the list of authors or after each author? If you want this after the list of authors, then one needs to redefine a setup:
From publ-imp-authors.mkvi
\startsetups \s!btx:\s!list:\s!author:others \ifcase\currentbtxoverflow \else \btxparameter\c!otherstext \fi \stopsetups
(this gets called at the end of the author list construction). One could add at the end \btxcolon, defined (in publ-ini.mkiv) as \unexpanded\def\btxcolon {\removeunwantedspaces:\space} but you would want a space before, so you would probably want to add, rather "\space:\space"
HANS: perhaps this requested use might call for a new parameter (separator:names:5=,) to be put at the *end* of an author list in *all* of the appropriate setups, rather than having to redefine the :others setup which is sort-of a hack? In this case, Otared would then use \setupbtx [apa:list:author] [separator:names:5={\space:\space}] (assuming that he uses the apa specification) DON'T try this, as we do not implement it (yet)!
For the other requests:
\setupbtx [apa:list:title] [style=italic] (the default for apa)
\setupbtx [apa:list:title:book] [style={slanted,sans}] (untested)
\setupbtx [apa:list:volume] [style=bold] (apa default is italic)
On your other questions, a rendering uses the standard list mechanism, so some of the parameters (such as pagestate) get passed on. See \setuplist
Others, such as numbering= yes no num index tag short page controls the numbering of the list. It is numbering=num (or yes for default and aps) but numbering=no (for apa). numbering=index puts the dataset index (which depends on an internal hash) rather than num which is a cite instance number. numbering=tag puts the bibtex tag (as used in \cite). numbering=short puts the short tag, for example KAV18, that is a short author-year concoction. numbering=page, I don't know what this does (in my test, it put "?").
Many (but not all) of the rendering parameters are described (somewhat) in the documentation, which of course is not perfect!
Alan
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 2018-02-17 14:29, Alan Braslau wrote:
First of all, don't put any such formatting in the BibTeX file: that is a LaTeX-style hack, and we have designed the ConTeXt system to avoid any such need. The dataset should contain only data, and hacks should be avoided.
There is some limitation to this. Say, for example that the title contains mathematical symbols. One would be hard pressed not to include dollar-sign delimiters and math syntax! Another example could be "edition={second}" and "edition={2\high{nd}}". Of course, one could introduce conversion sets (like for months), but this gets complicated. How about "edition={second, revised with corrections}"?
Indeed, it is hard to imagine a BibTeX file devoid of such markup. How would one indicate the (reverse) emphasis of a quoted book title, as in /The Cambridge Companion to /Ulysses, except by indicating the emphasis of "Ulysses" and letting ConTeXt reverse it when emphasizing the complete title? (§4.21 of the APA2013 spec requires this.) -- Rik __
On Sun, 18 Feb 2018 11:58:40 -0500
Rik Kabel
Indeed, it is hard to imagine a BibTeX file devoid of such markup. How would one indicate the (reverse) emphasis of a quoted book title, as in /The Cambridge Companion to /Ulysses, except by indicating the emphasis of "Ulysses" and letting ConTeXt reverse it when emphasizing the complete title? (§4.21 of the APA2013 spec requires this.)
title={The Cambridge Companion to {\em Ulysses}},
On 02/18/2018 06:07 PM, Alan Braslau wrote:
title={The Cambridge Companion to {\em Ulysses}},
Alan, I think this was Rik Kabel's point: for some scenarios, you cannot avoid to have some sort of context commands in your bibtex file. For a while, I also used biblatex from time to time, so I tried to have a bibtex file that would be as clean as possible and work with both systems, but your example shows that this is not always possible. Well, nothing that some well-written perl couldn't get rid of... All best Thomas
On 2018-02-18 12:23, Thomas A. Schmitz wrote:
On 02/18/2018 06:07 PM, Alan Braslau wrote:
title={The Cambridge Companion to {\em Ulysses}},
Alan, I think this was Rik Kabel's point: for some scenarios, you cannot avoid to have some sort of context commands in your bibtex file. For a while, I also used biblatex from time to time, so I tried to have a bibtex file that would be as clean as possible and work with both systems, but your example shows that this is not always possible. Well, nothing that some well-written perl couldn't get rid of...
All best
Thomas
Indeed, that was my point. Even without the mathematics components that were cited, I cannot imagine how markup could be excluded from the BibTeX file, and for that matter, from any other bibliographical database I have seen, if we have to comply with arbitrary formatting standards. The statement that one should not put any such formatting into the file is perhaps aspirational, but not really useful. -- Rik
On 2/18/2018 7:07 PM, Rik Kabel wrote:
On 2018-02-18 12:23, Thomas A. Schmitz wrote:
On 02/18/2018 06:07 PM, Alan Braslau wrote:
title={The Cambridge Companion to {\em Ulysses}},
Alan, I think this was Rik Kabel's point: for some scenarios, you cannot avoid to have some sort of context commands in your bibtex file. For a while, I also used biblatex from time to time, so I tried to have a bibtex file that would be as clean as possible and work with both systems, but your example shows that this is not always possible. Well, nothing that some well-written perl couldn't get rid of...
All best
Thomas
Indeed, that was my point. Even without the mathematics components that were cited, I cannot imagine how markup could be excluded from the BibTeX file, and for that matter, from any other bibliographical database I have seen, if we have to comply with arbitrary formatting standards. The statement that one should not put any such formatting into the file is perhaps aspirational, but not really useful. If you code clean it's no problem as we can map commands (\btxcommand) but most (large) bibtex databases we've seen so far are quite inconsistent (not only in usage of commands, also in author names).
(And of course Thomas meant Lua and not Perl.) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On Sun, 18 Feb 2018 19:23:25 +0100
Hans Hagen
On 2/18/2018 7:07 PM, Rik Kabel wrote:
On 2018-02-18 12:23, Thomas A. Schmitz wrote:
On 02/18/2018 06:07 PM, Alan Braslau wrote:
title={The Cambridge Companion to {\em Ulysses}},
Alan, I think this was Rik Kabel's point: for some scenarios, you cannot avoid to have some sort of context commands in your bibtex file. For a while, I also used biblatex from time to time, so I tried to have a bibtex file that would be as clean as possible and work with both systems, but your example shows that this is not always possible. Well, nothing that some well-written perl couldn't get rid of...
All best
Thomas
Indeed, that was my point. Even without the mathematics components that were cited, I cannot imagine how markup could be excluded from the BibTeX file, and for that matter, from any other bibliographical database I have seen, if we have to comply with arbitrary formatting standards. The statement that one should not put any such formatting into the file is perhaps aspirational, but not really useful. If you code clean it's no problem as we can map commands (\btxcommand) but most (large) bibtex databases we've seen so far are quite inconsistent (not only in usage of commands, also in author names).
(And of course Thomas meant Lua and not Perl.)
The message was meant to be "don't abuse" markup in data; Don't attempt bibtex/latex hackery. As Hans mentions, \btxcommand was introduced to handle some formatting in bibtex entries that might be inconsistent or in conflict with standard ConTeXt commands. When no \btxcommand definition is found, the system falls-back on standard ConTeXt (or luatex) syntax. Sloppy bibtex files should be cleaned up, but the aim is to allow files to be shared with bibtex/latex (minus any hackery, which could/should be fixed in the bibtex style files, but usually is not). Alan
On 2018-02-18 12:07, Alan Braslau wrote:
On Sun, 18 Feb 2018 11:58:40 -0500 Rik Kabel
wrote: Indeed, it is hard to imagine a BibTeX file devoid of such markup. How would one indicate the (reverse) emphasis of a quoted book title, as in /The Cambridge Companion to /Ulysses, except by indicating the emphasis of "Ulysses" and letting ConTeXt reverse it when emphasizing the complete title? (§4.21 of the APA2013 spec requires this.) title={The Cambridge Companion to {\em Ulysses}},
I would think that the proper form would be title={The Cambridge Companion to {\it Ulysses}} since \em could be, and is by default, slanted, but the standard here calls for italic. That brings up the question of when one should use \em, \emph, and \emphasized, all of which appear in font-emp.mkvi. The wiki and other documentation provides no guidance. -- Rik
Rik Kabel mailto:context@rik.users.panix.com 18. Februar 2018 um 20:22 On 2018-02-18 12:07, Alan Braslau wrote:
On Sun, 18 Feb 2018 11:58:40 -0500 Rik Kabel
wrote: Indeed, it is hard to imagine a BibTeX file devoid of such markup. How would one indicate the (reverse) emphasis of a quoted book title, as in /The Cambridge Companion to /Ulysses, except by indicating the emphasis of "Ulysses" and letting ConTeXt reverse it when emphasizing the complete title? (§4.21 of the APA2013 spec requires this.) title={The Cambridge Companion to {\em Ulysses}},
I would think that the proper form would be
title={The Cambridge Companion to {\it Ulysses}}
since \em could be, and is by default, slanted, but the standard here calls for italic.
1. How many fonts provides a italic *and* slanted style. 2. You change for the style for \em.
That brings up the question of when one should use \em, \emph, and \emphasized, all of which appear in font-emp.mkvi. The wiki and other documentation provides no guidance.
\starttext normal {\em emphasized} {\it normal {\em emphasized}} \stoptext Wolfgang
On Sun, 18 Feb 2018 20:33:37 +0100
Wolfgang Schuster
Rik Kabel mailto:context@rik.users.panix.com 18. Februar 2018 um 20:22 On 2018-02-18 12:07, Alan Braslau wrote:
On Sun, 18 Feb 2018 11:58:40 -0500 Rik Kabel
wrote: Indeed, it is hard to imagine a BibTeX file devoid of such markup. How would one indicate the (reverse) emphasis of a quoted book title, as in /The Cambridge Companion to /Ulysses, except by indicating the emphasis of "Ulysses" and letting ConTeXt reverse it when emphasizing the complete title? (§4.21 of the APA2013 spec requires this.) title={The Cambridge Companion to {\em Ulysses}},
I would think that the proper form would be
title={The Cambridge Companion to {\it Ulysses}}
since \em could be, and is by default, slanted, but the standard here calls for italic.
1. How many fonts provides a italic *and* slanted style.
2. You change for the style for \em.
That brings up the question of when one should use \em, \emph, and \emphasized, all of which appear in font-emp.mkvi. The wiki and other documentation provides no guidance.
\starttext
normal {\em emphasized}
{\it normal {\em emphasized}}
\stoptext
Indeed, \it would *not* be the appropriate command to be used (neither in LaTeX, I believe). As Wolgang's example (and cont-enp.pdf) shows, \em does *exactly* what is needed. Alan
On 2018-02-18 14:33, Wolfgang Schuster wrote:
Rik Kabel mailto:context@rik.users.panix.com 18. Februar 2018 um 20:22 On 2018-02-18 12:07, Alan Braslau wrote:
On Sun, 18 Feb 2018 11:58:40 -0500 Rik Kabel
wrote: Indeed, it is hard to imagine a BibTeX file devoid of such markup. How would one indicate the (reverse) emphasis of a quoted book title, as in /The Cambridge Companion to /Ulysses, except by indicating the emphasis of "Ulysses" and letting ConTeXt reverse it when emphasizing the complete title? (§4.21 of the APA2013 spec requires this.) title={The Cambridge Companion to {\em Ulysses}},
I would think that the proper form would be
title={The Cambridge Companion to {\it Ulysses}}
since \em could be, and is by default, slanted, but the standard here calls for italic.
1. How many fonts provides a italic *and* slanted style.
2. You change for the style for \em.
That brings up the question of when one should use \em, \emph, and \emphasized, all of which appear in font-emp.mkvi. The wiki and other documentation provides no guidance.
\starttext
normal {\em emphasized}
{\it normal {\em emphasized}}
\stoptext
Wolfgang
It does not matter how many fonts support both (LM does, and Libertine). One feature of a BibTeX file is reusability for many documents, and when the file is created you do not know what will be the default emphasis of the document. By explicitly coding \it, you are assured that the italic face will be attempted. If it is not available, there should be an error message, and you can then have a discussion with your editor. The claim of the new bibliography subsystem is that it will implement APA strictly, and that calls for italic. I understand as well that \em allows switching (reverse emphasis as noted above). It also provides some italic correction. I am asking about the appropriate use of the two variations of \em: \emph (which is a grouped command \em) and \emphasized (defined as \bgroup\em\let\nexttoken). I understand and make use of grouped commands -- they are largely syntactic sugar, but I like sugar. I am less certain of the purpose of \emphasized, how it works, and why it might be useful. I do not recall seeing a command definition with a bgroup and no egroup before. -- Rik
Rik Kabel mailto:context@rik.users.panix.com 18. Februar 2018 um 21:06 On 2018-02-18 14:33, Wolfgang Schuster wrote: It does not matter how many fonts support both (LM does, and Libertine). One feature of a BibTeX file is reusability for many documents, and when the file is created you do not know what will be the default emphasis of the document. By explicitly coding \it, you are assured that the italic face will be attempted. If it is not available, there should be an error message, and you can then have a discussion with your editor. The claim of the new bibliography subsystem is that it will implement APA strictly, and that calls for italic.
I understand as well that \em allows switching (reverse emphasis as noted above). It also provides some italic correction. I am asking about the appropriate use of the two variations of \em: \emph (which is a grouped command \em) and \emphasized (defined as \bgroup\em\let\nexttoken). I understand and make use of grouped commands -- they are largely syntactic sugar, but I like sugar. I am less certain of the purpose of \emphasized, how it works, and why it might be useful. I do not recall seeing a command definition with a bgroup and no egroup before.
\em -> {\em ...} \emph -> \emph{...} or {\emph ...} \emphasized -> \emphasized{...} Wolfgang
On 2018-02-18 15:25, Wolfgang Schuster wrote:
Rik Kabel mailto:context@rik.users.panix.com 18. Februar 2018 um 21:06 On 2018-02-18 14:33, Wolfgang Schuster wrote: It does not matter how many fonts support both (LM does, and Libertine). One feature of a BibTeX file is reusability for many documents, and when the file is created you do not know what will be the default emphasis of the document. By explicitly coding \it, you are assured that the italic face will be attempted. If it is not available, there should be an error message, and you can then have a discussion with your editor. The claim of the new bibliography subsystem is that it will implement APA strictly, and that calls for italic.
I understand as well that \em allows switching (reverse emphasis as noted above). It also provides some italic correction. I am asking about the appropriate use of the two variations of \em: \emph (which is a grouped command \em) and \emphasized (defined as \bgroup\em\let\nexttoken). I understand and make use of grouped commands -- they are largely syntactic sugar, but I like sugar. I am less certain of the purpose of \emphasized, how it works, and why it might be useful. I do not recall seeing a command definition with a bgroup and no egroup before.
\em -> {\em ...}
\emph -> \emph{...} or {\emph ...}
\emphasized -> \emphasized{...}
Wolfgang
Yes. \em is a font switch. \emph can be either a command or a font switch. \emphasized is only a command. But why have \emphasized? Under what circumstances would a casual user prefer it? Under what circumstances a more advanced user, or someone writing a module, employ it? What does it do differently than \emph used as a command? Grepping the source, I see thirty or so occurrences of the pattern \bgroup...\let\nexttoken. I do not understand just what it does. Can you explain it, or direct me to a good place to learn about it? -- Rik
On 2018-02-18 16:05, Rik Kabel wrote:
On 2018-02-18 15:25, Wolfgang Schuster wrote:
Rik Kabel mailto:context@rik.users.panix.com 18. Februar 2018 um 21:06 On 2018-02-18 14:33, Wolfgang Schuster wrote: It does not matter how many fonts support both (LM does, and Libertine). One feature of a BibTeX file is reusability for many documents, and when the file is created you do not know what will be the default emphasis of the document. By explicitly coding \it, you are assured that the italic face will be attempted. If it is not available, there should be an error message, and you can then have a discussion with your editor. The claim of the new bibliography subsystem is that it will implement APA strictly, and that calls for italic.
I understand as well that \em allows switching (reverse emphasis as noted above). It also provides some italic correction. I am asking about the appropriate use of the two variations of \em: \emph (which is a grouped command \em) and \emphasized (defined as \bgroup\em\let\nexttoken). I understand and make use of grouped commands -- they are largely syntactic sugar, but I like sugar. I am less certain of the purpose of \emphasized, how it works, and why it might be useful. I do not recall seeing a command definition with a bgroup and no egroup before.
\em -> {\em ...}
\emph -> \emph{...} or {\emph ...}
\emphasized -> \emphasized{...}
Wolfgang
Yes. \em is a font switch. \emph can be either a command or a font switch. \emphasized is only a command. But why have \emphasized? Under what circumstances would a casual user prefer it? Under what circumstances a more advanced user, or someone writing a module, employ it? What does it do differently than \emph used as a command?
Grepping the source, I see thirty or so occurrences of the pattern \bgroup...\let\nexttoken. I do not understand just what it does. Can you explain it, or direct me to a good place to learn about it?
Okay, with some off-list help and a bit more reading, I understand the pattern used in the definition of \emphasized, or at least how it works. I still do not know when it should be preferred. I suspect it is more efficient than \emph. Is that the only advantage? -- Rik
Hi Alan, and all the Gurus on the list, Many thanks for your help and comments. I am sending again this message which, by mistake, was sent only to Alan, in order to get some help. The manual mkiv-publications.pdf contains indeed many explanations, but probably the informations there are too vast for the elementary use I am going to need. So many thanks to Alan and Hans for this extensive manual! Now, this being said, I am neither able, nor do I need, to use the full blown power of this environment. In particular I am not familiar with the style apa (or aps, which seems to exist too…) or other official specifications. That is why I would like to learn by examples, beginning with the one included on page 4 of the above mentioned manual and then modify things to see what can be done… However, when I use the modifications which Alan suggested (for the style apa, but I dropped the apa: prefix…) I do not get what is desired (please see below the code and the attached test.bib file). And if I give explicitely the specification apa, then many other things are not satisfactory for my needs… For now, what I get without changing many things in the first example given in the manual, is quite close to what I would like to obtain, except that the title of articles is in roman and the name of the journal is in italic, and the title of books are in italic (and the modifications suggest by Alan do not change this, at least when I am not using apa). So my first question is: how can one define one's own « specification », when modifying built-in specifications is not satisfactory for one's needs, or does not give the expected result? The second question is: how can one write a file containing only the references which are used in a document, so that that file can be in some way included into the main document (this is somewhat analogous to the .bbl file created by BibTeX, which allows to include a series of \bibitem into an article written with LaTeX: this is necessary to do when one submits a paper to a mathematical journal). Thanks again for your help: OK %% begin test-bibliography.tex \setupinteraction[state=start] \usebtxdataset[test.bib] %% these four setupbtx suggested by Alan have no effects \setupbtx[list:volume][style={bold}] \setupbtx[list:title] [style={\it}] %(the default for apa) \setupbtx [list:title:book] [style={\ss\it}] \setupbtx[list:volume][,style=bold] %(apa default is italic) %% this has the correct effect... \setupbtx[ interaction=start, specification=default, left={[}, right={]}, ] \starttext \startbodymatter See the book by K. Yosida \cite[YosidaK] and the article by I. Ekeland \cite{EkelandILemme}. \stopbodymatter \startbackmatter \startchapter[title=Bibliography] \placelistofpublications [method=dataset, sorttype=authoryear, numbering=yes, ] \stopchapter \stopbackmatter \stoptext %% end test-bibliography.tex %% begin content of the file text.bib @article{FabesEBStrook, Author = {E.B. Fabes and D.W. Strook}, Journal = {Archives for Rational Mechanics and Analysis}, Pages = {327--338}, Title = {A new proof of Moser's parabolic Harnack inequality via the old ideas of Nash}, Volume = {96}, Year = {1986} } @book{EvansLC, Address = {Providence, RI}, Author = {Lawrence C. Evans}, Publisher = {American Mathematical Society}, Series = {Conference Board of the Mathematical Sciences Regional Conference Series in Mathematics}, Title = {Weak convergence methods for nonlinear partial differential equations}, Volume = {74}, Year = {1990} } @book{EkelandITemam, Address = {Paris}, Author = {Ivar Ekeland and Roger Temam}, Publisher = {Dunod-Gauthiers-Villars}, Title = {Analyse Convexe et Problèmes Variationnels}, Year = {1974} } @article{EkelandILemme, Author = {Ivar Ekeland}, Journal = {Journal of Mathematical Analysis and Applications}, Pages = {324--353}, Title = {On the variational principle}, Volume = {47}, Year = {1974} } @book{DieudonneJ, Address = {Paris}, Author = {Jean Dieudonné}, Publisher = {Gauthiers-Villars}, Title = {Éléments d'Analyse}, Volume = {1}, Year = {1969} } @book{YosidaK, Address = {New York}, Author = {Kôsaku Yosida}, Publisher = {Springer-Verlag}, Series = {Die Grundlehren der Mathematischen Wissenschaften}, Title = {Functional Analysis}, Volume = {123}, Year = {1974} } %% end content of the file test.bib
On 17 Feb 2018, at 20:29, Alan Braslau
wrote: HANS: there is one specific comment for you, below.
On Sat, 17 Feb 2018 15:27:03 +0100 Otared Kavian
wrote: Dear all,
I am in the process of learning how to use the bibliography mechanism in mkiv, and I would lik eto understand the meanings of the various parameters in the command:
\setupbtxrendering [...,1,...] [..,..2=..,..] 1 NAME 2 textstate = start stop pagestate = start stop separator = COMMAND criterium = previous cite here all none filter = TEXT specification = NAME title = TEXT before = COMMAND after = COMMAND dataset = NAME method = dataset force local global none sorttype = short dataset list reference used default cite index repeat = yes no group = NAME numbering = yes no num index tag short page
Indeed serveral of them are clear enough (such as dataset), some can be guessed by trial and error (such as numbering=yes or no) but some seem to me obscure or difficult to guess (what would numbering=page mean, or what would separator=COMMAND do, what does the title=TEXT corresponds to, etc).
Has someone some examples to play with in order to learn the meaning of these options?
Also, in real case document I would like to be able to typeset the bibliography with the following style:
the autho's name is followed by a « : » the title of an article is in italic the title of a book is in slanted sans serif the number of the volume is in bold
Is it possible to do this by an appropriate setting of btxrendering, without going into the BibTeX file?
Thanks in advance for any help: OK
First of all, don't put any such formatting in the BibTeX file: that is a LaTeX-style hack, and we have designed the ConTeXt system to avoid any such need. The dataset should contain only data, and hacks should be avoided.
There is some limitation to this. Say, for example that the title contains mathematical symbols. One would be hard pressed not to include dollar-sign delimiters and math syntax! Another example could be "edition={second}" and "edition={2\high{nd}}". Of course, one could introduce conversion sets (like for months), but this gets complicated. How about "edition={second, revised with corrections}"?
Most of the customizations that you ask are obtained through setups:
For the author's name, depends on what you want: " : " after the list of authors or after each author? If you want this after the list of authors, then one needs to redefine a setup:
From publ-imp-authors.mkvi
\startsetups \s!btx:\s!list:\s!author:others \ifcase\currentbtxoverflow \else \btxparameter\c!otherstext \fi \stopsetups
(this gets called at the end of the author list construction). One could add at the end \btxcolon, defined (in publ-ini.mkiv) as \unexpanded\def\btxcolon {\removeunwantedspaces:\space} but you would want a space before, so you would probably want to add, rather "\space:\space"
HANS: perhaps this requested use might call for a new parameter (separator:names:5=,) to be put at the *end* of an author list in *all* of the appropriate setups, rather than having to redefine the :others setup which is sort-of a hack? In this case, Otared would then use \setupbtx [apa:list:author] [separator:names:5={\space:\space}] (assuming that he uses the apa specification) DON'T try this, as we do not implement it (yet)!
For the other requests:
\setupbtx [apa:list:title] [style=italic] (the default for apa)
\setupbtx [apa:list:title:book] [style={slanted,sans}] (untested)
\setupbtx [apa:list:volume] [style=bold] (apa default is italic)
On your other questions, a rendering uses the standard list mechanism, so some of the parameters (such as pagestate) get passed on. See \setuplist
Others, such as numbering= yes no num index tag short page controls the numbering of the list. It is numbering=num (or yes for default and aps) but numbering=no (for apa). numbering=index puts the dataset index (which depends on an internal hash) rather than num which is a cite instance number. numbering=tag puts the bibtex tag (as used in \cite). numbering=short puts the short tag, for example KAV18, that is a short author-year concoction. numbering=page, I don't know what this does (in my test, it put "?").
Many (but not all) of the rendering parameters are described (somewhat) in the documentation, which of course is not perfect!
Alan
Hi Otared,
So my first question is: how can one define one's own « specification », when modifying built-in specifications is not satisfactory for one's needs, or does not give the expected result?
I work with lots of bibliographies and want my very own styles, and I have indeed found that it is easier to define my own styles rather than modify the existing ones. So what you want to do: 1. you define your own style, let’s call it otared. So in your main tex file, you would have this line: \usebtxdefinitions [otared] This means you have to create two files, one for the lua definitions, one for tex. 2. For the lua file, just take publ-imp-apa.lua and cpy it as publ-imp-otared.lua. Chances are you won’t have to make any changes right away. The content is pretty straightforward lua code. 3. The tex file publ-imp-otared.mkvi will then contain your definitions in a block \startbtxrenderingdefinitions[otared] ... \stopbtxrenderingdefinitions You define two different sets of definitions: one for the citations in the text (in the form \startsetups btx:cite:XXX), one for the list of references (in the form \startsetups btx:list:XXX). Here you can make all the formatting you want: article name in red, author name for articles in small caps, journal name in 3D, whatever. Again, just look at publ-imp-apa.mkvi and try to understand how it works; it’s not that difficult.
The second question is: how can one write a file containing only the references which are used in a document, so that that file can be in some way included into the main document (this is somewhat analogous to the .bbl file created by BibTeX, which allows to include a series of \bibitem into an article written with LaTeX: this is necessary to do when one submits a paper to a mathematical journal).
Thanks again for your help: OK
The list of references is included in the .tuc file that a context run produces. If you need to massage it into any other form, 5 minutes of lua coding can extract the salient information for you. HTH Thomas
Hi Thomas, Many thanks for your insight. Indeed as Alan and you explain, it is straightforward to define one's own specification. I have not done that yet, but already I could change some of the renderings by modifying a few of the definitions in the file publ-imp-default.mkvi in my test file. I guess when my file say named, as you put it, publ-imp-otared.mkvi, is finished, I have to put it in my personal directory texmf/tex/context where ConTeXt would find it. Regarding my question about extracting a file with the used references, Alan explained it to me: it is enough to say \savebtxdataset[usedreferences.bib] and then ConTeXt creates the file usedreferences.bib. Including the content of that file in the source of the main document into a buffer, then allows me to have a single file with the references in it. So this also has been solved by Alan and Hans and is waiting there! Regarding the setups for cite, I did not see where I should put the modified block \startsetups btx:cite:XXX \stopsetups As of now it doesn't seem necessary to modify anything for \cite: maybe this can be done later on if necessary. Best regards: OK
On 20 Feb 2018, at 10:52, Thomas A. Schmitz
wrote: Hi Otared,
So my first question is: how can one define one's own « specification », when modifying built-in specifications is not satisfactory for one's needs, or does not give the expected result?
I work with lots of bibliographies and want my very own styles, and I have indeed found that it is easier to define my own styles rather than modify the existing ones. So what you want to do:
1. you define your own style, let’s call it otared. So in your main tex file, you would have this line:
\usebtxdefinitions [otared]
This means you have to create two files, one for the lua definitions, one for tex.
2. For the lua file, just take publ-imp-apa.lua and cpy it as publ-imp-otared.lua. Chances are you won’t have to make any changes right away. The content is pretty straightforward lua code.
3. The tex file publ-imp-otared.mkvi will then contain your definitions in a block
\startbtxrenderingdefinitions[otared]
...
\stopbtxrenderingdefinitions
You define two different sets of definitions: one for the citations in the text (in the form \startsetups btx:cite:XXX), one for the list of references (in the form \startsetups btx:list:XXX). Here you can make all the formatting you want: article name in red, author name for articles in small caps, journal name in 3D, whatever. Again, just look at publ-imp-apa.mkvi and try to understand how it works; it’s not that difficult.
The second question is: how can one write a file containing only the references which are used in a document, so that that file can be in some way included into the main document (this is somewhat analogous to the .bbl file created by BibTeX, which allows to include a series of \bibitem into an article written with LaTeX: this is necessary to do when one submits a paper to a mathematical journal).
Thanks again for your help: OK
The list of references is included in the .tuc file that a context run produces. If you need to massage it into any other form, 5 minutes of lua coding can extract the salient information for you.
HTH
Thomas ___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
On 2/20/2018 5:08 PM, Otared Kavian wrote:
Hi Thomas,
Many thanks for your insight. Indeed as Alan and you explain, it is straightforward to define one's own specification. I have not done that yet, but already I could change some of the renderings by modifying a few of the definitions in the file publ-imp-default.mkvi in my test file. I guess when my file say named, as you put it, publ-imp-otared.mkvi, is finished, I have to put it in my personal directory texmf/tex/context
in texmf-local/tex/context/user or texmf-project/tex/context/user ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (6)
-
Alan Braslau
-
Hans Hagen
-
Otared Kavian
-
Rik Kabel
-
Thomas A. Schmitz
-
Wolfgang Schuster