Skip to content

Commit d3c352b

Browse files
OmikhleiaDidier Willis
authored andcommitted
feat(packages): Use the CSL implementation by default for bibliographies
If you really want the older legacy implementation, set bibtex.style to "chicago" (or any othe custom style you might have implemented). Note that the legacy implementation will however be removed at some point.
1 parent cd70266 commit d3c352b

1 file changed

Lines changed: 29 additions & 29 deletions

File tree

packages/bibtex/init.lua

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function package.declareSettings (_)
9595
SILE.settings:declare({
9696
parameter = "bibtex.style",
9797
type = "string",
98-
default = "chicago",
98+
default = "csl",
9999
help = "BibTeX style",
100100
})
101101

@@ -153,13 +153,13 @@ function package.getLocator (_, options)
153153
for k, v in pairs(options) do
154154
if k ~= "key" then
155155
if not locators[k] then
156-
SU.warn("Unknown option '" .. k .. "' in \\csl:cite")
156+
SU.warn("Unknown option '" .. k .. "' in \\cite")
157157
else
158158
if not locator then
159159
local label = locators[k]
160160
locator = { label = label, value = v }
161161
else
162-
SU.warn("Multiple locators in \\csl:cite, using the first one")
162+
SU.warn("Multiple locators in \\cite, using the first one")
163163
end
164164
end
165165
end
@@ -455,34 +455,13 @@ This experimental package allows SILE to read and process Bib(La)TeX \code{.bib}
455455
To load a BibTeX file, issue the command \autodoc:command{\loadbibliography[file=<whatever.bib>]}.
456456
You can load multiple files, and the entries will be merged into a single bibliography database.
457457
458-
\smallskip
459-
\noindent
460-
\em{Producing citations and references (legacy commands)}
461-
\novbreak
462-
463-
\indent
464-
The “legacy” implementation is based on a custom rendering system.
465-
The plan is to eventually deprecate it in favor of the CSL implementation.
466-
467-
To produce an inline citation, call \autodoc:command{\cite{<key>}}, which will typeset something like “Jones 1982”.
468-
If you want to cite a particular page number, use \autodoc:command{\cite[page=22]{<key>}}.
469-
470-
To produce a bibliographic reference, use \autodoc:command{\reference{<key>}}.
471-
472-
The \autodoc:setting[check=false]{bibtex.style} setting controls the style of the bibliography.
473-
It currently defaults to \code{chicago}, the only style supported out of the box.
474-
It can however be set to \code{csl} to enforce the use of the CSL implementation on the above commands.
475-
476-
This implementation doesn’t currently produce full bibliography listings.
477-
(Actually, you can use the \autodoc:command{\printbibliography} introduced below, but then it always uses the CSL implementation for rendering the bibliography, differing from the output of the \autodoc:command{\reference} command.)
478-
479458
\smallskip
480459
\noindent
481460
\em{Producing citations and references (CSL implementation)}
482461
\novbreak
483462
484463
\indent
485-
While an experimental work-in-progress, the CSL (Citation Style Language) implementation is more powerful and flexible than the legacy commands.
464+
The CSL (Citation Style Language) implementation is more powerful and flexible than the former legacy solution available in earlier versions of this package (see below).
486465
487466
You should first invoke \autodoc:command{\bibliographystyle[style=<style>, lang=<lang>]}, where \autodoc:parameter{style} is the name of the CSL style file (without the \code{.csl} extension), and \autodoc:parameter{lang} is the language code of the CSL locale to use (e.g., \code{en-US}).
488467
@@ -498,25 +477,46 @@ The locale and styles files are searched in the \code{csl/locales} and \code{csl
498477
For convenience and testing, SILE bundles the \code{chicago-author-date} and \code{chicago-author-date-fr} styles, and the \code{en-US} and \code{fr-FR} locales.
499478
If you don’t specify a style or locale, the author-date style and the \code{en-US} locale will be used.
500479
501-
To produce an inline citation, call \autodoc:command{\csl:cite{<key>}}, which will typeset something like “(Jones 1982)”.
502-
If you want to cite a particular page number, use \autodoc:command{\csl:cite[page=22]{<key>}}. Other “locator” options are available (article, chapter, column, line, note, paragraph, section, volume, etc.) – see the CSL documentation for details.
480+
To produce an inline citation, call \autodoc:command{\cite{<key>}}, which will typeset something like “(Jones 1982)”.
481+
If you want to cite a particular page number, use \autodoc:command{\cite[page=22]{<key>}}. Other “locator” options are available (article, chapter, column, line, note, paragraph, section, volume, etc.) – see the CSL documentation for details.
503482
Some frequent abbreviations are also supported (art, chap, col, fig…)
504483
505484
To mark an entry as cited without actually producing a citation, use \autodoc:command{\nocite{<key>}}.
506485
This is useful when you want to include an entry in the bibliography without citing it in the text.
507486
508-
To generate multiple citations grouped correctly, use \autodoc:command{\cites{\cite{<key1>}, \cite{<key2>}, …}}.
487+
To generate multiple citations grouped correctly, use \autodoc:command{\cites{\cite{<key1>} \cite{<key2>}, …}}.
509488
This wrapper command only accepts \autodoc:command{\cite} elements following their standard syntax.
510489
Any other element triggers an error, and any text content is silently ignored.
511490
512491
To produce a bibliography of cited references, use \autodoc:command{\printbibliography}.
513492
After printing the bibliography, the list of cited entries will be cleared. This allows you to start fresh for subsequent uses (e.g., in a different chapter).
514493
If you want to include all entries in the bibliography, not just those that have been cited, set the option \autodoc:parameter{cited} to false.
515494
516-
To produce a bibliographic reference, use \autodoc:command{\csl:reference{<key>}}.
495+
To produce a bibliographic reference, use \autodoc:command{\reference{<key>}}.
517496
Note that this command is not intended for actual use, but for testing purposes.
518497
It may be removed in the future.
519498
499+
\smallskip
500+
\noindent
501+
\em{Producing citations and references (legacy commands)}
502+
\novbreak
503+
504+
\indent
505+
The “legacy” implementation is based on a custom rendering system.
506+
The plan is to eventually deprecate and remove it, as the CSL implementation covers more use cases and is more powerful.
507+
508+
The \autodoc:setting[check=false]{bibtex.style} setting controls the style of the bibliography.
509+
It may be set, for instance, to \code{chicago}, the only style supported out of the box.
510+
(By default, it is set to \code{csl} to enforce the use of the CSL implementation.)
511+
512+
To produce an inline citation, call \autodoc:command{\cite{<key>}}, which will typeset something like “Jones 1982”.
513+
If you want to cite a particular page number, use \autodoc:command{\cite[page=22]{<key>}}.
514+
515+
To produce a bibliographic reference, use \autodoc:command{\reference{<key>}}.
516+
517+
This implementation doesn’t currently produce full bibliography listings.
518+
(Actually, you can use the \autodoc:command{\printbibliography} introduced above, but then it always uses the CSL implementation for rendering the bibliography, differing from the output of the \autodoc:command{\reference} command.)
519+
520520
\smallskip
521521
\noindent
522522
\em{Notes on the supported BibTeX syntax}

0 commit comments

Comments
 (0)