3

Background

Similar to this question, I'd like for BibTeX references such as @collection, @incollection, @phdthesis, and others to be written in much the same way is @article and @book references.

Minimum Working Example

This example has a bibliographic database and a ConTeXt file.

Bibliography

Saved as db.bib:

% Encoding: UTF-8

@collection{CPC_It,
  editor        = {Trezzini, Francesco and Fornara, Stefano and Cocchi, Bruno and Bernasconi, Giorgio A. and {Verda Chiocchetti}, Francesca},
  booktitle     = {Commentario pratico al Codice di diritto processuale civile svizzero},
  booksubtitle  = {Volume I Parte prima: Disposizioni generali (Art. 1-196) },
  location      = {Pregassona},
  date          = {2017},
}

@incollection{IT_CPC85,
  author        = {Trezzini, Francesco},
  title         = {art. 85 CPC},
  crossref      = {CPC_It},
}

@collection{CR_CPC,
  editor        = {Bohnet, François and Haldy, Jacques and Jeandin, Nicolas and Schweizer, Philippe and Tappy, Denis},
  booktitle     = {Code de procédure civile commenté},
  date          = {2011},
  location      = {Bâle},
}

@incollection{CR_CPC85,
  author        = {Bohnet, François},
  title         = {art. 85 CPC},
  date          = {2011},
  location      = {Bâle},
  label         = {Commentaire},
  crossref      = {CR_CPC},
}

ConTeXt

\def\textrm{\rm}

\usebtxdataset[impacts][db.bib]
\definebtxrendering[impacts][apa][
  dataset=impacts,
  numbering=yes,
  sorttype=index,
]

\starttext
  \startbackmatter
    \startchapter[title=Bibliography]
      \placelistofpublications[impacts][method=dataset]
    \stopchapter
  \stopbackmatter
\stoptext

Actual Output

The actual output resembles:

Actual Output

Expected Output

The expected output would resemble:

Expected Output

Question

How do you code references such as @incollection that may not be recognized by ConTeXt in its AMA style such that they appear similar to the other references (not a data dump)?

Environment

$ context --version
mtx-context     | current version: 2019.06.11 19:20

1 Answer 1

4

I believe you have to load the definitions as per the Bibliographies The ConTeXt Way user manual.

\def\textrm{\rm}

\usebtxdefinitions[apa]

\usebtxdataset[impacts][db.bib]
\definebtxrendering[impacts][apa][
  dataset=impacts,
  numbering=yes,
  sorttype=index,
]

\starttext
  \startbackmatter
    \startchapter[title=Bibliography]
      \placelistofpublications[impacts][method=dataset]
    \stopchapter
  \stopbackmatter
\stoptext

That gives you Basic Definition APA

The incollection and phdthesis entries are defined in the publ-imp-apa.mkvi and publ-imp-apa.lua files. Unless I am mistaken, you have to copy the file and patch them to add the collection element ( ConTeXt wiki ). As for the patching, I think the easiest would be to take a look at the files, they are rather self explanatory.

If the question is on how to patch the files, apologies, this answer is useless. This is what I get with a bit of tinkering (I won't put the code here since instead of correctly patching the files I just quickly copied and changed the definition of book.): UglyPatch

I think you should provide a more rigorous definition of the style and categories' changes you need. Once you have that, patching the files should be easier. See the wiki article linked above for an example of how to write your style. It should apply to patching the file.


As per the request of the OP, I put here a bit of code to insert into the .tex file to get the desired result. This is not a patch of the style files as I recommended doing. The specification object is not changed to reflect the addition of a new categories element. Thus the citing will not work and other problems might ensue. To be clear, this is a terrible solution and should not be used since it simply ignores the DB. You really should either represent the collection as one of the miscellaneous categories or you should open the two files in question (see context log to find path) and patch them correctly.

\startsetups btx:apa:list:collection
    \btxflush{editor}
    \btxcomma
    \btxlabeltext{apa:Editors}
\stopsetups

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .