You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: packages/bibtex/init.lua
+29-29Lines changed: 29 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ function package.declareSettings (_)
95
95
SILE.settings:declare({
96
96
parameter="bibtex.style",
97
97
type="string",
98
-
default="chicago",
98
+
default="csl",
99
99
help="BibTeX style",
100
100
})
101
101
@@ -153,13 +153,13 @@ function package.getLocator (_, options)
153
153
fork, vinpairs(options) do
154
154
ifk~="key" then
155
155
ifnotlocators[k] then
156
-
SU.warn("Unknown option '" ..k.."' in \\csl:cite")
156
+
SU.warn("Unknown option '" ..k.."' in \\cite")
157
157
else
158
158
ifnotlocatorthen
159
159
locallabel=locators[k]
160
160
locator= { label=label, value=v }
161
161
else
162
-
SU.warn("Multiple locators in \\csl:cite, using the first one")
162
+
SU.warn("Multiple locators in \\cite, using the first one")
163
163
end
164
164
end
165
165
end
@@ -455,34 +455,13 @@ This experimental package allows SILE to read and process Bib(La)TeX \code{.bib}
455
455
To load a BibTeX file, issue the command \autodoc:command{\loadbibliography[file=<whatever.bib>]}.
456
456
You can load multiple files, and the entries will be merged into a single bibliography database.
457
457
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
-
479
458
\smallskip
480
459
\noindent
481
460
\em{Producing citations and references (CSL implementation)}
482
461
\novbreak
483
462
484
463
\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).
486
465
487
466
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}).
488
467
@@ -498,25 +477,46 @@ The locale and styles files are searched in the \code{csl/locales} and \code{csl
498
477
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.
499
478
If you don’t specify a style or locale, the author-date style and the \code{en-US} locale will be used.
500
479
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.
503
482
Some frequent abbreviations are also supported (art, chap, col, fig…)
504
483
505
484
To mark an entry as cited without actually producing a citation, use \autodoc:command{\nocite{<key>}}.
506
485
This is useful when you want to include an entry in the bibliography without citing it in the text.
507
486
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>}, …}}.
509
488
This wrapper command only accepts \autodoc:command{\cite} elements following their standard syntax.
510
489
Any other element triggers an error, and any text content is silently ignored.
511
490
512
491
To produce a bibliography of cited references, use \autodoc:command{\printbibliography}.
513
492
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).
514
493
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.
515
494
516
-
To produce a bibliographic reference, use \autodoc:command{\csl:reference{<key>}}.
495
+
To produce a bibliographic reference, use \autodoc:command{\reference{<key>}}.
517
496
Note that this command is not intended for actual use, but for testing purposes.
518
497
It may be removed in the future.
519
498
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.)
0 commit comments