I am currently writing a CSL format reproducing BibTeX’s plain bibliography style. However, I have problems handling the @inbook entries in BibTeX files. Here is an example:
test-bibliography.bib
@inbook{dirac1930,
author = {Dirac, Paul A. M.},
title = {The Principles of Quantum Mechanics},
chapter = {3},
publisher = {Oxford University Press},
year = {1930},
pages = {50--75},
}
When I convert it to CSL-JSON using the Pandoc online converter, I get the following:
[
{
"author": [
{
"family": "Dirac",
"given": "Paul A. M."
}
],
"chapter-number": "3",
"id": "dirac1930",
"issued": {
"date-parts": [
[
1930
]
]
},
"page": "50-75",
"publisher": "Oxford University Press",
"title": "The principles of quantum mechanics",
"type": "chapter"
}
]
So, with the CSL engine of Pandoc, @inbook is converted to chapter. However, apparently, this entry type is not converted to chapter by Typst’s CSL engine. Here is a minimal example of a CSL and Typst document that reproduces my problem.
test.csl
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="in-text" default-locale="en-US">
<info>
<title>Test</title>
<id>http://www.zotero.org/styles/test</id>
</info>
<citation>
<layout prefix="[" suffix="]" delimiter=", ">
<text variable="citation-number"/>
<text variable="locator"/>
</layout>
</citation>
<bibliography>
<layout>
<text variable="citation-number" prefix="[" suffix="] "/>
<choose>
<if type="chapter"><text value="***CHAPTER FOUND***"/></if>
<else><text value="***NOT A CHAPTER***"/></else>
</choose>
</layout>
</bibliography>
</style>
test.typ
@dirac1930
#bibliography("test-bibliography.bib", style: "test.csl")
Result:
