• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sile-typesetter / sile / 9409557472

07 Jun 2024 12:09AM UTC coverage: 69.448% (-4.5%) from 73.988%
9409557472

push

github

alerque
fix(build): Distribute vendored compat-5.3.c source file

12025 of 17315 relevant lines covered (69.45%)

6023.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/bibtex/styles/chicago.lua
1
local Bibliography = require("packages.bibtex.bibliography")
×
2

3
local ChicagoStyles = pl.tablex.merge(Bibliography.Style, {
×
4
   CitationStyle = Bibliography.CitationStyles.AuthorYear,
5

6
   -- luacheck: push ignore
7
   ---@diagnostic disable: undefined-global, unused-local
8
   Article = function (_ENV)
9
      -- Chicago Citation Style 17th Edition
10
      --   https://guides.rdpolytech.ca/chicago/citation/article
11
      --   General format = Author Surname, First Name. "Article Title."
12
      --                   Journal Title Volume, no. Issue (Year): Page range of article.
13
      --                   DOI OR URL of journal article web page OR Name of database.
14
      --   Magazine = Author Surname, First Name. "Article Title." Magazine Title, Month Day, Year. URL.
15
      --   Newspaper = Author Surname, First Name. "Article Title." Newspaper Title, Month Day, Year.
16
      -- So we try to match the closest format.
17
      if number or volume then
×
18
         -- General format
19
         return andAuthors,
×
20
            ". ",
21
            quotes(title, "."),
×
22
            " ",
23
            italic(journal),
×
24
            optional(" ", volume),
×
25
            optional(" no. ", number),
×
26
            optional(" ", parens(optional(month, " "), year)),
×
27
            optional(": ", pageRange),
×
28
            ".",
29
            optional(" ", doi, "."),
×
30
            optional(" ", url, ".")
×
31
      end
32
      -- Magazine or newspaper format
33
      return andAuthors,
×
34
         ". ",
35
         quotes(title, "."),
×
36
         " ",
37
         italic(journal),
×
38
         optional(", ", month),
×
39
         optional(", ", year),
×
40
         optional(": ", pageRange),
×
41
         ".",
42
         optional(" ", doi, "."),
×
43
         optional(" ", url, ".")
×
44
   end,
45

46
   Book = function (_ENV)
47
      -- Chicago Citation Style 17th Edition
48
      --   https://guides.rdpolytech.ca/chicago/citation/book
49
      --   Simple: Author Surname, First Name or Initial. Book Title: Subtitle. Place of Publication: Publisher, Year.
50
      --   With chapter: Author Surname, First Name or Initial. "Chapter Title in Quotation Marks." In Book Title: Subtitle,
51
      --      edited by Editor First Name Surname, page range of chapter. Place of Publication: Publisher, Year.
52
      --   Dictionary etc.: Author Surname, First Name. "Title of Entry." In Title of Reference Book,
53
      --       edited by Editor First Name Surname. Publisher, Year. URL.
54
      -- Likewise, we try to match the colsets format...
55
      local pub = publisher or institution or organization or howpublished
×
56
      if booktitle then
×
57
         return optional(andAuthors, ", "),
×
58
            quotes(title, "."),
×
59
            " ",
60
            optional("In ", italic(booktitle), ". "),
×
61
            optional(transEditor, ". "),
×
62
            optional(address, ": "),
×
63
            optional(pub, year and ", " or ". "),
×
64
            optional(year, ". "),
×
65
            optional(number, ". "),
×
66
            optional(doi, ". "),
×
67
            optional(url, ".")
×
68
      end
69
      return optional(andAuthors, ", "),
×
70
         italic(title),
×
71
         ". ",
72
         optional(transEditor, ". "),
×
73
         optional(address, ": "),
×
74
         optional(pub, year and ", " or ". "),
×
75
         optional(year, ". "),
×
76
         optional(number, ". "),
×
77
         optional(doi, ". "),
×
78
         optional(url, ". ")
×
79
   end,
80

81
   Thesis = function (_ENV)
82
      local pub = publisher or institution or organization or howpublished or school
×
83
      return optional(andSurnames(3), ", "),
×
84
         quotes(title, "."),
×
85
         " ",
86
         optional(transEditor, ". "),
×
87
         optional(bibtype, ". "), -- "type" from BibTeX entry
×
88
         optional(address, ": "),
×
89
         optional(pub, ", "),
×
90
         optional(year, ".")
×
91
   end,
92
}, true)
×
93
-- luacheck: pop
94
---@diagnostic enable: undefined-global, unused-local
95

96
return pl.tablex.merge(ChicagoStyles, {
×
97
   -- Add fallback mappings for usual BibTeX keys not defined above.
98
   Booklet = ChicagoStyles.Book,
99
   Conference = ChicagoStyles.Book,
100
   Inbook = ChicagoStyles.Book,
101
   Incollection = ChicagoStyles.Book,
102
   Inproceedings = ChicagoStyles.Book,
103
   Manual = ChicagoStyles.Book,
104
   Misc = ChicagoStyles.Book, -- NOTE: So we assume at least a title...
105
   Proceedings = ChicagoStyles.Book,
106
   Techreport = ChicagoStyles.Book,
107
   Phdthesis = ChicagoStyles.Thesis,
108
   Mastersthesis = ChicagoStyles.Thesis,
109
   Unpublished = ChicagoStyles.Book,
110
}, true)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc