5

In Context MKIV using bibliography produces in just one case an annoying dash. (-Eastwood, 1997). All other footnotes work OK, in Latex all works OK. Some non-standard character?

\mainlanguage[english]
\usebtxdataset[default][mydatabase.bib]
\loadbtxdefinitionfile[apa]
\usebtxdefinitions[apa]
\setupbtx[dataset=default]
\definebtxrendering[default][apa][specification=chicago,sorttype=authoryear,numbering=no]

\starttext

\startbodymatter

Test.\cite[Eastwood:1997]

\stopbodymatter

\startbackmatter
\startchapter[title=Bibliography]
\placelistofpublications[criterium=all]
\stopchapter
\stopbackmatter

\stoptext

% Don't know how to make filecontents in Context, here is mydatabase.bib

@Article{Eastwood:1997,
        title = {Astronomy in Christian Latin Europe c. 500 - c. 1150},
        author = {Bruce Eastwood},
        journal = {Journal for the History of Astronomy},
        volume = {28},
        year = {1997},
        pages = {235-258},
        language = {english},
        hyphenation = {english},
}
8

The problem you describe cannot be reproduced using the example in the question because it is missing essential information. The actual problem is with \setbreakpoints[compound] and has nothing to do with the bibliographies system at all. Unfortunately \setbreakpoints[compound] was left out in the question completely. The following minimal working example (MWE) reproduces the problem.

\setupbodyfont[palatino,14pt]
\setbreakpoints[compound]
\starttext
Antique astronomy was gradually replaced
by the logic of counting.(Eastwood)
\stoptext

enter image description here

The behaviour is not expected and I think it should not happen. Therefore I reported this as a bug on the ConTeXt mailing list. https://mailman.ntg.nl/pipermail/ntg-context/2019/093855.html

As a workaround you can simply adapt the definition of the ( breakpoint before \setbreakpoints.

\definebreakpoint[compound][(][nleft=3,nright=3,type=5,left=,right=(,middle=(]
\setbreakpoints[compound]

The way to make filecontents in ConTeXt is using a buffer. The btx module can directly read the bibliography from a buffer without having to store intermediate files. Just append .buffer to the name of the buffer in \usebtxdataset.

You might also want to add \frenchspacing to the title field, to avoid excessive spacing after periods.

To include page information in your citation, you should use the righttext key, rather than the right key. For example the apa style sets right={)}, so when you override right, you'll lose the closing parenthesis.

All of this is described in detail in the documentation Bibliographies the ConTeXt way.

\startbuffer[mydatabase]
@Article{Eastwood:1997,
        title = {Astronomy in Christian Latin Europe c. 500 - c. 1500},
        author = {Bruce Eastwood},
        journal = {Journal for the History of Astronomy},
        volume = {28},
        year = {1997},
        pages = {235-258},
        language = {english},
        hyphenation = {english},
}
\stopbuffer

\usebtxdataset[default][mydatabase.buffer]
\usebtxdefinitions[apa]
\setupbtx[dataset=default]
\definebtxrendering[default][apa][specification=chicago,sorttype=authoryear,numbering=no]

\setupbtx
  [apa:list:title]
  [command=\frenchspacing]

\starttext

Test.\cite[righttext={p.~236--238}][Eastwood:1997]

\placelistofpublications[criterium=all]

\stoptext

enter image description here

  • Thank you very much! "database.buffer" is non-trivial, I did not find it at first. As for the problem, it must be some non-ascii invisible character, because the problem disappears in other files. – Dmitry Starostin Jan 27 at 8:07
  • @DmitryStarostin Can you maybe upload the file somewhere, so that we can get an exact bitwise copy of it? Stack Exchange usually removes non-printable characters when you paste something here. – Henri Menke Jan 27 at 8:11
  • @DmitryStarostin As for the .buffer extension I wouldn't say it's non-trivial. After all it's described in the manual Bibliographies the ConTeXt way. – Henri Menke Jan 27 at 8:11
  • 1
    @DmitryStarostin I've also updated my answer. The closing parenthesis disappears because you're using the wrong field. You should use righttext for page information. Please read the documentation. In the future please also make sure that the example you post here actually reproduces the problem. – Henri Menke Jan 28 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.