├── .gitignore
├── .quartoignore
├── LICENSE
├── README.md
├── TODO.md
├── _extensions
└── jss
│ ├── _extension.yml
│ ├── _extensions
│ └── quarto-ext
│ │ └── fancy-text
│ │ ├── _extension.yml
│ │ └── fancy-text.lua
│ ├── jss.bst
│ ├── jss.cls
│ ├── jss.lua
│ ├── jsslogo.jpg
│ └── partials
│ ├── _print-address.tex
│ ├── _print-author.tex
│ ├── before-body.tex
│ └── title.tex
├── article-visualization.pdf
├── bibliography.bib
├── style-guide
├── article-visualization.pdf
├── article.R
├── article.pdf
├── article.tex
├── jss.bst
├── jss.cls
├── jss.pdf
├── jsslogo.jpg
└── refs.bib
└── template.qmd
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
3 | /.luarc.json
4 |
5 | /template_files/
6 | /template.html
7 | /template.pdf
8 | /template.tex
9 | /jss.bst
10 | /jss.cls
11 | /jsslogo.jpg
12 |
--------------------------------------------------------------------------------
/.quartoignore:
--------------------------------------------------------------------------------
1 | style-guide
2 | TODO.md
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Journal of Statistical Software (JSS)
2 |
3 | This Quarto format will help you create documents for the Journal of Statistical Software. To learn more about the Journal of Statistical Software, see [https://www.jstatsoft.org](https://www.jstatsoft.org). For more about Quarto and how to use format extensions, see .
4 |
5 | ## Creating a New Article
6 |
7 | You can use this as a template to create an article for the Journal of Statistical Software. To do this, use the following command:
8 |
9 | ```quarto use template quarto-journals/jss```
10 |
11 | This will install the extension and create an example qmd file and bibiography that you can use as a starting place for your article.
12 |
13 |
14 | ## Installation For Existing Document
15 |
16 | You may also use this format with an existing Quarto project or document. From the quarto project or document directory, run the following command to install this format:
17 |
18 | ```quarto add quarto-journals/jss```
19 |
20 | ## Usage
21 |
22 | To use the format, you can use the format names `jss-pdf` and `jss-html`. For example:
23 |
24 | ```quarto render article.qmd --to jss-pdf```
25 |
26 | or in your document yaml
27 |
28 | ```yaml
29 | format:
30 | pdf: default
31 | jss-pdf:
32 | keep-tex: true
33 | ```
34 |
35 | You can view a preview of the rendered template at .
36 |
37 | ## Format Options
38 |
39 | The JSS format supports a number of options for customizing the format and appearance of the document. Specify these under the `journal` key.
40 |
41 | ---
42 |
43 | **`type`**
44 |
45 | `article` - default, for JSS article.
46 |
47 | `codesnippets` - for JSS code snippets.
48 |
49 | `bookreview` - for JSS book reviews.
50 |
51 | `softwarereview` - for JSS software reviews.
52 |
53 | ---
54 |
55 | **`cite-shortnames`**
56 |
57 | Set to `true` to disable citations with all names globally.
58 |
59 | ---
60 |
61 | **`suppress`**
62 |
63 | List of:
64 |
65 | `title` - suppress the automatic `\maketitle` at the beginning of the document.
66 |
67 | `headings` - suppress headings on the pages.
68 |
69 | `footer` - suppress the automatic `\makefooter` at the end of the document.
70 |
71 | ---
72 |
73 | **`include-jss-default`**
74 |
75 | Set to `false` to suppress JSS header and footer.
76 |
77 | ---
78 |
79 | For example:
80 |
81 | ```yaml
82 | format:
83 | jss-pdf:
84 | keep-tex: true
85 | journal:
86 | type: bookreview
87 | cite-shortnames: true
88 | suppress: [title]
89 | include-jss-default: false
90 | ```
91 |
--------------------------------------------------------------------------------
/TODO.md:
--------------------------------------------------------------------------------
1 | ## Open Issues
2 |
3 | ### Tables
4 | - Tables are not currently globally centered.
5 | - Tables are not currently placed at the top of the page by default.
6 |
7 | In order to fix the above, we will need Quarto to either expose table options or we'll need to likely use a LaTeX post processor to fix up tables (trying to fix this in a filter is challenge since we will need to deal with all sorts of table representations).
8 |
9 | ### Section Titles
10 | - We don't currently have a way to write 'plain' section LaTeX
11 | - `short-title.lua` does this for rticles, but generating the sections results in Quarto cross referencing being evaded (because we transform the headings into raw tex)
12 | - will likely need Quarto to add suppot for this.
13 |
14 | ### Authors
15 | - We're currently outputing authors without addresses / affiliations in the bottom section
16 | - The address output doesn't quite match the template
17 |
18 | ### Appendixes
19 | - We're not properly numbering the appendixes (e.g. should have letters/be proper appendix rather than being unnumbered)
20 |
--------------------------------------------------------------------------------
/_extensions/jss/_extension.yml:
--------------------------------------------------------------------------------
1 | title: Journal of Statistical Software Format
2 | author: Charles Teague
3 | version: 0.9.4
4 | quarto-required: ">=1.2.198"
5 | contributes:
6 | format:
7 | common:
8 | filters:
9 | - jss.lua
10 | shortcodes:
11 | - quarto-ext/fancy-text
12 | knitr:
13 | opts_chunk:
14 | R.options:
15 | prompt: "R> "
16 | continue: "+"
17 | pdf:
18 | documentclass: jss
19 | shift-heading-level-by: -1
20 | tbl-cap-location: bottom
21 | highlight-style: none
22 | include-in-header:
23 | text: |
24 | \usepackage{orcidlink,thumbpdf,lmodern}
25 |
26 | \newcommand{\class}[1]{`\code{#1}'}
27 | \newcommand{\fct}[1]{\code{#1()}}
28 | fig-width: 4.9 # 6.125" * 0.8, as in template
29 | fig-height: 3.675 # 4.9 * 3:4
30 | template-partials:
31 | - "partials/title.tex"
32 | - "partials/before-body.tex"
33 | - "partials/_print-address.tex"
34 | - "partials/_print-author.tex"
35 | cite-method: natbib
36 | biblio-config: false
37 | format-resources:
38 | - jss.bst
39 | - jss.cls
40 | - jsslogo.jpg
41 | html:
42 | number-sections: true
43 | toc: true
44 |
--------------------------------------------------------------------------------
/_extensions/jss/_extensions/quarto-ext/fancy-text/_extension.yml:
--------------------------------------------------------------------------------
1 | title: Fancy Text
2 | author: "RStudio, PBC"
3 | version: 0.0.1
4 | contributes:
5 | shortcodes:
6 | - fancy-text.lua
7 |
--------------------------------------------------------------------------------
/_extensions/jss/_extensions/quarto-ext/fancy-text/fancy-text.lua:
--------------------------------------------------------------------------------
1 | -- shortcode that provides a nicely formatted 'LaTeX' string
2 | function latex()
3 | if quarto.doc.is_format("pdf") then
4 | return pandoc.RawBlock('tex', '{\\LaTeX}')
5 | elseif quarto.doc.is_format("html") then
6 | return pandoc.Math('InlineMath', "\\LaTeX")
7 | else
8 | return pandoc.Span('LaTeX')
9 | end
10 | end
11 |
12 | -- shortcode that provides a nicely formatted 'bibtex' string
13 | function bibtex()
14 | if quarto.doc.is_format("pdf") then
15 | return pandoc.RawBlock('tex', '\\textsc{Bib}{\\TeX}')
16 | elseif quarto.doc.is_format("html") then
17 | return pandoc.RawBlock('html', 'BibTEX')
18 | else
19 | return pandoc.Span('BibTeX')
20 | end
21 | end
--------------------------------------------------------------------------------
/_extensions/jss/jss.bst:
--------------------------------------------------------------------------------
1 | %%
2 | %% This is file `jss.bst',
3 | %% generated with the docstrip utility.
4 | %%
5 | %% The original source files were:
6 | %%
7 | %% merlin.mbs (with options: `ay,nat,nm-rvx,keyxyr,dt-beg,yr-par,note-yr,tit-qq,atit-u,trnum-it,vol-bf,volp-com,num-xser,pre-edn,isbn,issn,edpar,pp,ed,xedn,xand,etal-it,revdata,eprint,url,url-blk,doi,nfss')
8 | %%
9 | %% ** BibTeX style file for JSS publications (http://www.jstatsoft.org/)
10 | %%
11 | %% License: GPL-2 | GPL-3
12 | % ===============================================================
13 | % IMPORTANT NOTICE:
14 | % This bibliographic style (bst) file has been generated from one or
15 | % more master bibliographic style (mbs) files, listed above, provided
16 | % with kind permission of Patrick W Daly.
17 | %
18 | % This generated file can be redistributed and/or modified under the terms
19 | % of the General Public License (Version 2 or 3).
20 | % ===============================================================
21 | % Name and version information of the main mbs file:
22 | % \ProvidesFile{merlin.mbs}[2011/11/18 4.33 (PWD, AO, DPC)]
23 | % For use with BibTeX version 0.99a or later
24 | %-------------------------------------------------------------------
25 | % This bibliography style file is intended for texts in ENGLISH
26 | % This is an author-year citation style bibliography. As such, it is
27 | % non-standard LaTeX, and requires a special package file to function properly.
28 | % Such a package is natbib.sty by Patrick W. Daly
29 | % The form of the \bibitem entries is
30 | % \bibitem[Jones et al.(1990)]{key}...
31 | % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}...
32 | % The essential feature is that the label (the part in brackets) consists
33 | % of the author names, as they should appear in the citation, with the year
34 | % in parentheses following. There must be no space before the opening
35 | % parenthesis!
36 | % With natbib v5.3, a full list of authors may also follow the year.
37 | % In natbib.sty, it is possible to define the type of enclosures that is
38 | % really wanted (brackets or parentheses), but in either case, there must
39 | % be parentheses in the label.
40 | % The \cite command functions as follows:
41 | % \citet{key} ==>> Jones et al. (1990)
42 | % \citet*{key} ==>> Jones, Baker, and Smith (1990)
43 | % \citep{key} ==>> (Jones et al., 1990)
44 | % \citep*{key} ==>> (Jones, Baker, and Smith, 1990)
45 | % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
46 | % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990)
47 | % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., 1990, p. 32)
48 | % \citeauthor{key} ==>> Jones et al.
49 | % \citeauthor*{key} ==>> Jones, Baker, and Smith
50 | % \citeyear{key} ==>> 1990
51 | %---------------------------------------------------------------------
52 |
53 | ENTRY
54 | { address
55 | archive
56 | author
57 | booktitle
58 | chapter
59 | collaboration
60 | doi
61 | edition
62 | editor
63 | eid
64 | eprint
65 | howpublished
66 | institution
67 | isbn
68 | issn
69 | journal
70 | key
71 | month
72 | note
73 | number
74 | numpages
75 | organization
76 | pages
77 | publisher
78 | school
79 | series
80 | title
81 | type
82 | url
83 | volume
84 | year
85 | }
86 | {}
87 | { label extra.label sort.label short.list }
88 | INTEGERS { output.state before.all mid.sentence after.sentence after.block }
89 | FUNCTION {init.state.consts}
90 | { #0 'before.all :=
91 | #1 'mid.sentence :=
92 | #2 'after.sentence :=
93 | #3 'after.block :=
94 | }
95 | STRINGS { s t}
96 | FUNCTION {output.nonnull}
97 | { 's :=
98 | output.state mid.sentence =
99 | { ", " * write$ }
100 | { output.state after.block =
101 | { add.period$ write$
102 | newline$
103 | "\newblock " write$
104 | }
105 | { output.state before.all =
106 | 'write$
107 | { add.period$ " " * write$ }
108 | if$
109 | }
110 | if$
111 | mid.sentence 'output.state :=
112 | }
113 | if$
114 | s
115 | }
116 | FUNCTION {output}
117 | { duplicate$ empty$
118 | 'pop$
119 | 'output.nonnull
120 | if$
121 | }
122 | FUNCTION {output.check}
123 | { 't :=
124 | duplicate$ empty$
125 | { pop$ "empty " t * " in " * cite$ * warning$ }
126 | 'output.nonnull
127 | if$
128 | }
129 | FUNCTION {fin.entry}
130 | { add.period$
131 | write$
132 | newline$
133 | }
134 |
135 | FUNCTION {new.block}
136 | { output.state before.all =
137 | 'skip$
138 | { after.block 'output.state := }
139 | if$
140 | }
141 | FUNCTION {new.sentence}
142 | { output.state after.block =
143 | 'skip$
144 | { output.state before.all =
145 | 'skip$
146 | { after.sentence 'output.state := }
147 | if$
148 | }
149 | if$
150 | }
151 | FUNCTION {add.blank}
152 | { " " * before.all 'output.state :=
153 | }
154 |
155 | FUNCTION {date.block}
156 | {
157 | new.block
158 | }
159 |
160 | FUNCTION {not}
161 | { { #0 }
162 | { #1 }
163 | if$
164 | }
165 | FUNCTION {and}
166 | { 'skip$
167 | { pop$ #0 }
168 | if$
169 | }
170 | FUNCTION {or}
171 | { { pop$ #1 }
172 | 'skip$
173 | if$
174 | }
175 | FUNCTION {non.stop}
176 | { duplicate$
177 | "}" * add.period$
178 | #-1 #1 substring$ "." =
179 | }
180 |
181 | STRINGS {z}
182 |
183 | FUNCTION {remove.dots}
184 | { 'z :=
185 | ""
186 | { z empty$ not }
187 | { z #1 #2 substring$
188 | duplicate$ "\." =
189 | { z #3 global.max$ substring$ 'z := * }
190 | { pop$
191 | z #1 #1 substring$
192 | z #2 global.max$ substring$ 'z :=
193 | duplicate$ "." = 'pop$
194 | { * }
195 | if$
196 | }
197 | if$
198 | }
199 | while$
200 | }
201 | FUNCTION {new.block.checkb}
202 | { empty$
203 | swap$ empty$
204 | and
205 | 'skip$
206 | 'new.block
207 | if$
208 | }
209 | FUNCTION {field.or.null}
210 | { duplicate$ empty$
211 | { pop$ "" }
212 | 'skip$
213 | if$
214 | }
215 | FUNCTION {emphasize}
216 | { duplicate$ empty$
217 | { pop$ "" }
218 | { "\emph{" swap$ * "}" * }
219 | if$
220 | }
221 | FUNCTION {bolden}
222 | { duplicate$ empty$
223 | { pop$ "" }
224 | { "\textbf{" swap$ * "}" * }
225 | if$
226 | }
227 | FUNCTION {tie.or.space.prefix}
228 | { duplicate$ text.length$ #3 <
229 | { "~" }
230 | { " " }
231 | if$
232 | swap$
233 | }
234 |
235 | FUNCTION {capitalize}
236 | { "u" change.case$ "t" change.case$ }
237 |
238 | FUNCTION {space.word}
239 | { " " swap$ * " " * }
240 | % Here are the language-specific definitions for explicit words.
241 | % Each function has a name bbl.xxx where xxx is the English word.
242 | % The language selected here is ENGLISH
243 | FUNCTION {bbl.and}
244 | { "and"}
245 |
246 | FUNCTION {bbl.etal}
247 | { "et~al." }
248 |
249 | FUNCTION {bbl.editors}
250 | { "eds." }
251 |
252 | FUNCTION {bbl.editor}
253 | { "ed." }
254 |
255 | FUNCTION {bbl.edby}
256 | { "edited by" }
257 |
258 | FUNCTION {bbl.edition}
259 | { "edition" }
260 |
261 | FUNCTION {bbl.volume}
262 | { "volume" }
263 |
264 | FUNCTION {bbl.of}
265 | { "of" }
266 |
267 | FUNCTION {bbl.number}
268 | { "number" }
269 |
270 | FUNCTION {bbl.nr}
271 | { "no." }
272 |
273 | FUNCTION {bbl.in}
274 | { "in" }
275 |
276 | FUNCTION {bbl.pages}
277 | { "pp." }
278 |
279 | FUNCTION {bbl.page}
280 | { "p." }
281 |
282 | FUNCTION {bbl.eidpp}
283 | { "pages" }
284 |
285 | FUNCTION {bbl.chapter}
286 | { "chapter" }
287 |
288 | FUNCTION {bbl.techrep}
289 | { "Technical Report" }
290 |
291 | FUNCTION {bbl.mthesis}
292 | { "Master's thesis" }
293 |
294 | FUNCTION {bbl.phdthesis}
295 | { "Ph.D. thesis" }
296 |
297 | MACRO {jan} {"January"}
298 |
299 | MACRO {feb} {"February"}
300 |
301 | MACRO {mar} {"March"}
302 |
303 | MACRO {apr} {"April"}
304 |
305 | MACRO {may} {"May"}
306 |
307 | MACRO {jun} {"June"}
308 |
309 | MACRO {jul} {"July"}
310 |
311 | MACRO {aug} {"August"}
312 |
313 | MACRO {sep} {"September"}
314 |
315 | MACRO {oct} {"October"}
316 |
317 | MACRO {nov} {"November"}
318 |
319 | MACRO {dec} {"December"}
320 |
321 | MACRO {acmcs} {"ACM Computing Surveys"}
322 |
323 | MACRO {acta} {"Acta Informatica"}
324 |
325 | MACRO {cacm} {"Communications of the ACM"}
326 |
327 | MACRO {ibmjrd} {"IBM Journal of Research and Development"}
328 |
329 | MACRO {ibmsj} {"IBM Systems Journal"}
330 |
331 | MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
332 |
333 | MACRO {ieeetc} {"IEEE Transactions on Computers"}
334 |
335 | MACRO {ieeetcad}
336 | {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
337 |
338 | MACRO {ipl} {"Information Processing Letters"}
339 |
340 | MACRO {jacm} {"Journal of the ACM"}
341 |
342 | MACRO {jcss} {"Journal of Computer and System Sciences"}
343 |
344 | MACRO {scp} {"Science of Computer Programming"}
345 |
346 | MACRO {sicomp} {"SIAM Journal on Computing"}
347 |
348 | MACRO {tocs} {"ACM Transactions on Computer Systems"}
349 |
350 | MACRO {tods} {"ACM Transactions on Database Systems"}
351 |
352 | MACRO {tog} {"ACM Transactions on Graphics"}
353 |
354 | MACRO {toms} {"ACM Transactions on Mathematical Software"}
355 |
356 | MACRO {toois} {"ACM Transactions on Office Information Systems"}
357 |
358 | MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
359 |
360 | MACRO {tcs} {"Theoretical Computer Science"}
361 | FUNCTION {bibinfo.check}
362 | { swap$
363 | duplicate$ missing$
364 | {
365 | pop$ pop$
366 | ""
367 | }
368 | { duplicate$ empty$
369 | {
370 | swap$ pop$
371 | }
372 | { swap$
373 | pop$
374 | }
375 | if$
376 | }
377 | if$
378 | }
379 | FUNCTION {bibinfo.warn}
380 | { swap$
381 | duplicate$ missing$
382 | {
383 | swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
384 | ""
385 | }
386 | { duplicate$ empty$
387 | {
388 | swap$ "empty " swap$ * " in " * cite$ * warning$
389 | }
390 | { swap$
391 | pop$
392 | }
393 | if$
394 | }
395 | if$
396 | }
397 | FUNCTION {format.eprint}
398 | { eprint duplicate$ empty$
399 | 'skip$
400 | { "\eprint"
401 | archive empty$
402 | 'skip$
403 | { "[" * archive * "]" * }
404 | if$
405 | "{" * swap$ * "}" *
406 | }
407 | if$
408 | }
409 | FUNCTION {format.url}
410 | {
411 | url
412 | duplicate$ empty$
413 | { pop$ "" }
414 | { "\urlprefix\url{" swap$ * "}" * }
415 | if$
416 | }
417 |
418 | INTEGERS { nameptr namesleft numnames }
419 |
420 |
421 | STRINGS { bibinfo}
422 |
423 | FUNCTION {format.names}
424 | { 'bibinfo :=
425 | duplicate$ empty$ 'skip$ {
426 | 's :=
427 | "" 't :=
428 | #1 'nameptr :=
429 | s num.names$ 'numnames :=
430 | numnames 'namesleft :=
431 | { namesleft #0 > }
432 | { s nameptr
433 | "{vv~}{ll}{ jj}{ f{}}"
434 | format.name$
435 | remove.dots
436 | bibinfo bibinfo.check
437 | 't :=
438 | nameptr #1 >
439 | {
440 | namesleft #1 >
441 | { ", " * t * }
442 | {
443 | s nameptr "{ll}" format.name$ duplicate$ "others" =
444 | { 't := }
445 | { pop$ }
446 | if$
447 | "," *
448 | t "others" =
449 | {
450 | " " * bbl.etal emphasize *
451 | }
452 | { " " * t * }
453 | if$
454 | }
455 | if$
456 | }
457 | 't
458 | if$
459 | nameptr #1 + 'nameptr :=
460 | namesleft #1 - 'namesleft :=
461 | }
462 | while$
463 | } if$
464 | }
465 | FUNCTION {format.names.ed}
466 | {
467 | 'bibinfo :=
468 | duplicate$ empty$ 'skip$ {
469 | 's :=
470 | "" 't :=
471 | #1 'nameptr :=
472 | s num.names$ 'numnames :=
473 | numnames 'namesleft :=
474 | { namesleft #0 > }
475 | { s nameptr
476 | "{f{}~}{vv~}{ll}{ jj}"
477 | format.name$
478 | remove.dots
479 | bibinfo bibinfo.check
480 | 't :=
481 | nameptr #1 >
482 | {
483 | namesleft #1 >
484 | { ", " * t * }
485 | {
486 | s nameptr "{ll}" format.name$ duplicate$ "others" =
487 | { 't := }
488 | { pop$ }
489 | if$
490 | "," *
491 | t "others" =
492 | {
493 |
494 | " " * bbl.etal emphasize *
495 | }
496 | { " " * t * }
497 | if$
498 | }
499 | if$
500 | }
501 | 't
502 | if$
503 | nameptr #1 + 'nameptr :=
504 | namesleft #1 - 'namesleft :=
505 | }
506 | while$
507 | } if$
508 | }
509 | FUNCTION {format.key}
510 | { empty$
511 | { key field.or.null }
512 | { "" }
513 | if$
514 | }
515 |
516 | FUNCTION {format.authors}
517 | { author "author" format.names
518 | duplicate$ empty$ 'skip$
519 | { collaboration "collaboration" bibinfo.check
520 | duplicate$ empty$ 'skip$
521 | { " (" swap$ * ")" * }
522 | if$
523 | *
524 | }
525 | if$
526 | }
527 | FUNCTION {get.bbl.editor}
528 | { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
529 |
530 | FUNCTION {format.editors}
531 | { editor "editor" format.names duplicate$ empty$ 'skip$
532 | {
533 | " " *
534 | get.bbl.editor
535 | "(" swap$ * ")" *
536 | *
537 | }
538 | if$
539 | }
540 | FUNCTION {format.isbn}
541 | { isbn "isbn" bibinfo.check
542 | duplicate$ empty$ 'skip$
543 | {
544 | new.block
545 | "ISBN " swap$ *
546 | }
547 | if$
548 | }
549 |
550 | FUNCTION {format.issn}
551 | { issn "issn" bibinfo.check
552 | duplicate$ empty$ 'skip$
553 | {
554 | new.block
555 | "ISSN " swap$ *
556 | }
557 | if$
558 | }
559 |
560 | FUNCTION {format.doi}
561 | { doi empty$
562 | { "" }
563 | {
564 | new.block
565 | "\doi{" doi * "}" *
566 | }
567 | if$
568 | }
569 | FUNCTION {format.note}
570 | {
571 | note empty$
572 | { "" }
573 | { note #1 #1 substring$
574 | duplicate$ "{" =
575 | 'skip$
576 | { output.state mid.sentence =
577 | { "l" }
578 | { "u" }
579 | if$
580 | change.case$
581 | }
582 | if$
583 | note #2 global.max$ substring$ * "note" bibinfo.check
584 | }
585 | if$
586 | }
587 |
588 | FUNCTION {format.title}
589 | { title
590 | "title" bibinfo.check
591 | duplicate$ empty$ 'skip$
592 | {
593 | "\enquote{" swap$ *
594 | add.period$ "}" *
595 | }
596 | if$
597 | }
598 | FUNCTION {format.full.names}
599 | {'s :=
600 | "" 't :=
601 | #1 'nameptr :=
602 | s num.names$ 'numnames :=
603 | numnames 'namesleft :=
604 | { namesleft #0 > }
605 | { s nameptr
606 | "{vv~}{ll}" format.name$
607 | 't :=
608 | nameptr #1 >
609 | {
610 | namesleft #1 >
611 | { ", " * t * }
612 | {
613 | s nameptr "{ll}" format.name$ duplicate$ "others" =
614 | { 't := }
615 | { pop$ }
616 | if$
617 | t "others" =
618 | {
619 | " " * bbl.etal emphasize *
620 | }
621 | {
622 | numnames #2 >
623 | { "," * }
624 | 'skip$
625 | if$
626 | bbl.and
627 | space.word * t *
628 | }
629 | if$
630 | }
631 | if$
632 | }
633 | 't
634 | if$
635 | nameptr #1 + 'nameptr :=
636 | namesleft #1 - 'namesleft :=
637 | }
638 | while$
639 | }
640 |
641 | FUNCTION {author.editor.key.full}
642 | { author empty$
643 | { editor empty$
644 | { key empty$
645 | { cite$ #1 #3 substring$ }
646 | 'key
647 | if$
648 | }
649 | { editor format.full.names }
650 | if$
651 | }
652 | { author format.full.names }
653 | if$
654 | }
655 |
656 | FUNCTION {author.key.full}
657 | { author empty$
658 | { key empty$
659 | { cite$ #1 #3 substring$ }
660 | 'key
661 | if$
662 | }
663 | { author format.full.names }
664 | if$
665 | }
666 |
667 | FUNCTION {editor.key.full}
668 | { editor empty$
669 | { key empty$
670 | { cite$ #1 #3 substring$ }
671 | 'key
672 | if$
673 | }
674 | { editor format.full.names }
675 | if$
676 | }
677 |
678 | FUNCTION {make.full.names}
679 | { type$ "book" =
680 | type$ "inbook" =
681 | or
682 | 'author.editor.key.full
683 | { type$ "proceedings" =
684 | 'editor.key.full
685 | 'author.key.full
686 | if$
687 | }
688 | if$
689 | }
690 |
691 | FUNCTION {output.bibitem}
692 | { newline$
693 | "\bibitem[{" write$
694 | label write$
695 | ")" make.full.names duplicate$ short.list =
696 | { pop$ }
697 | { * }
698 | if$
699 | "}]{" * write$
700 | cite$ write$
701 | "}" write$
702 | newline$
703 | ""
704 | before.all 'output.state :=
705 | }
706 |
707 | FUNCTION {n.dashify}
708 | {
709 | 't :=
710 | ""
711 | { t empty$ not }
712 | { t #1 #1 substring$ "-" =
713 | { t #1 #2 substring$ "--" = not
714 | { "--" *
715 | t #2 global.max$ substring$ 't :=
716 | }
717 | { { t #1 #1 substring$ "-" = }
718 | { "-" *
719 | t #2 global.max$ substring$ 't :=
720 | }
721 | while$
722 | }
723 | if$
724 | }
725 | { t #1 #1 substring$ *
726 | t #2 global.max$ substring$ 't :=
727 | }
728 | if$
729 | }
730 | while$
731 | }
732 |
733 | FUNCTION {word.in}
734 | { bbl.in capitalize
735 | " " * }
736 |
737 | FUNCTION {format.date}
738 | { year "year" bibinfo.check duplicate$ empty$
739 | {
740 | "empty year in " cite$ * "; set to ????" * warning$
741 | pop$ "????"
742 | }
743 | 'skip$
744 | if$
745 | extra.label *
746 | before.all 'output.state :=
747 | " (" swap$ * ")" *
748 | }
749 | FUNCTION {format.btitle}
750 | { title "title" bibinfo.check
751 | duplicate$ empty$ 'skip$
752 | {
753 | emphasize
754 | }
755 | if$
756 | }
757 | FUNCTION {either.or.check}
758 | { empty$
759 | 'pop$
760 | { "can't use both " swap$ * " fields in " * cite$ * warning$ }
761 | if$
762 | }
763 | FUNCTION {format.bvolume}
764 | { volume empty$
765 | { "" }
766 | { bbl.volume volume tie.or.space.prefix
767 | "volume" bibinfo.check * *
768 | series "series" bibinfo.check
769 | duplicate$ empty$ 'pop$
770 | { swap$ bbl.of space.word * swap$
771 | emphasize * }
772 | if$
773 | "volume and number" number either.or.check
774 | }
775 | if$
776 | }
777 | FUNCTION {format.number.series}
778 | { volume empty$
779 | { number empty$
780 | { series field.or.null }
781 | { series empty$
782 | { number "number" bibinfo.check }
783 | { output.state mid.sentence =
784 | { bbl.number }
785 | { bbl.number capitalize }
786 | if$
787 | number tie.or.space.prefix "number" bibinfo.check * *
788 | bbl.in space.word *
789 | series "series" bibinfo.check *
790 | }
791 | if$
792 | }
793 | if$
794 | }
795 | { "" }
796 | if$
797 | }
798 |
799 | FUNCTION {format.edition}
800 | { edition duplicate$ empty$ 'skip$
801 | {
802 | output.state mid.sentence =
803 | { "l" }
804 | { "t" }
805 | if$ change.case$
806 | "edition" bibinfo.check
807 | " " * bbl.edition *
808 | }
809 | if$
810 | }
811 | INTEGERS { multiresult }
812 | FUNCTION {multi.page.check}
813 | { 't :=
814 | #0 'multiresult :=
815 | { multiresult not
816 | t empty$ not
817 | and
818 | }
819 | { t #1 #1 substring$
820 | duplicate$ "-" =
821 | swap$ duplicate$ "," =
822 | swap$ "+" =
823 | or or
824 | { #1 'multiresult := }
825 | { t #2 global.max$ substring$ 't := }
826 | if$
827 | }
828 | while$
829 | multiresult
830 | }
831 | FUNCTION {format.pages}
832 | { pages duplicate$ empty$ 'skip$
833 | { duplicate$ multi.page.check
834 | {
835 | bbl.pages swap$
836 | n.dashify
837 | }
838 | {
839 | bbl.page swap$
840 | }
841 | if$
842 | tie.or.space.prefix
843 | "pages" bibinfo.check
844 | * *
845 | }
846 | if$
847 | }
848 | FUNCTION {format.journal.pages}
849 | { pages duplicate$ empty$ 'pop$
850 | { swap$ duplicate$ empty$
851 | { pop$ pop$ format.pages }
852 | {
853 | ", " *
854 | swap$
855 | n.dashify
856 | "pages" bibinfo.check
857 | *
858 | }
859 | if$
860 | }
861 | if$
862 | }
863 | FUNCTION {format.journal.eid}
864 | { eid "eid" bibinfo.check
865 | duplicate$ empty$ 'pop$
866 | { swap$ duplicate$ empty$ 'skip$
867 | {
868 | ", " *
869 | }
870 | if$
871 | swap$ *
872 | numpages empty$ 'skip$
873 | { bbl.eidpp numpages tie.or.space.prefix
874 | "numpages" bibinfo.check * *
875 | " (" swap$ * ")" * *
876 | }
877 | if$
878 | }
879 | if$
880 | }
881 | FUNCTION {format.vol.num.pages}
882 | { volume field.or.null
883 | duplicate$ empty$ 'skip$
884 | {
885 | "volume" bibinfo.check
886 | }
887 | if$
888 | bolden
889 | number "number" bibinfo.check duplicate$ empty$ 'skip$
890 | {
891 | swap$ duplicate$ empty$
892 | { "there's a number but no volume in " cite$ * warning$ }
893 | 'skip$
894 | if$
895 | swap$
896 | "(" swap$ * ")" *
897 | }
898 | if$ *
899 | eid empty$
900 | { format.journal.pages }
901 | { format.journal.eid }
902 | if$
903 | }
904 |
905 | FUNCTION {format.chapter.pages}
906 | { chapter empty$
907 | 'format.pages
908 | { type empty$
909 | { bbl.chapter }
910 | { type "l" change.case$
911 | "type" bibinfo.check
912 | }
913 | if$
914 | chapter tie.or.space.prefix
915 | "chapter" bibinfo.check
916 | * *
917 | pages empty$
918 | 'skip$
919 | { ", " * format.pages * }
920 | if$
921 | }
922 | if$
923 | }
924 |
925 | FUNCTION {format.booktitle}
926 | {
927 | booktitle "booktitle" bibinfo.check
928 | emphasize
929 | }
930 | FUNCTION {format.in.ed.booktitle}
931 | { format.booktitle duplicate$ empty$ 'skip$
932 | {
933 | editor "editor" format.names.ed duplicate$ empty$ 'pop$
934 | {
935 | " " *
936 | get.bbl.editor
937 | "(" swap$ * "), " *
938 | * swap$
939 | * }
940 | if$
941 | word.in swap$ *
942 | }
943 | if$
944 | }
945 | FUNCTION {format.thesis.type}
946 | { type duplicate$ empty$
947 | 'pop$
948 | { swap$ pop$
949 | "t" change.case$ "type" bibinfo.check
950 | }
951 | if$
952 | }
953 | FUNCTION {format.tr.number}
954 | { number "number" bibinfo.check
955 | type duplicate$ empty$
956 | { pop$ bbl.techrep }
957 | 'skip$
958 | if$
959 | "type" bibinfo.check
960 | swap$ duplicate$ empty$
961 | { pop$ "t" change.case$ }
962 | { tie.or.space.prefix * * }
963 | if$
964 | }
965 | FUNCTION {format.article.crossref}
966 | {
967 | word.in
968 | " \cite{" * crossref * "}" *
969 | }
970 | FUNCTION {format.book.crossref}
971 | { volume duplicate$ empty$
972 | { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
973 | pop$ word.in
974 | }
975 | { bbl.volume
976 | capitalize
977 | swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
978 | }
979 | if$
980 | " \cite{" * crossref * "}" *
981 | }
982 | FUNCTION {format.incoll.inproc.crossref}
983 | {
984 | word.in
985 | " \cite{" * crossref * "}" *
986 | }
987 | FUNCTION {format.org.or.pub}
988 | { 't :=
989 | ""
990 | address empty$ t empty$ and
991 | 'skip$
992 | {
993 | t empty$
994 | { address "address" bibinfo.check *
995 | }
996 | { t *
997 | address empty$
998 | 'skip$
999 | { ", " * address "address" bibinfo.check * }
1000 | if$
1001 | }
1002 | if$
1003 | }
1004 | if$
1005 | }
1006 | FUNCTION {format.publisher.address}
1007 | { publisher "publisher" bibinfo.warn format.org.or.pub
1008 | }
1009 |
1010 | FUNCTION {format.organization.address}
1011 | { organization "organization" bibinfo.check format.org.or.pub
1012 | }
1013 |
1014 | FUNCTION {article}
1015 | { output.bibitem
1016 | format.authors "author" output.check
1017 | author format.key output
1018 | format.date "year" output.check
1019 | date.block
1020 | format.title "title" output.check
1021 | new.block
1022 | crossref missing$
1023 | {
1024 | journal
1025 | "journal" bibinfo.check
1026 | emphasize
1027 | "journal" output.check
1028 | format.vol.num.pages output
1029 | }
1030 | { format.article.crossref output.nonnull
1031 | format.pages output
1032 | }
1033 | if$
1034 | format.issn output
1035 | format.doi output
1036 | new.block
1037 | format.note output
1038 | format.eprint output
1039 | format.url output
1040 | fin.entry
1041 | }
1042 | FUNCTION {book}
1043 | { output.bibitem
1044 | author empty$
1045 | { format.editors "author and editor" output.check
1046 | editor format.key output
1047 | }
1048 | { format.authors output.nonnull
1049 | crossref missing$
1050 | { "author and editor" editor either.or.check }
1051 | 'skip$
1052 | if$
1053 | }
1054 | if$
1055 | format.date "year" output.check
1056 | date.block
1057 | format.btitle "title" output.check
1058 | crossref missing$
1059 | { format.bvolume output
1060 | new.block
1061 | format.number.series output
1062 | format.edition output
1063 | new.sentence
1064 | format.publisher.address output
1065 | }
1066 | {
1067 | new.block
1068 | format.book.crossref output.nonnull
1069 | }
1070 | if$
1071 | format.isbn output
1072 | format.doi output
1073 | new.block
1074 | format.note output
1075 | format.eprint output
1076 | format.url output
1077 | fin.entry
1078 | }
1079 | FUNCTION {booklet}
1080 | { output.bibitem
1081 | format.authors output
1082 | author format.key output
1083 | format.date "year" output.check
1084 | date.block
1085 | format.title "title" output.check
1086 | new.block
1087 | howpublished "howpublished" bibinfo.check output
1088 | address "address" bibinfo.check output
1089 | format.isbn output
1090 | format.doi output
1091 | new.block
1092 | format.note output
1093 | format.eprint output
1094 | format.url output
1095 | fin.entry
1096 | }
1097 |
1098 | FUNCTION {inbook}
1099 | { output.bibitem
1100 | author empty$
1101 | { format.editors "author and editor" output.check
1102 | editor format.key output
1103 | }
1104 | { format.authors output.nonnull
1105 | crossref missing$
1106 | { "author and editor" editor either.or.check }
1107 | 'skip$
1108 | if$
1109 | }
1110 | if$
1111 | format.date "year" output.check
1112 | date.block
1113 | format.btitle "title" output.check
1114 | crossref missing$
1115 | {
1116 | format.bvolume output
1117 | format.chapter.pages "chapter and pages" output.check
1118 | new.block
1119 | format.number.series output
1120 | format.edition output
1121 | new.sentence
1122 | format.publisher.address output
1123 | }
1124 | {
1125 | format.chapter.pages "chapter and pages" output.check
1126 | new.block
1127 | format.book.crossref output.nonnull
1128 | }
1129 | if$
1130 | crossref missing$
1131 | { format.isbn output }
1132 | 'skip$
1133 | if$
1134 | format.doi output
1135 | new.block
1136 | format.note output
1137 | format.eprint output
1138 | format.url output
1139 | fin.entry
1140 | }
1141 |
1142 | FUNCTION {incollection}
1143 | { output.bibitem
1144 | format.authors "author" output.check
1145 | author format.key output
1146 | format.date "year" output.check
1147 | date.block
1148 | format.title "title" output.check
1149 | new.block
1150 | crossref missing$
1151 | { format.in.ed.booktitle "booktitle" output.check
1152 | format.bvolume output
1153 | format.number.series output
1154 | format.edition output
1155 | format.chapter.pages output
1156 | new.sentence
1157 | format.publisher.address output
1158 | format.isbn output
1159 | }
1160 | { format.incoll.inproc.crossref output.nonnull
1161 | format.chapter.pages output
1162 | }
1163 | if$
1164 | format.doi output
1165 | new.block
1166 | format.note output
1167 | format.eprint output
1168 | format.url output
1169 | fin.entry
1170 | }
1171 | FUNCTION {inproceedings}
1172 | { output.bibitem
1173 | format.authors "author" output.check
1174 | author format.key output
1175 | format.date "year" output.check
1176 | date.block
1177 | format.title "title" output.check
1178 | new.block
1179 | crossref missing$
1180 | { format.in.ed.booktitle "booktitle" output.check
1181 | format.bvolume output
1182 | format.number.series output
1183 | format.pages output
1184 | new.sentence
1185 | publisher empty$
1186 | { format.organization.address output }
1187 | { organization "organization" bibinfo.check output
1188 | format.publisher.address output
1189 | }
1190 | if$
1191 | format.isbn output
1192 | format.issn output
1193 | }
1194 | { format.incoll.inproc.crossref output.nonnull
1195 | format.pages output
1196 | }
1197 | if$
1198 | format.doi output
1199 | new.block
1200 | format.note output
1201 | format.eprint output
1202 | format.url output
1203 | fin.entry
1204 | }
1205 | FUNCTION {conference} { inproceedings }
1206 | FUNCTION {manual}
1207 | { output.bibitem
1208 | format.authors output
1209 | author format.key output
1210 | format.date "year" output.check
1211 | date.block
1212 | format.btitle "title" output.check
1213 | organization address new.block.checkb
1214 | organization "organization" bibinfo.check output
1215 | address "address" bibinfo.check output
1216 | format.edition output
1217 | format.doi output
1218 | new.block
1219 | format.note output
1220 | format.eprint output
1221 | format.url output
1222 | fin.entry
1223 | }
1224 |
1225 | FUNCTION {mastersthesis}
1226 | { output.bibitem
1227 | format.authors "author" output.check
1228 | author format.key output
1229 | format.date "year" output.check
1230 | date.block
1231 | format.btitle
1232 | "title" output.check
1233 | new.block
1234 | bbl.mthesis format.thesis.type output.nonnull
1235 | school "school" bibinfo.warn output
1236 | address "address" bibinfo.check output
1237 | format.doi output
1238 | new.block
1239 | format.note output
1240 | format.eprint output
1241 | format.url output
1242 | fin.entry
1243 | }
1244 |
1245 | FUNCTION {misc}
1246 | { output.bibitem
1247 | format.authors output
1248 | author format.key output
1249 | format.date "year" output.check
1250 | date.block
1251 | format.title output
1252 | new.block
1253 | howpublished "howpublished" bibinfo.check output
1254 | format.doi output
1255 | new.block
1256 | format.note output
1257 | format.eprint output
1258 | format.url output
1259 | fin.entry
1260 | }
1261 | FUNCTION {phdthesis}
1262 | { output.bibitem
1263 | format.authors "author" output.check
1264 | author format.key output
1265 | format.date "year" output.check
1266 | date.block
1267 | format.btitle
1268 | "title" output.check
1269 | new.block
1270 | bbl.phdthesis format.thesis.type output.nonnull
1271 | school "school" bibinfo.warn output
1272 | address "address" bibinfo.check output
1273 | format.doi output
1274 | new.block
1275 | format.note output
1276 | format.eprint output
1277 | format.url output
1278 | fin.entry
1279 | }
1280 |
1281 | FUNCTION {proceedings}
1282 | { output.bibitem
1283 | format.editors output
1284 | editor format.key output
1285 | format.date "year" output.check
1286 | date.block
1287 | format.btitle "title" output.check
1288 | format.bvolume output
1289 | format.number.series output
1290 | new.sentence
1291 | publisher empty$
1292 | { format.organization.address output }
1293 | { organization "organization" bibinfo.check output
1294 | format.publisher.address output
1295 | }
1296 | if$
1297 | format.isbn output
1298 | format.issn output
1299 | format.doi output
1300 | new.block
1301 | format.note output
1302 | format.eprint output
1303 | format.url output
1304 | fin.entry
1305 | }
1306 |
1307 | FUNCTION {techreport}
1308 | { output.bibitem
1309 | format.authors "author" output.check
1310 | author format.key output
1311 | format.date "year" output.check
1312 | date.block
1313 | format.title
1314 | "title" output.check
1315 | new.block
1316 | format.tr.number emphasize output.nonnull
1317 | institution "institution" bibinfo.warn output
1318 | address "address" bibinfo.check output
1319 | format.doi output
1320 | new.block
1321 | format.note output
1322 | format.eprint output
1323 | format.url output
1324 | fin.entry
1325 | }
1326 |
1327 | FUNCTION {unpublished}
1328 | { output.bibitem
1329 | format.authors "author" output.check
1330 | author format.key output
1331 | format.date "year" output.check
1332 | date.block
1333 | format.title "title" output.check
1334 | format.doi output
1335 | new.block
1336 | format.note "note" output.check
1337 | format.eprint output
1338 | format.url output
1339 | fin.entry
1340 | }
1341 |
1342 | FUNCTION {default.type} { misc }
1343 | READ
1344 | FUNCTION {sortify}
1345 | { purify$
1346 | "l" change.case$
1347 | }
1348 | INTEGERS { len }
1349 | FUNCTION {chop.word}
1350 | { 's :=
1351 | 'len :=
1352 | s #1 len substring$ =
1353 | { s len #1 + global.max$ substring$ }
1354 | 's
1355 | if$
1356 | }
1357 | FUNCTION {format.lab.names}
1358 | { 's :=
1359 | "" 't :=
1360 | s #1 "{vv~}{ll}" format.name$
1361 | s num.names$ duplicate$
1362 | #2 >
1363 | { pop$
1364 | " " * bbl.etal emphasize *
1365 | }
1366 | { #2 <
1367 | 'skip$
1368 | { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1369 | {
1370 | " " * bbl.etal emphasize *
1371 | }
1372 | { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1373 | * }
1374 | if$
1375 | }
1376 | if$
1377 | }
1378 | if$
1379 | }
1380 |
1381 | FUNCTION {author.key.label}
1382 | { author empty$
1383 | { key empty$
1384 | { cite$ #1 #3 substring$ }
1385 | 'key
1386 | if$
1387 | }
1388 | { author format.lab.names }
1389 | if$
1390 | }
1391 |
1392 | FUNCTION {author.editor.key.label}
1393 | { author empty$
1394 | { editor empty$
1395 | { key empty$
1396 | { cite$ #1 #3 substring$ }
1397 | 'key
1398 | if$
1399 | }
1400 | { editor format.lab.names }
1401 | if$
1402 | }
1403 | { author format.lab.names }
1404 | if$
1405 | }
1406 |
1407 | FUNCTION {editor.key.label}
1408 | { editor empty$
1409 | { key empty$
1410 | { cite$ #1 #3 substring$ }
1411 | 'key
1412 | if$
1413 | }
1414 | { editor format.lab.names }
1415 | if$
1416 | }
1417 |
1418 | FUNCTION {calc.short.authors}
1419 | { type$ "book" =
1420 | type$ "inbook" =
1421 | or
1422 | 'author.editor.key.label
1423 | { type$ "proceedings" =
1424 | 'editor.key.label
1425 | 'author.key.label
1426 | if$
1427 | }
1428 | if$
1429 | 'short.list :=
1430 | }
1431 |
1432 | FUNCTION {calc.label}
1433 | { calc.short.authors
1434 | short.list
1435 | "("
1436 | *
1437 | year duplicate$ empty$
1438 | short.list key field.or.null = or
1439 | { pop$ "" }
1440 | 'skip$
1441 | if$
1442 | *
1443 | 'label :=
1444 | }
1445 |
1446 | FUNCTION {sort.format.names}
1447 | { 's :=
1448 | #1 'nameptr :=
1449 | ""
1450 | s num.names$ 'numnames :=
1451 | numnames 'namesleft :=
1452 | { namesleft #0 > }
1453 | { s nameptr
1454 | "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
1455 | format.name$ 't :=
1456 | nameptr #1 >
1457 | {
1458 | " " *
1459 | namesleft #1 = t "others" = and
1460 | { "zzzzz" 't := }
1461 | 'skip$
1462 | if$
1463 | t sortify *
1464 | }
1465 | { t sortify * }
1466 | if$
1467 | nameptr #1 + 'nameptr :=
1468 | namesleft #1 - 'namesleft :=
1469 | }
1470 | while$
1471 | }
1472 |
1473 | FUNCTION {sort.format.title}
1474 | { 't :=
1475 | "A " #2
1476 | "An " #3
1477 | "The " #4 t chop.word
1478 | chop.word
1479 | chop.word
1480 | sortify
1481 | #1 global.max$ substring$
1482 | }
1483 | FUNCTION {author.sort}
1484 | { author empty$
1485 | { key empty$
1486 | { "to sort, need author or key in " cite$ * warning$
1487 | ""
1488 | }
1489 | { key sortify }
1490 | if$
1491 | }
1492 | { author sort.format.names }
1493 | if$
1494 | }
1495 | FUNCTION {author.editor.sort}
1496 | { author empty$
1497 | { editor empty$
1498 | { key empty$
1499 | { "to sort, need author, editor, or key in " cite$ * warning$
1500 | ""
1501 | }
1502 | { key sortify }
1503 | if$
1504 | }
1505 | { editor sort.format.names }
1506 | if$
1507 | }
1508 | { author sort.format.names }
1509 | if$
1510 | }
1511 | FUNCTION {editor.sort}
1512 | { editor empty$
1513 | { key empty$
1514 | { "to sort, need editor or key in " cite$ * warning$
1515 | ""
1516 | }
1517 | { key sortify }
1518 | if$
1519 | }
1520 | { editor sort.format.names }
1521 | if$
1522 | }
1523 | FUNCTION {presort}
1524 | { calc.label
1525 | label sortify
1526 | " "
1527 | *
1528 | type$ "book" =
1529 | type$ "inbook" =
1530 | or
1531 | 'author.editor.sort
1532 | { type$ "proceedings" =
1533 | 'editor.sort
1534 | 'author.sort
1535 | if$
1536 | }
1537 | if$
1538 | #1 entry.max$ substring$
1539 | 'sort.label :=
1540 | sort.label
1541 | *
1542 | " "
1543 | *
1544 | title field.or.null
1545 | sort.format.title
1546 | *
1547 | #1 entry.max$ substring$
1548 | 'sort.key$ :=
1549 | }
1550 |
1551 | ITERATE {presort}
1552 | SORT
1553 | STRINGS { last.label next.extra }
1554 | INTEGERS { last.extra.num last.extra.num.extended last.extra.num.blank number.label }
1555 | FUNCTION {initialize.extra.label.stuff}
1556 | { #0 int.to.chr$ 'last.label :=
1557 | "" 'next.extra :=
1558 | #0 'last.extra.num :=
1559 | "a" chr.to.int$ #1 - 'last.extra.num.blank :=
1560 | last.extra.num.blank 'last.extra.num.extended :=
1561 | #0 'number.label :=
1562 | }
1563 | FUNCTION {forward.pass}
1564 | { last.label label =
1565 | { last.extra.num #1 + 'last.extra.num :=
1566 | last.extra.num "z" chr.to.int$ >
1567 | { "a" chr.to.int$ 'last.extra.num :=
1568 | last.extra.num.extended #1 + 'last.extra.num.extended :=
1569 | }
1570 | 'skip$
1571 | if$
1572 | last.extra.num.extended last.extra.num.blank >
1573 | { last.extra.num.extended int.to.chr$
1574 | last.extra.num int.to.chr$
1575 | * 'extra.label := }
1576 | { last.extra.num int.to.chr$ 'extra.label := }
1577 | if$
1578 | }
1579 | { "a" chr.to.int$ 'last.extra.num :=
1580 | "" 'extra.label :=
1581 | label 'last.label :=
1582 | }
1583 | if$
1584 | number.label #1 + 'number.label :=
1585 | }
1586 | FUNCTION {reverse.pass}
1587 | { next.extra "b" =
1588 | { "a" 'extra.label := }
1589 | 'skip$
1590 | if$
1591 | extra.label 'next.extra :=
1592 | extra.label
1593 | duplicate$ empty$
1594 | 'skip$
1595 | { "{\natexlab{" swap$ * "}}" * }
1596 | if$
1597 | 'extra.label :=
1598 | label extra.label * 'label :=
1599 | }
1600 | EXECUTE {initialize.extra.label.stuff}
1601 | ITERATE {forward.pass}
1602 | REVERSE {reverse.pass}
1603 | FUNCTION {bib.sort.order}
1604 | { sort.label
1605 | " "
1606 | *
1607 | year field.or.null sortify
1608 | *
1609 | " "
1610 | *
1611 | title field.or.null
1612 | sort.format.title
1613 | *
1614 | #1 entry.max$ substring$
1615 | 'sort.key$ :=
1616 | }
1617 | ITERATE {bib.sort.order}
1618 | SORT
1619 | FUNCTION {begin.bib}
1620 | { preamble$ empty$
1621 | 'skip$
1622 | { preamble$ write$ newline$ }
1623 | if$
1624 | "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1625 | write$ newline$
1626 | "\newcommand{\enquote}[1]{``#1''}"
1627 | write$ newline$
1628 | "\providecommand{\natexlab}[1]{#1}"
1629 | write$ newline$
1630 | "\providecommand{\url}[1]{\texttt{#1}}"
1631 | write$ newline$
1632 | "\providecommand{\urlprefix}{URL }"
1633 | write$ newline$
1634 | "\expandafter\ifx\csname urlstyle\endcsname\relax"
1635 | write$ newline$
1636 | " \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else"
1637 | write$ newline$
1638 | " \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi"
1639 | write$ newline$
1640 | "\providecommand{\eprint}[2][]{\url{#2}}"
1641 | write$ newline$
1642 | }
1643 | EXECUTE {begin.bib}
1644 | EXECUTE {init.state.consts}
1645 | ITERATE {call.type$}
1646 | FUNCTION {end.bib}
1647 | { newline$
1648 | "\end{thebibliography}" write$ newline$
1649 | }
1650 | EXECUTE {end.bib}
1651 | %% End of customized bst file
1652 | %%
1653 | %% End of file `jss.bst'.
1654 |
--------------------------------------------------------------------------------
/_extensions/jss/jss.cls:
--------------------------------------------------------------------------------
1 | %%
2 | %% This is file `jss.cls',
3 | \def\fileversion{3.3}
4 | \def\filename{jss}
5 | \def\filedate{2021/05/23}
6 | %%
7 | %% Package `jss' to use with LaTeX2e for JSS publications (http://www.jstatsoft.org/)
8 | %% License: GPL-2 | GPL-3
9 | %% Copyright: (C) Achim Zeileis
10 | %% Please report errors to Achim.Zeileis@R-project.org
11 | %%
12 | \NeedsTeXFormat{LaTeX2e}
13 | \ProvidesClass{jss}[\filedate\space\fileversion\space jss class by Achim Zeileis]
14 | %% options
15 | \newif\if@article
16 | \newif\if@codesnippet
17 | \newif\if@bookreview
18 | \newif\if@softwarereview
19 | \newif\if@review
20 | \newif\if@shortnames
21 | \newif\if@nojss
22 | \newif\if@notitle
23 | \newif\if@noheadings
24 | \newif\if@nofooter
25 |
26 | \@articletrue
27 | \@codesnippetfalse
28 | \@bookreviewfalse
29 | \@softwarereviewfalse
30 | \@reviewfalse
31 | \@shortnamesfalse
32 | \@nojssfalse
33 | \@notitlefalse
34 | \@noheadingsfalse
35 | \@nofooterfalse
36 |
37 | \DeclareOption{article}{\@articletrue%
38 | \@codesnippetfalse \@bookreviewfalse \@softwarereviewfalse}
39 | \DeclareOption{codesnippet}{\@articlefalse%
40 | \@codesnippettrue \@bookreviewfalse \@softwarereviewfalse}
41 | \DeclareOption{bookreview}{\@articlefalse%
42 | \@codesnippetfalse \@bookreviewtrue \@softwarereviewfalse}
43 | \DeclareOption{softwarereview}{\@articlefalse%
44 | \@codesnippetfalse \@bookreviewfalse \@softwarereviewtrue}
45 | \DeclareOption{shortnames}{\@shortnamestrue}
46 | \DeclareOption{nojss}{\@nojsstrue}
47 | \DeclareOption{notitle}{\@notitletrue}
48 | \DeclareOption{noheadings}{\@noheadingstrue}
49 | \DeclareOption{nofooter}{\@nofootertrue}
50 |
51 | \ProcessOptions
52 | \LoadClass[11pt,a4paper,twoside]{article}
53 | %% required packages
54 | \RequirePackage{graphicx,xcolor,ae,fancyvrb}
55 | \RequirePackage[T1]{fontenc}
56 | \IfFileExists{upquote.sty}{\RequirePackage{upquote}}{}
57 | \IfFileExists{lmodern.sty}{\RequirePackage{lmodern}}{}
58 | %% bibliography
59 | \if@shortnames
60 | \usepackage[authoryear,round]{natbib}
61 | \else
62 | \usepackage[authoryear,round,longnamesfirst]{natbib}
63 | \fi
64 | \bibpunct{(}{)}{;}{a}{}{,}
65 | \bibliographystyle{jss}
66 | %% page layout
67 | \topmargin 0pt
68 | \textheight 46\baselineskip
69 | \advance\textheight by \topskip
70 | \oddsidemargin 0.1in
71 | \evensidemargin 0.15in
72 | \marginparwidth 1in
73 | \oddsidemargin 0.125in
74 | \evensidemargin 0.125in
75 | \marginparwidth 0.75in
76 | \textwidth 6.125in
77 | %% paragraphs
78 | \setlength{\parskip}{0.7ex plus0.1ex minus0.1ex}
79 | \setlength{\parindent}{0em}
80 | %% for all publications
81 | \newcommand{\Address}[1]{\def\@Address{#1}}
82 | \newcommand{\Plaintitle}[1]{\def\@Plaintitle{#1}}
83 | \newcommand{\Shorttitle}[1]{\def\@Shorttitle{#1}}
84 | \newcommand{\Plainauthor}[1]{\def\@Plainauthor{#1}}
85 | \newcommand{\Volume}[1]{\def\@Volume{#1}}
86 | \newcommand{\Year}[1]{\def\@Year{#1}}
87 | \newcommand{\Month}[1]{\def\@Month{#1}}
88 | \newcommand{\Issue}[1]{\def\@Issue{#1}}
89 | \newcommand{\Submitdate}[1]{\def\@Submitdate{#1}}
90 | %% for articles and code snippets
91 | \newcommand{\Acceptdate}[1]{\def\@Acceptdate{#1}}
92 | \newcommand{\Abstract}[1]{\def\@Abstract{#1}}
93 | \newcommand{\Keywords}[1]{\def\@Keywords{#1}}
94 | \newcommand{\Plainkeywords}[1]{\def\@Plainkeywords{#1}}
95 | %% for book and software reviews
96 | \newcommand{\Reviewer}[1]{\def\@Reviewer{#1}}
97 | \newcommand{\Booktitle}[1]{\def\@Booktitle{#1}}
98 | \newcommand{\Bookauthor}[1]{\def\@Bookauthor{#1}}
99 | \newcommand{\Publisher}[1]{\def\@Publisher{#1}}
100 | \newcommand{\Pubaddress}[1]{\def\@Pubaddress{#1}}
101 | \newcommand{\Pubyear}[1]{\def\@Pubyear{#1}}
102 | \newcommand{\ISBN}[1]{\def\@ISBN{#1}}
103 | \newcommand{\Pages}[1]{\def\@Pages{#1}}
104 | \newcommand{\Price}[1]{\def\@Price{#1}}
105 | \newcommand{\Plainreviewer}[1]{\def\@Plainreviewer{#1}}
106 | \newcommand{\Softwaretitle}[1]{\def\@Softwaretitle{#1}}
107 | \newcommand{\URL}[1]{\def\@URL{#1}}
108 | \newcommand{\DOI}[1]{\def\@DOI{#1}}
109 | %% for internal use
110 | \newcommand{\Seriesname}[1]{\def\@Seriesname{#1}}
111 | \newcommand{\Hypersubject}[1]{\def\@Hypersubject{#1}}
112 | \newcommand{\Hyperauthor}[1]{\def\@Hyperauthor{#1}}
113 | \newcommand{\Footername}[1]{\def\@Footername{#1}}
114 | \newcommand{\Firstdate}[1]{\def\@Firstdate{#1}}
115 | \newcommand{\Seconddate}[1]{\def\@Seconddate{#1}}
116 | \newcommand{\Reviewauthor}[1]{\def\@Reviewauthor{#1}}
117 | %% defaults
118 | \author{Firstname Lastname\\Affiliation}
119 | \title{Title}
120 | \Abstract{---!!!---an abstract is required---!!!---}
121 | \Plainauthor{\@author}
122 | \Volume{VV}
123 | \Year{YYYY}
124 | \Month{MMMMMM}
125 | \Issue{II}
126 | \Submitdate{yyyy-mm-dd}
127 | \Acceptdate{yyyy-mm-dd}
128 | \Address{
129 | Firstname Lastname\\
130 | Affiliation\\
131 | Address, Country\\
132 | E-mail: \email{name@address}\\
133 | URL: \url{http://link/to/webpage/}
134 | }
135 |
136 | \Reviewer{Firstname Lastname\\Affiliation}
137 | \Plainreviewer{Firstname Lastname}
138 | \Booktitle{Book Title}
139 | \Bookauthor{Book Author}
140 | \Publisher{Publisher}
141 | \Pubaddress{Publisher's Address}
142 | \Pubyear{YYY}
143 | \ISBN{x-xxxxx-xxx-x}
144 | \Pages{xv + 123}
145 | \Price{USD 69.95 (P)}
146 | \URL{http://link/to/webpage/}
147 | \DOI{10.18637/jss.v000.i00}
148 | \if@article
149 | \Seriesname{Issue}
150 | \Hypersubject{Journal of Statistical Software}
151 | \Plaintitle{\@title}
152 | \Shorttitle{\@title}
153 | \Plainkeywords{\@Keywords}
154 | \fi
155 |
156 | \if@codesnippet
157 | \Seriesname{Code Snippet}
158 | \Hypersubject{Journal of Statistical Software -- Code Snippets}
159 | \Plaintitle{\@title}
160 | \Shorttitle{\@title}
161 | \Plainkeywords{\@Keywords}
162 | \fi
163 |
164 | \if@bookreview
165 | \Seriesname{Book Review}
166 | \Hypersubject{Journal of Statistical Software -- Book Reviews}
167 | \Plaintitle{\@Booktitle}
168 | \Shorttitle{\@Booktitle}
169 | \Reviewauthor{\@Bookauthor\\
170 | \@Publisher, \@Pubaddress, \@Pubyear.\\
171 | ISBN~\@ISBN. \@Pages~pp. \@Price.\\
172 | \url{\@URL}}
173 | \Plainkeywords{}
174 | \@reviewtrue
175 | \fi
176 |
177 | \if@softwarereview
178 | \Seriesname{Software Review}
179 | \Hypersubject{Journal of Statistical Software -- Software Reviews}
180 | \Plaintitle{\@Softwaretitle}
181 | \Shorttitle{\@Softwaretitle}
182 | \Booktitle{\@Softwaretitle}
183 | \Reviewauthor{\@Publisher, \@Pubaddress. \@Price.\\
184 | \url{\@URL}}
185 | \Plainkeywords{}
186 | \@reviewtrue
187 | \fi
188 |
189 | \if@review
190 | \Hyperauthor{\@Plainreviewer}
191 | \Keywords{}
192 | \Footername{Reviewer}
193 | \Firstdate{\textit{Published:} \@Submitdate}
194 | \Seconddate{}
195 | \else
196 | \Hyperauthor{\@Plainauthor}
197 | \Keywords{---!!!---at least one keyword is required---!!!---}
198 | \Footername{Affiliation}
199 | \Firstdate{\textit{Submitted:} \@Submitdate}
200 | \Seconddate{\textit{Accepted:} \@Acceptdate}
201 | \fi
202 | %% Sweave(-like)
203 | \DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl}
204 | \DefineVerbatimEnvironment{Soutput}{Verbatim}{}
205 | \DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl}
206 | \newenvironment{Schunk}{}{}
207 | \DefineVerbatimEnvironment{Code}{Verbatim}{}
208 | \DefineVerbatimEnvironment{CodeInput}{Verbatim}{fontshape=sl}
209 | \DefineVerbatimEnvironment{CodeOutput}{Verbatim}{}
210 | \newenvironment{CodeChunk}{}{}
211 | \setkeys{Gin}{width=0.8\textwidth}
212 | %% footer
213 | \newlength{\footerskip}
214 | \setlength{\footerskip}{2.5\baselineskip plus 2ex minus 0.5ex}
215 |
216 | \newcommand{\makefooter}{%
217 | \vspace{\footerskip}
218 |
219 | \if@nojss
220 | \begin{samepage}
221 | \textbf{\large \@Footername: \nopagebreak}\\[.3\baselineskip] \nopagebreak
222 | \@Address \nopagebreak
223 | \end{samepage}
224 | \else
225 | \begin{samepage}
226 | \textbf{\large \@Footername: \nopagebreak}\\[.3\baselineskip] \nopagebreak
227 | \@Address \nopagebreak
228 | \vfill
229 | \hrule \nopagebreak
230 | \vspace{.1\baselineskip}
231 | {\fontfamily{pzc} \fontsize{13}{15} \selectfont Journal of Statistical Software}
232 | \hfill
233 | \url{http://www.jstatsoft.org/}\\ \nopagebreak
234 | published by the Foundation for Open Access Statistics
235 | \hfill
236 | \url{http://www.foastat.org/}\\[.3\baselineskip] \nopagebreak
237 | {\@Month{} \@Year, Volume~\@Volume, \@Seriesname~\@Issue}
238 | \hfill
239 | \@Firstdate\\ \nopagebreak
240 | {\href{https://doi.org/\@DOI}{\tt doi:\@DOI}}
241 | \hfill
242 | \@Seconddate \nopagebreak
243 | \vspace{.3\baselineskip}
244 | \hrule
245 | \end{samepage}
246 | \fi
247 | }
248 | \if@nofooter
249 | %% \AtEndDocument{\makefooter}
250 | \else
251 | \AtEndDocument{\makefooter}
252 | \fi
253 | %% required packages
254 | \RequirePackage{hyperref}
255 | %% new \maketitle
256 | \def\@myoddhead{
257 | {\color{white} JSS}\\[-1.42cm]
258 | \hspace{-2em} \includegraphics[height=23mm,keepaspectratio]{jsslogo} \hfill
259 | \parbox[b][23mm]{118mm}{\hrule height 3pt
260 | \center{
261 | {\fontfamily{pzc} \fontsize{28}{32} \selectfont Journal of Statistical Software}
262 | \vfill
263 | {\it \small \@Month{} \@Year, Volume~\@Volume, \@Seriesname~\@Issue.%
264 | \hfill \href{https://doi.org/\@DOI}{doi:\,\@DOI}}}\\[0.1cm]
265 | \hrule height 3pt}}
266 | \if@review
267 | \renewcommand{\maketitle}{
268 | \if@nojss
269 | %% \@oddhead{\@myoddhead}\\[3\baselineskip]
270 | \else
271 | \@oddhead{\@myoddhead}\\[3\baselineskip]
272 | \fi
273 | {\large
274 | \noindent
275 | Reviewer: \@Reviewer
276 | \vspace{\baselineskip}
277 | \hrule
278 | \vspace{\baselineskip}
279 | \textbf{\@Booktitle}
280 | \begin{quotation} \noindent
281 | \@Reviewauthor
282 | \end{quotation}
283 | \vspace{0.7\baselineskip}
284 | \hrule
285 | \vspace{1.3\baselineskip}
286 | }
287 |
288 | \thispagestyle{empty}
289 | \if@nojss
290 | \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hyperauthor}}
291 | \else
292 | \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}}
293 | \fi
294 | \pagestyle{myheadings}
295 | }
296 | \else
297 | \def\maketitle{
298 | \if@nojss
299 | %% \@oddhead{\@myoddhead} \par
300 | \else
301 | \@oddhead{\@myoddhead} \par
302 | \fi
303 | \begingroup
304 | \def\thefootnote{\fnsymbol{footnote}}
305 | \def\@makefnmark{\hbox to 0pt{$^{\@thefnmark}$\hss}}
306 | \long\def\@makefntext##1{\parindent 1em\noindent
307 | \hbox to1.8em{\hss $\m@th ^{\@thefnmark}$}##1}
308 | \@maketitle \@thanks
309 | \endgroup
310 | \setcounter{footnote}{0}
311 |
312 | \if@noheadings
313 | %% \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}}
314 | \else
315 | \thispagestyle{empty}
316 | \if@nojss
317 | \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hyperauthor}}
318 | \else
319 | \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}}
320 | \fi
321 | \pagestyle{myheadings}
322 | \fi
323 |
324 | \let\maketitle\relax \let\@maketitle\relax
325 | \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax
326 | }
327 |
328 | \def\@maketitle{\vbox{\hsize\textwidth \linewidth\hsize
329 | \if@nojss
330 | %% \vskip 1in
331 | \else
332 | \vskip 1in
333 | \fi
334 | {\centering
335 | {\LARGE\bf \@title\par}
336 | \vskip 0.2in plus 1fil minus 0.1in
337 | {
338 | \def\and{\unskip\enspace{\rm and}\enspace}%
339 | \def\And{\end{tabular}\hss \egroup \hskip 1in plus 2fil
340 | \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\ignorespaces}%
341 | \def\AND{\end{tabular}\hss\egroup \hfil\hfil\egroup
342 | \vskip 0.1in plus 1fil minus 0.05in
343 | \hbox to \linewidth\bgroup\rule{\z@}{10pt} \hfil\hfil
344 | \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\ignorespaces}
345 | \hbox to \linewidth\bgroup\rule{\z@}{10pt} \hfil\hfil
346 | \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\@author
347 | \end{tabular}\hss\egroup
348 | \hfil\hfil\egroup}
349 | \vskip 0.3in minus 0.1in
350 | \hrule
351 | \begin{abstract}
352 | \@Abstract
353 | \end{abstract}}
354 | \textit{Keywords}:~\@Keywords.
355 | \vskip 0.1in minus 0.05in
356 | \hrule
357 | \vskip 0.2in minus 0.1in
358 | }}
359 | \fi
360 | %% sections, subsections, and subsubsections
361 | \newlength{\preXLskip}
362 | \newlength{\preLskip}
363 | \newlength{\preMskip}
364 | \newlength{\preSskip}
365 | \newlength{\postMskip}
366 | \newlength{\postSskip}
367 | \setlength{\preXLskip}{1.8\baselineskip plus 0.5ex minus 0ex}
368 | \setlength{\preLskip}{1.5\baselineskip plus 0.3ex minus 0ex}
369 | \setlength{\preMskip}{1\baselineskip plus 0.2ex minus 0ex}
370 | \setlength{\preSskip}{.8\baselineskip plus 0.2ex minus 0ex}
371 | \setlength{\postMskip}{.5\baselineskip plus 0ex minus 0.1ex}
372 | \setlength{\postSskip}{.3\baselineskip plus 0ex minus 0.1ex}
373 |
374 | \newcommand{\jsssec}[2][default]{\vskip \preXLskip%
375 | \pdfbookmark[1]{#1}{Section.\thesection.#1}%
376 | \refstepcounter{section}%
377 | \centerline{\textbf{\Large \thesection. #2}} \nopagebreak
378 | \vskip \postMskip \nopagebreak}
379 | \newcommand{\jsssecnn}[1]{\vskip \preXLskip%
380 | \centerline{\textbf{\Large #1}} \nopagebreak
381 | \vskip \postMskip \nopagebreak}
382 |
383 | \newcommand{\jsssubsec}[2][default]{\vskip \preMskip%
384 | \pdfbookmark[2]{#1}{Subsection.\thesubsection.#1}%
385 | \refstepcounter{subsection}%
386 | \textbf{\large \thesubsection. #2} \nopagebreak
387 | \vskip \postSskip \nopagebreak}
388 | \newcommand{\jsssubsecnn}[1]{\vskip \preMskip%
389 | \textbf{\large #1} \nopagebreak
390 | \vskip \postSskip \nopagebreak}
391 |
392 | \newcommand{\jsssubsubsec}[2][default]{\vskip \preSskip%
393 | \pdfbookmark[3]{#1}{Subsubsection.\thesubsubsection.#1}%
394 | \refstepcounter{subsubsection}%
395 | {\large \textit{#2}} \nopagebreak
396 | \vskip \postSskip \nopagebreak}
397 | \newcommand{\jsssubsubsecnn}[1]{\vskip \preSskip%
398 | {\textit{\large #1}} \nopagebreak
399 | \vskip \postSskip \nopagebreak}
400 |
401 | \newcommand{\jsssimplesec}[2][default]{\vskip \preLskip%
402 | %% \pdfbookmark[1]{#1}{Section.\thesection.#1}%
403 | \refstepcounter{section}%
404 | \textbf{\large #1} \nopagebreak
405 | \vskip \postSskip \nopagebreak}
406 | \newcommand{\jsssimplesecnn}[1]{\vskip \preLskip%
407 | \textbf{\large #1} \nopagebreak
408 | \vskip \postSskip \nopagebreak}
409 |
410 | \if@review
411 | \renewcommand{\section}{\secdef \jsssimplesec \jsssimplesecnn}
412 | \renewcommand{\subsection}{\secdef \jsssimplesec \jsssimplesecnn}
413 | \renewcommand{\subsubsection}{\secdef \jsssimplesec \jsssimplesecnn}
414 | \else
415 | \renewcommand{\section}{\secdef \jsssec \jsssecnn}
416 | \renewcommand{\subsection}{\secdef \jsssubsec \jsssubsecnn}
417 | \renewcommand{\subsubsection}{\secdef \jsssubsubsec \jsssubsubsecnn}
418 | \fi
419 | %% colors
420 | \definecolor{Red}{rgb}{0.5,0,0}
421 | \definecolor{Blue}{rgb}{0,0,0.5}
422 | \if@review
423 | \hypersetup{%
424 | hyperindex = {true},
425 | colorlinks = {true},
426 | linktocpage = {true},
427 | plainpages = {false},
428 | linkcolor = {Blue},
429 | citecolor = {Blue},
430 | urlcolor = {Red},
431 | pdfstartview = {Fit},
432 | pdfpagemode = {None},
433 | pdfview = {XYZ null null null}
434 | }
435 | \else
436 | \hypersetup{%
437 | hyperindex = {true},
438 | colorlinks = {true},
439 | linktocpage = {true},
440 | plainpages = {false},
441 | linkcolor = {Blue},
442 | citecolor = {Blue},
443 | urlcolor = {Red},
444 | pdfstartview = {Fit},
445 | pdfpagemode = {UseOutlines},
446 | pdfview = {XYZ null null null}
447 | }
448 | \fi
449 | \if@nojss
450 | \AtBeginDocument{
451 | \hypersetup{%
452 | pdfauthor = {\@Hyperauthor},
453 | pdftitle = {\@Plaintitle},
454 | pdfkeywords = {\@Plainkeywords}
455 | }
456 | }
457 | \else
458 | \AtBeginDocument{
459 | \hypersetup{%
460 | pdfauthor = {\@Hyperauthor},
461 | pdftitle = {\@Plaintitle},
462 | pdfsubject = {\@Hypersubject},
463 | pdfkeywords = {\@Plainkeywords}
464 | }
465 | }
466 | \fi
467 | \if@notitle
468 | %% \AtBeginDocument{\maketitle}
469 | \else
470 | \@ifundefined{AddToHook}{\AtBeginDocument{\maketitle}}{\AddToHook{begindocument}[maketitle]{\maketitle}}
471 | \fi
472 | %% commands
473 | \newcommand\code{\bgroup\@makeother\_\@makeother\~\@makeother\$\@codex}
474 | \def\@codex#1{{\normalfont\ttfamily\hyphenchar\font=-1 #1}\egroup}
475 | %%\let\code=\texttt
476 | \let\proglang=\textsf
477 | \newcommand{\pkg}[1]{{\fontseries{m}\fontseries{b}\selectfont #1}}
478 | \newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}}
479 | \ifx\csname urlstyle\endcsname\relax
480 | \newcommand\@doi[1]{doi:\discretionary{}{}{}#1}\else
481 | \newcommand\@doi{doi:\discretionary{}{}{}\begingroup
482 | \urlstyle{tt}\Url}\fi
483 | \newcommand{\doi}[1]{\href{https://doi.org/#1}{\normalfont\texttt{\@doi{#1}}}}
484 | \newcommand{\E}{\mathsf{E}}
485 | \newcommand{\VAR}{\mathsf{VAR}}
486 | \newcommand{\COV}{\mathsf{COV}}
487 | \newcommand{\Prob}{\mathsf{P}}
488 | \endinput
489 | %%
490 | %% End of file `jss.cls'.
491 |
--------------------------------------------------------------------------------
/_extensions/jss/jss.lua:
--------------------------------------------------------------------------------
1 | -- these classes, when placed on a span will be replaced
2 | -- with an identical LaTeX command for PDF output
3 | local texMappings = {
4 | "proglang",
5 | "pkg",
6 | "fct",
7 | "class"
8 | }
9 |
10 | -- layout and style
11 | local kTypes = pandoc.List({'article', 'codesnippet', 'bookreview', 'softwarereview'})
12 | local kSuppress = pandoc.List({'title', 'headings', 'footer'})
13 |
14 | local function setClassOption(meta, option)
15 | if meta['classoption'] == nil then
16 | meta['classoption'] = pandoc.List({})
17 | end
18 |
19 | meta['classoption']:insert({ pandoc.Str(option)})
20 | end
21 |
22 | local function printList(list)
23 | local result = ''
24 | local sep = ''
25 | for i,v in ipairs(list) do
26 | result = result .. sep .. v
27 | sep = ', '
28 | end
29 | return result
30 | end
31 |
32 | return {
33 | {
34 | Span = function(el)
35 | -- read the span contents and emit correct output
36 | local contentStr = pandoc.utils.stringify(el.content)
37 |
38 | for i, mapping in ipairs(texMappings) do
39 | if #el.attr.classes == 1 and el.attr.classes:includes(mapping) then
40 | if quarto.doc.is_format("pdf") then
41 | return pandoc.RawInline("tex", "\\" .. mapping .. "{" .. contentStr .. "}" )
42 | else
43 | return pandoc.Code(contentStr);
44 | end
45 | end
46 | end
47 | end,
48 | Meta = function(meta)
49 | if quarto.doc.is_format("pdf") then
50 | -- Authors output in the template uses a special separator
51 | -- to join authors (including wrapping to a new line)
52 | -- this computes the proper prefix and places it in the author metadata
53 | -- for use by the template
54 | local byAuthor = meta['by-author']
55 | if byAuthor ~= nil then
56 | for i, author in ipairs(byAuthor) do
57 | local prefix = {pandoc.RawInline("tex ","")};
58 | if i > 1 and i % 2 == 1 then
59 | prefix = {pandoc.RawInline("tex", "\\AND")}
60 | elseif i > 1 then
61 | prefix = {pandoc.RawInline("tex", "\\And")}
62 | end
63 | author['metadata']['latex-prefix'] = prefix
64 | end
65 | end
66 |
67 | -- read the journal settings
68 | local journal = meta['journal']
69 | local type = nil
70 | local shortnames = nil
71 | local suppress = nil
72 | local jss = nil
73 |
74 | if journal ~= nil then
75 | type = journal['type']
76 | shortnames = journal['cite-shortnames']
77 | suppress = journal['suppress']
78 | jss = journal['include-jss-layout']
79 | end
80 |
81 | -- process the type
82 | if type ~= nil then
83 | type = pandoc.utils.stringify(type)
84 | if kTypes:includes(type) then
85 | setClassOption(meta, type)
86 | else
87 | error("Unknown type " .. type .. "\nPlease use one of " .. printList(kTypes))
88 | end
89 | else
90 | setClassOption(meta, 'article')
91 | end
92 |
93 | -- process the citation variant
94 | if shortnames == true then
95 | setClassOption(meta, 'shortnames')
96 | end
97 |
98 | -- process the suppressed parts
99 | if suppress ~= nil then
100 | for i,v in ipairs(suppress) do
101 | s = pandoc.utils.stringify(v)
102 | if kSuppress:includes(s) then
103 | setClassOption(meta, 'no' .. s)
104 | else
105 | error("Unknown suppressed part " .. s .. "\nPlease use one of " .. printList(kSuppress))
106 | end
107 | end
108 | end
109 |
110 | -- process switch for JSS layout
111 | if jss == false then
112 | setClassOption(meta, 'nojss')
113 | end
114 |
115 | -- make sure there is a plain title
116 | if meta['title'] ~= nil and meta['title-plain'] == nil then
117 | meta['title-plain'] = pandoc.utils.stringify(meta['title'])
118 | end
119 | end
120 |
121 | return meta
122 | end
123 | }
124 | }
--------------------------------------------------------------------------------
/_extensions/jss/jsslogo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/quarto-journals/jss/715e9f007d104c23763cebaf03782b8e80cb5445/_extensions/jss/jsslogo.jpg
--------------------------------------------------------------------------------
/_extensions/jss/partials/_print-address.tex:
--------------------------------------------------------------------------------
1 | $it.name.literal$\\$if(it.affiliations/first)$$for(it.affiliations/first)$$if(it.department)$
2 |
3 | $it.department$\\$endif$$if(it.address)$
4 |
5 | $it.address$\\$endif$$if(it.city)$
6 |
7 | $it.city$$endif$$if(it.state)$ $it.state$$endif$$if(it.country)$ $it.country$$endif$$if(it.city)$\\$elseif(it.state)$\\$elseif(it.country)$\\$endif$$endfor$$endif$$if(it.phone)$
8 |
9 | Telephone: $it.phone$\\$endif$$if(it.fax)$
10 |
11 | Fax: $it.fax$\\$endif$$if(it.email)$
12 |
13 | E-mail: \email{$it.email$}\\$endif$$if(it.url)$
14 |
15 | URL: \url{$it.url$}\\$endif$
16 |
17 | \\~
18 |
19 |
--------------------------------------------------------------------------------
/_extensions/jss/partials/_print-author.tex:
--------------------------------------------------------------------------------
1 | $if(it.metadata.latex-prefix)$ $it.metadata.latex-prefix$ $endif$$it.name.literal$$if(it.orcid)$~\orcidlink{$it.orcid$}$endif$$for(it.affiliations/first)$\\$it.name$$endfor$
--------------------------------------------------------------------------------
/_extensions/jss/partials/before-body.tex:
--------------------------------------------------------------------------------
1 | $if(has-frontmatter)$
2 | \frontmatter
3 | $endif$
4 | $if(title)$
5 | \maketitle
6 | $endif$
7 |
--------------------------------------------------------------------------------
/_extensions/jss/partials/title.tex:
--------------------------------------------------------------------------------
1 | %% -- Article metainformation (author, title, ...) -----------------------------
2 |
3 | %% Author information
4 | \author{$for(by-author)$$_print-author.tex()$$endfor$}
5 | \Plainauthor{$for(by-author)$$it.name.literal$$sep$, $endfor$} %% comma-separated
6 |
7 | \title{$title$}
8 | $if(title-plain)$
9 | \Plaintitle{$title-plain$} %% without formatting
10 | $endif$
11 | $if(short-title)$
12 | \Shorttitle{$short-title$} %% a short title (if necessary)
13 | $endif$
14 |
15 | %% an abstract and keywords
16 | $if(abstract)$
17 | \Abstract{$abstract$}
18 | $endif$
19 |
20 | %% at least one keyword must be supplied
21 | $if(keywords-formatted)$
22 | \Keywords{$for(keywords-formatted)$$it$$sep$, $endfor$}
23 | $endif$
24 | $if(keywords)$
25 | \Plainkeywords{$for(keywords)$$it$$sep$, $endfor$}
26 | $endif$
27 |
28 | %% publication information
29 | %% NOTE: Typically, this can be left commented and will be filled out by the technical editor
30 | %% \Volume{50}
31 | %% \Issue{9}
32 | %% \Month{June}
33 | %% \Year{2012}
34 | %% \Submitdate{2012-06-04}
35 | %% \Acceptdate{2012-06-04}
36 | %% \setcounter{page}{1}
37 | %% \Pages{1--xx}
38 |
39 | %% The address of (at least) one author should be given
40 | %% in the following format:
41 | $if(by-author)$
42 | \Address{
43 | $for(by-author)$$_print-address.tex()$$endfor$
44 | }
45 | $endif$
46 |
--------------------------------------------------------------------------------
/article-visualization.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/quarto-journals/jss/715e9f007d104c23763cebaf03782b8e80cb5445/article-visualization.pdf
--------------------------------------------------------------------------------
/bibliography.bib:
--------------------------------------------------------------------------------
1 | @book{CameronTrivedi2013,
2 | author = {A. Colin Cameron and Pravin K. Trivedi},
3 | title = {Regression Analysis of Count Data},
4 | year = {2013},
5 | edition = {2nd},
6 | publisher = {Cambridge University Press},
7 | address = {Cambridge}
8 | }
9 |
10 | @book{ChambersHastie1992,
11 | editor = {John M. Chambers and Trevor J. Hastie},
12 | title = {Statistical Models in S},
13 | publisher = {Chapman \& Hall},
14 | year = {1992},
15 | address = {London}
16 | }
17 |
18 | @manual{Jackman2015,
19 | title = {pscl: Classes and Methods for R Developed in the Political Science Computational Laboratory, Stanford University},
20 | author = {Simon Jackman},
21 | year = {2015},
22 | note = {R package version 1.4.9},
23 | url = {https://CRAN.R-project.org/package=pscl}
24 | }
25 |
26 | @article{Mullahy1986,
27 | author = {John Mullahy},
28 | title = {Specification and Testing of Some Modified Count Data Models},
29 | year = {1986},
30 | journal = {Journal of Econometrics},
31 | volume = {33},
32 | number = {3},
33 | pages = {341--365},
34 | doi = {10.1016/0304-4076(86)90002-3}
35 | }
36 |
37 | @book{McCullaghNelder1989,
38 | author = {Peter McCullagh and John A. Nelder},
39 | title = {Generalized Linear Models},
40 | edition = {2nd},
41 | year = {1989},
42 | publisher = {Chapman \& Hall},
43 | address = {London},
44 | doi = {10.1007/978-1-4899-3242-6}
45 | }
46 |
47 | @manual{R,
48 | title = {R: {A} Language and Environment for Statistical Computing},
49 | author = {{R Core Team}},
50 | organization = {R Foundation for Statistical Computing},
51 | address = {Vienna, Austria},
52 | year = {2017},
53 | url = {https://www.R-project.org/}
54 | }
55 |
56 | @article{StasinopoulosRigby2007,
57 | author = {D. Mikis Stasinopoulos and Robert A. Rigby},
58 | title = {Generalized Additive Models for Location Scale and Shape ({GAMLSS}) in R},
59 | journal = {Journal of Statistical Software},
60 | year = {2007},
61 | volume = {23},
62 | number = {7},
63 | pages = {1--46},
64 | doi = {10.18637/jss.v023.i07}
65 | }
66 |
67 | @book{VenablesRipley2002,
68 | author = {William N. Venables and Brian D. Ripley},
69 | title = {Modern Applied Statistics with S},
70 | edition = {4th},
71 | year = {2002},
72 | pages = {495},
73 | publisher = {Springer-Verlag},
74 | address = {New York},
75 | doi = {10.1007/978-0-387-21706-2}
76 | }
77 |
78 | @book{Wood2006,
79 | author = {Simon N. Wood},
80 | title = {Generalized Additive Models: An Introduction with R},
81 | year = {2006},
82 | publisher = {Chapman \& Hall/CRC},
83 | address = {Boca Raton}
84 | }
85 |
86 | @article{Yee2009,
87 | author = {Thomas W. Yee},
88 | title = {The VGAM Package for Categorical Data Analysis},
89 | journal = {Journal of Statistical Software},
90 | year = {2010},
91 | volume = {32},
92 | number = {10},
93 | pages = {1--34},
94 | doi = {10.18637/jss.v032.i10}
95 | }
96 |
97 | @article{ZeileisKleiberJackman2008,
98 | author = {Achim Zeileis and Christian Kleiber and Simon Jackman},
99 | title = {Regression Models for Count Data in R},
100 | journal = {Journal of Statistical Software},
101 | year = {2008},
102 | volume = {27},
103 | number = {8},
104 | pages = {1--25},
105 | doi = {10.18637/jss.v027.i08}
106 | }
107 |
--------------------------------------------------------------------------------
/style-guide/article-visualization.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/quarto-journals/jss/715e9f007d104c23763cebaf03782b8e80cb5445/style-guide/article-visualization.pdf
--------------------------------------------------------------------------------
/style-guide/article.R:
--------------------------------------------------------------------------------
1 | ## Package and options
2 | library("MASS")
3 | options(prompt = "R> ", continue = "+ ", width = 70,
4 | useFancyQuotes = FALSE)
5 |
6 |
7 | ## Data
8 | data("quine", package = "MASS")
9 |
10 |
11 | ## Visualization
12 | par(mar = c(4, 4, 1, 1))
13 | plot(table(quine$Days), xlab = "Days", ylab = "Frequency", axes = FALSE)
14 | axis(2)
15 | axis(1, at = 0:16 * 5, labels = FALSE)
16 | axis(1, at = 0:8 * 10)
17 | box()
18 |
19 |
20 | ## Poisson model
21 | m_pois <- glm(Days ~ (Eth + Sex + Age + Lrn)^2, data = quine,
22 | family = poisson)
23 | summary(m_pois)
24 |
25 |
26 | ## Negative binomial model
27 | library("MASS")
28 | m_nbin <- glm.nb(Days ~ (Eth + Sex + Age + Lrn)^2, data = quine)
29 | summary(m_nbin)
30 |
31 |
32 | ## Comparison
33 | BIC(m_pois, m_nbin)
34 |
--------------------------------------------------------------------------------
/style-guide/article.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/quarto-journals/jss/715e9f007d104c23763cebaf03782b8e80cb5445/style-guide/article.pdf
--------------------------------------------------------------------------------
/style-guide/article.tex:
--------------------------------------------------------------------------------
1 | \documentclass[article]{jss}
2 |
3 | %% -- LaTeX packages and custom commands ---------------------------------------
4 |
5 | %% recommended packages
6 | \usepackage{orcidlink,thumbpdf,lmodern}
7 |
8 | %% another package (only for this demo article)
9 | \usepackage{framed}
10 |
11 | %% new custom commands
12 | \newcommand{\class}[1]{`\code{#1}'}
13 | \newcommand{\fct}[1]{\code{#1()}}
14 |
15 |
16 | %% -- Article metainformation (author, title, ...) -----------------------------
17 |
18 | %% - \author{} with primary affiliation (and optionally ORCID link)
19 | %% - \Plainauthor{} without affiliations
20 | %% - Separate authors by \And or \AND (in \author) or by comma (in \Plainauthor).
21 | %% - \AND starts a new line, \And does not.
22 | \author{Achim Zeileis~\orcidlink{0000-0003-0918-3766}\\Universit\"at Innsbruck
23 | \And Second Author\\Plus Affiliation}
24 | \Plainauthor{Achim Zeileis, Second Author}
25 |
26 | %% - \title{} in title case
27 | %% - \Plaintitle{} without LaTeX markup (if any)
28 | %% - \Shorttitle{} with LaTeX markup (if any), used as running title
29 | \title{A Short Demo Article: Regression Models for Count Data in \proglang{R}}
30 | \Plaintitle{A Short Demo Article: Regression Models for Count Data in R}
31 | \Shorttitle{A Short Demo Article in \proglang{R}}
32 |
33 | %% - \Abstract{} almost as usual
34 | \Abstract{
35 | This short article illustrates how to write a manuscript for the
36 | \emph{Journal of Statistical Software} (JSS) using its {\LaTeX} style files.
37 | Generally, we ask to follow JSS's style guide and FAQs precisely. Also,
38 | it is recommended to keep the {\LaTeX} code as simple as possible,
39 | i.e., avoid inclusion of packages/commands that are not necessary.
40 | For outlining the typical structure of a JSS article some brief text snippets
41 | are employed that have been inspired by \cite{Zeileis+Kleiber+Jackman:2008},
42 | discussing count data regression in \proglang{R}. Editorial comments and
43 | instructions are marked by vertical bars.
44 | }
45 |
46 | %% - \Keywords{} with LaTeX markup, at least one required
47 | %% - \Plainkeywords{} without LaTeX markup (if necessary)
48 | %% - Should be comma-separated and in sentence case.
49 | \Keywords{JSS, style guide, comma-separated, not capitalized, \proglang{R}}
50 | \Plainkeywords{JSS, style guide, comma-separated, not capitalized, R}
51 |
52 | %% - \Address{} of at least one author
53 | %% - May contain multiple affiliations for each author
54 | %% (in extra lines, separated by \emph{and}\\).
55 | %% - May contain multiple authors for the same affiliation
56 | %% (in the same first line, separated by comma).
57 | \Address{
58 | Achim Zeileis\\
59 | Journal of Statistical Software\\
60 | \emph{and}\\
61 | Department of Statistics\\
62 | Faculty of Economics and Statistics\\
63 | Universit\"at Innsbruck\\
64 | Universit\"atsstr.~15\\
65 | 6020 Innsbruck, Austria\\
66 | E-mail: \email{Achim.Zeileis@R-project.org}\\
67 | URL: \url{https://www.zeileis.org/}
68 | }
69 |
70 | \begin{document}
71 |
72 |
73 | %% -- Introduction -------------------------------------------------------------
74 |
75 | %% - In principle "as usual".
76 | %% - But should typically have some discussion of both _software_ and _methods_.
77 | %% - Use \proglang{}, \pkg{}, and \code{} markup throughout the manuscript.
78 | %% - If such markup is in (sub)section titles, a plain text version has to be
79 | %% added as well.
80 | %% - All software mentioned should be properly \cite-d.
81 | %% - All abbreviations should be introduced.
82 | %% - Unless the expansions of abbreviations are proper names (like "Journal
83 | %% of Statistical Software" above) they should be in sentence case (like
84 | %% "generalized linear models" below).
85 |
86 | \section[Introduction: Count data regression in R]{Introduction: Count data regression in \proglang{R}} \label{sec:intro}
87 |
88 | \begin{leftbar}
89 | The introduction is in principle ``as usual''. However, it should usually embed
90 | both the implemented \emph{methods} and the \emph{software} into the respective
91 | relevant literature. For the latter both competing and complementary software
92 | should be discussed (within the same software environment and beyond), bringing
93 | out relative (dis)advantages. All software mentioned should be properly
94 | \verb|\cite{}|d. (See also Appendix~\ref{app:bibtex} for more details on
95 | \textsc{Bib}{\TeX}.)
96 |
97 | For writing about software JSS requires authors to use the markup
98 | \verb|\proglang{}| (programming languages and large programmable systems),
99 | \verb|\pkg{}| (software packages), \verb|\code{}| (functions, commands,
100 | arguments, etc.). If there is such markup in (sub)section titles (as above), a
101 | plain text version has to be provided in the {\LaTeX} command as well. Below we
102 | also illustrate how abbrevations should be introduced and citation commands can
103 | be employed. See the {\LaTeX} code for more details.
104 | \end{leftbar}
105 |
106 | Modeling count variables is a common task in economics and the social sciences.
107 | The classical Poisson regression model for count data is often of limited use in
108 | these disciplines because empirical count data sets typically exhibit
109 | overdispersion and/or an excess number of zeros. The former issue can be
110 | addressed by extending the plain Poisson regression model in various
111 | directions: e.g., using sandwich covariances or estimating an additional
112 | dispersion parameter (in a so-called quasi-Poisson model). Another more formal
113 | way is to use a negative binomial (NB) regression. All of these models belong to
114 | the family of generalized linear models (GLMs). However, although these models
115 | typically can capture overdispersion rather well, they are in many applications
116 | not sufficient for modeling excess zeros. Since \cite{Mullahy:1986} there is
117 | increased interest in zero-augmented models that address this issue by a second
118 | model component capturing zero counts. An overview of count data models in
119 | econometrics, including hurdle and zero-inflated models, is provided in
120 | \cite{Cameron+Trivedi:2013}.
121 |
122 | In \proglang{R} \citep{R}, GLMs are provided by the model fitting functions
123 | \fct{glm} in the \pkg{stats} package and \fct{glm.nb} in the \pkg{MASS} package
124 | \citep[][Chapter~7.4]{Venables+Ripley:2002} along with associated methods for
125 | diagnostics and inference. The manuscript that this document is based on
126 | \citep{Zeileis+Kleiber+Jackman:2008} then introduced hurdle and zero-inflated
127 | count models in the functions \fct{hurdle} and \fct{zeroinfl} in the \pkg{pscl}
128 | package \citep{Jackman:2015}. Of course, much more software could be discussed
129 | here, including (but not limited to) generalized additive models for count data
130 | as available in the \proglang{R} packages \pkg{mgcv} \cite{Wood:2006},
131 | \pkg{gamlss} \citep{Stasinopoulos+Rigby:2007}, or \pkg{VGAM} \citep{Yee:2009}.
132 |
133 |
134 | %% -- Manuscript ---------------------------------------------------------------
135 |
136 | %% - In principle "as usual" again.
137 | %% - When using equations (e.g., {equation}, {eqnarray}, {align}, etc.
138 | %% avoid empty lines before and after the equation (which would signal a new
139 | %% paragraph.
140 | %% - When describing longer chunks of code that are _not_ meant for execution
141 | %% (e.g., a function synopsis or list of arguments), the environment {Code}
142 | %% is recommended. Alternatively, a plain {verbatim} can also be used.
143 | %% (For executed code see the next section.)
144 |
145 | \section{Models and software} \label{sec:models}
146 |
147 | The basic Poisson regression model for count data is a special case of the GLM
148 | framework \cite{McCullagh+Nelder:1989}. It describes the dependence of a count
149 | response variable $y_i$ ($i = 1, \dots, n$) by assuming a Poisson distribution
150 | $y_i \sim \mathrm{Pois}(\mu_i)$. The dependence of the conditional mean
151 | $\E[y_i \, | \, x_i] = \mu_i$ on the regressors $x_i$ is then specified via a
152 | log link and a linear predictor
153 | %
154 | \begin{equation} \label{eq:mean}
155 | \log(\mu_i) \quad = \quad x_i^\top \beta,
156 | \end{equation}
157 | %
158 | where the regression coefficients $\beta$ are estimated by maximum likelihood
159 | (ML) using the iterative weighted least squares (IWLS) algorithm.
160 |
161 | \begin{leftbar}
162 | Note that around the \verb|{equation}| above there should be no spaces (avoided
163 | in the {\LaTeX} code by \verb|%| lines) so that ``normal'' spacing is used and
164 | not a new paragraph started.
165 | \end{leftbar}
166 |
167 | \proglang{R} provides a very flexible implementation of the general GLM
168 | framework in the function \fct{glm} \citep{Chambers+Hastie:1992} in the
169 | \pkg{stats} package. Its most important arguments are
170 | \begin{Code}
171 | glm(formula, data, subset, na.action, weights, offset,
172 | family = gaussian, start = NULL, control = glm.control(...),
173 | model = TRUE, y = TRUE, x = FALSE, ...)
174 | \end{Code}
175 | where \code{formula} plus \code{data} is the now standard way of specifying
176 | regression relationships in \proglang{R}/\proglang{S} introduced in
177 | \cite{Chambers+Hastie:1992}. The remaining arguments in the first line
178 | (\code{subset}, \code{na.action}, \code{weights}, and \code{offset}) are also
179 | standard for setting up formula-based regression models in
180 | \proglang{R}/\proglang{S}. The arguments in the second line control aspects
181 | specific to GLMs while the arguments in the last line specify which components
182 | are returned in the fitted model object (of class \class{glm} which inherits
183 | from \class{lm}). For further arguments to \fct{glm} (including alternative
184 | specifications of starting values) see \code{?glm}. For estimating a Poisson
185 | model \code{family = poisson} has to be specified.
186 |
187 | \begin{leftbar}
188 | As the synopsis above is a code listing that is not meant to be executed,
189 | one can use either the dedicated \verb|{Code}| environment or a simple
190 | \verb|{verbatim}| environment for this. Again, spaces before and after should be
191 | avoided.
192 |
193 | Finally, there might be a reference to a \verb|{table}| such as
194 | Table~\ref{tab:overview}. Usually, these are placed at the top of the page
195 | (\verb|[t!]|), centered (\verb|\centering|), with a caption below the table,
196 | column headers and captions in sentence style, and if possible avoiding vertical
197 | lines.
198 | \end{leftbar}
199 |
200 | \begin{table}[t!]
201 | \centering
202 | \begin{tabular}{lllp{7.4cm}}
203 | \hline
204 | Type & Distribution & Method & Description \\ \hline
205 | GLM & Poisson & ML & Poisson regression: classical GLM,
206 | estimated by maximum likelihood (ML) \\
207 | & & Quasi & ``Quasi-Poisson regression'':
208 | same mean function, estimated by
209 | quasi-ML (QML) or equivalently
210 | generalized estimating equations (GEE),
211 | inference adjustment via estimated
212 | dispersion parameter \\
213 | & & Adjusted & ``Adjusted Poisson regression'':
214 | same mean function, estimated by
215 | QML/GEE, inference adjustment via
216 | sandwich covariances\\
217 | & NB & ML & NB regression: extended GLM,
218 | estimated by ML including additional
219 | shape parameter \\ \hline
220 | Zero-augmented & Poisson & ML & Zero-inflated Poisson (ZIP),
221 | hurdle Poisson \\
222 | & NB & ML & Zero-inflated NB (ZINB),
223 | hurdle NB \\ \hline
224 | \end{tabular}
225 | \caption{\label{tab:overview} Overview of various count regression models. The
226 | table is usually placed at the top of the page (\texttt{[t!]}), centered
227 | (\texttt{centering}), has a caption below the table, column headers and captions
228 | are in sentence style, and if possible vertical lines should be avoided.}
229 | \end{table}
230 |
231 |
232 | %% -- Illustrations ------------------------------------------------------------
233 |
234 | %% - Virtually all JSS manuscripts list source code along with the generated
235 | %% output. The style files provide dedicated environments for this.
236 | %% - In R, the environments {Sinput} and {Soutput} - as produced by Sweave() or
237 | %% or knitr using the render_sweave() hook - are used (without the need to
238 | %% load Sweave.sty).
239 | %% - Equivalently, {CodeInput} and {CodeOutput} can be used.
240 | %% - The code input should use "the usual" command prompt in the respective
241 | %% software system.
242 | %% - For R code, the prompt "R> " should be used with "+ " as the
243 | %% continuation prompt.
244 | %% - Comments within the code chunks should be avoided - these should be made
245 | %% within the regular LaTeX text.
246 |
247 | \section{Illustrations} \label{sec:illustrations}
248 |
249 | For a simple illustration of basic Poisson and NB count regression the
250 | \code{quine} data from the \pkg{MASS} package is used. This provides the number
251 | of \code{Days} that children were absent from school in Australia in a
252 | particular year, along with several covariates that can be employed as regressors.
253 | The data can be loaded by
254 | %
255 | \begin{CodeChunk}
256 | \begin{CodeInput}
257 | R> data("quine", package = "MASS")
258 | \end{CodeInput}
259 | \end{CodeChunk}
260 | %
261 | and a basic frequency distribution of the response variable is displayed in
262 | Figure~\ref{fig:quine}.
263 |
264 | \begin{leftbar}
265 | For code input and output, the style files provide dedicated environments.
266 | Either the ``agnostic'' \verb|{CodeInput}| and \verb|{CodeOutput}| can be used
267 | or, equivalently, the environments \verb|{Sinput}| and \verb|{Soutput}| as
268 | produced by \fct{Sweave} or \pkg{knitr} when using the \code{render_sweave()}
269 | hook. Please make sure that all code is properly spaced, e.g., using
270 | \code{y = a + b * x} and \emph{not} \code{y=a+b*x}. Moreover, code input should
271 | use ``the usual'' command prompt in the respective software system. For
272 | \proglang{R} code, the prompt \code{"R> "} should be used with \code{"+ "} as
273 | the continuation prompt. Generally, comments within the code chunks should be
274 | avoided -- and made in the regular {\LaTeX} text instead. Finally, empty lines
275 | before and after code input/output should be avoided (see above).
276 | \end{leftbar}
277 |
278 | \begin{figure}[t!]
279 | \centering
280 | \includegraphics{article-visualization}
281 | \caption{\label{fig:quine} Frequency distribution for number of days absent
282 | from school.}
283 | \end{figure}
284 |
285 | As a first model for the \code{quine} data, we fit the basic Poisson regression
286 | model. (Note that JSS prefers when the second line of code is indented by two
287 | spaces.)
288 | %
289 | \begin{CodeChunk}
290 | \begin{CodeInput}
291 | R> m_pois <- glm(Days ~ (Eth + Sex + Age + Lrn)^2, data = quine,
292 | + family = poisson)
293 | \end{CodeInput}
294 | \end{CodeChunk}
295 | %
296 | To account for potential overdispersion we also consider a negative binomial
297 | GLM.
298 | %
299 | \begin{CodeChunk}
300 | \begin{CodeInput}
301 | R> library("MASS")
302 | R> m_nbin <- glm.nb(Days ~ (Eth + Sex + Age + Lrn)^2, data = quine)
303 | \end{CodeInput}
304 | \end{CodeChunk}
305 | %
306 | In a comparison with the BIC the latter model is clearly preferred.
307 | %
308 | \begin{CodeChunk}
309 | \begin{CodeInput}
310 | R> BIC(m_pois, m_nbin)
311 | \end{CodeInput}
312 | \begin{CodeOutput}
313 | df BIC
314 | m_pois 18 2046.851
315 | m_nbin 19 1157.235
316 | \end{CodeOutput}
317 | \end{CodeChunk}
318 | %
319 | Hence, the full summary of that model is shown below.
320 | %
321 | \begin{CodeChunk}
322 | \begin{CodeInput}
323 | R> summary(m_nbin)
324 | \end{CodeInput}
325 | \begin{CodeOutput}
326 | Call:
327 | glm.nb(formula = Days ~ (Eth + Sex + Age + Lrn)^2, data = quine,
328 | init.theta = 1.60364105, link = log)
329 |
330 | Deviance Residuals:
331 | Min 1Q Median 3Q Max
332 | -3.0857 -0.8306 -0.2620 0.4282 2.0898
333 |
334 | Coefficients: (1 not defined because of singularities)
335 | Estimate Std. Error z value Pr(>|z|)
336 | (Intercept) 3.00155 0.33709 8.904 < 2e-16 ***
337 | EthN -0.24591 0.39135 -0.628 0.52977
338 | SexM -0.77181 0.38021 -2.030 0.04236 *
339 | AgeF1 -0.02546 0.41615 -0.061 0.95121
340 | AgeF2 -0.54884 0.54393 -1.009 0.31296
341 | AgeF3 -0.25735 0.40558 -0.635 0.52574
342 | LrnSL 0.38919 0.48421 0.804 0.42153
343 | EthN:SexM 0.36240 0.29430 1.231 0.21818
344 | EthN:AgeF1 -0.70000 0.43646 -1.604 0.10876
345 | EthN:AgeF2 -1.23283 0.42962 -2.870 0.00411 **
346 | EthN:AgeF3 0.04721 0.44883 0.105 0.91622
347 | EthN:LrnSL 0.06847 0.34040 0.201 0.84059
348 | SexM:AgeF1 0.02257 0.47360 0.048 0.96198
349 | SexM:AgeF2 1.55330 0.51325 3.026 0.00247 **
350 | SexM:AgeF3 1.25227 0.45539 2.750 0.00596 **
351 | SexM:LrnSL 0.07187 0.40805 0.176 0.86019
352 | AgeF1:LrnSL -0.43101 0.47948 -0.899 0.36870
353 | AgeF2:LrnSL 0.52074 0.48567 1.072 0.28363
354 | AgeF3:LrnSL NA NA NA NA
355 | ---
356 | Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
357 |
358 | (Dispersion parameter for Negative Binomial(1.6036) family taken to be 1)
359 |
360 | Null deviance: 235.23 on 145 degrees of freedom
361 | Residual deviance: 167.53 on 128 degrees of freedom
362 | AIC: 1100.5
363 |
364 | Number of Fisher Scoring iterations: 1
365 |
366 |
367 | Theta: 1.604
368 | Std. Err.: 0.214
369 |
370 | 2 x log-likelihood: -1062.546
371 | \end{CodeOutput}
372 | \end{CodeChunk}
373 |
374 |
375 |
376 | %% -- Summary/conclusions/discussion -------------------------------------------
377 |
378 | \section{Summary and discussion} \label{sec:summary}
379 |
380 | \begin{leftbar}
381 | As usual \dots
382 | \end{leftbar}
383 |
384 |
385 | %% -- Optional special unnumbered sections -------------------------------------
386 |
387 | \section*{Computational details}
388 |
389 | \begin{leftbar}
390 | If necessary or useful, information about certain computational details
391 | such as version numbers, operating systems, or compilers could be included
392 | in an unnumbered section. Also, auxiliary packages (say, for visualizations,
393 | maps, tables, \dots) that are not cited in the main text can be credited here.
394 | \end{leftbar}
395 |
396 | The results in this paper were obtained using
397 | \proglang{R}~3.4.1 with the
398 | \pkg{MASS}~7.3.47 package. \proglang{R} itself
399 | and all packages used are available from the Comprehensive
400 | \proglang{R} Archive Network (CRAN) at
401 | \url{https://CRAN.R-project.org/}.
402 |
403 |
404 | \section*{Acknowledgments}
405 |
406 | \begin{leftbar}
407 | All acknowledgments (note the AE spelling) should be collected in this
408 | unnumbered section before the references. It may contain the usual information
409 | about funding and feedback from colleagues/reviewers/etc. Furthermore,
410 | information such as relative contributions of the authors may be added here
411 | (if any).
412 | \end{leftbar}
413 |
414 |
415 | %% -- Bibliography -------------------------------------------------------------
416 | %% - References need to be provided in a .bib BibTeX database.
417 | %% - All references should be made with \cite, \citet, \citep, \citealp etc.
418 | %% (and never hard-coded). See the FAQ for details.
419 | %% - JSS-specific markup (\proglang, \pkg, \code) should be used in the .bib.
420 | %% - Titles in the .bib should be in title case.
421 | %% - DOIs should be included where available.
422 |
423 | \bibliography{refs}
424 |
425 |
426 | %% -- Appendix (if any) --------------------------------------------------------
427 | %% - After the bibliography with page break.
428 | %% - With proper section titles and _not_ just "Appendix".
429 |
430 | \newpage
431 |
432 | \begin{appendix}
433 |
434 | \section{More technical details} \label{app:technical}
435 |
436 | \begin{leftbar}
437 | Appendices can be included after the bibliography (with a page break). Each
438 | section within the appendix should have a proper section title (rather than
439 | just \emph{Appendix}).
440 |
441 | For more technical style details, please check out JSS's style FAQ at
442 | \url{https://www.jstatsoft.org/pages/view/style#frequently-asked-questions}
443 | which includes the following topics:
444 | \begin{itemize}
445 | \item Title vs.\ sentence case.
446 | \item Graphics formatting.
447 | \item Naming conventions.
448 | \item Turning JSS manuscripts into \proglang{R} package vignettes.
449 | \item Trouble shooting.
450 | \item Many other potentially helpful details\dots
451 | \end{itemize}
452 | \end{leftbar}
453 |
454 |
455 | \section[Using BibTeX]{Using \textsc{Bib}{\TeX}} \label{app:bibtex}
456 |
457 | \begin{leftbar}
458 | References need to be provided in a \textsc{Bib}{\TeX} file (\code{.bib}). All
459 | references should be made with \verb|\cite|, \verb|\citet|, \verb|\citep|,
460 | \verb|\citealp| etc.\ (and never hard-coded). This commands yield different
461 | formats of author-year citations and allow to include additional details (e.g.,
462 | pages, chapters, \dots) in brackets. In case you are not familiar with these
463 | commands see the JSS style FAQ for details.
464 |
465 | Cleaning up \textsc{Bib}{\TeX} files is a somewhat tedious task -- especially
466 | when acquiring the entries automatically from mixed online sources. However,
467 | it is important that informations are complete and presented in a consistent
468 | style to avoid confusions. JSS requires the following format.
469 | \begin{itemize}
470 | \item JSS-specific markup (\verb|\proglang|, \verb|\pkg|, \verb|\code|) should
471 | be used in the references.
472 | \item Titles should be in title case.
473 | \item Journal titles should not be abbreviated and in title case.
474 | \item DOIs should be included where available.
475 | \item Software should be properly cited as well. For \proglang{R} packages
476 | \code{citation("pkgname")} typically provides a good starting point.
477 | \end{itemize}
478 | \end{leftbar}
479 |
480 | \end{appendix}
481 |
482 | %% -----------------------------------------------------------------------------
483 |
484 |
485 | \end{document}
486 |
--------------------------------------------------------------------------------
/style-guide/jss.bst:
--------------------------------------------------------------------------------
1 | %%
2 | %% This is file `jss.bst',
3 | %% generated with the docstrip utility.
4 | %%
5 | %% The original source files were:
6 | %%
7 | %% merlin.mbs (with options: `ay,nat,nm-rvx,keyxyr,dt-beg,yr-par,note-yr,tit-qq,atit-u,trnum-it,vol-bf,volp-com,num-xser,pre-edn,isbn,issn,edpar,pp,ed,xedn,xand,etal-it,revdata,eprint,url,url-blk,doi,nfss')
8 | %%
9 | %% ** BibTeX style file for JSS publications (http://www.jstatsoft.org/)
10 | %%
11 | %% License: GPL-2 | GPL-3
12 | % ===============================================================
13 | % IMPORTANT NOTICE:
14 | % This bibliographic style (bst) file has been generated from one or
15 | % more master bibliographic style (mbs) files, listed above, provided
16 | % with kind permission of Patrick W Daly.
17 | %
18 | % This generated file can be redistributed and/or modified under the terms
19 | % of the General Public License (Version 2 or 3).
20 | % ===============================================================
21 | % Name and version information of the main mbs file:
22 | % \ProvidesFile{merlin.mbs}[2011/11/18 4.33 (PWD, AO, DPC)]
23 | % For use with BibTeX version 0.99a or later
24 | %-------------------------------------------------------------------
25 | % This bibliography style file is intended for texts in ENGLISH
26 | % This is an author-year citation style bibliography. As such, it is
27 | % non-standard LaTeX, and requires a special package file to function properly.
28 | % Such a package is natbib.sty by Patrick W. Daly
29 | % The form of the \bibitem entries is
30 | % \bibitem[Jones et al.(1990)]{key}...
31 | % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}...
32 | % The essential feature is that the label (the part in brackets) consists
33 | % of the author names, as they should appear in the citation, with the year
34 | % in parentheses following. There must be no space before the opening
35 | % parenthesis!
36 | % With natbib v5.3, a full list of authors may also follow the year.
37 | % In natbib.sty, it is possible to define the type of enclosures that is
38 | % really wanted (brackets or parentheses), but in either case, there must
39 | % be parentheses in the label.
40 | % The \cite command functions as follows:
41 | % \citet{key} ==>> Jones et al. (1990)
42 | % \citet*{key} ==>> Jones, Baker, and Smith (1990)
43 | % \citep{key} ==>> (Jones et al., 1990)
44 | % \citep*{key} ==>> (Jones, Baker, and Smith, 1990)
45 | % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
46 | % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990)
47 | % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., 1990, p. 32)
48 | % \citeauthor{key} ==>> Jones et al.
49 | % \citeauthor*{key} ==>> Jones, Baker, and Smith
50 | % \citeyear{key} ==>> 1990
51 | %---------------------------------------------------------------------
52 |
53 | ENTRY
54 | { address
55 | archive
56 | author
57 | booktitle
58 | chapter
59 | collaboration
60 | doi
61 | edition
62 | editor
63 | eid
64 | eprint
65 | howpublished
66 | institution
67 | isbn
68 | issn
69 | journal
70 | key
71 | month
72 | note
73 | number
74 | numpages
75 | organization
76 | pages
77 | publisher
78 | school
79 | series
80 | title
81 | type
82 | url
83 | volume
84 | year
85 | }
86 | {}
87 | { label extra.label sort.label short.list }
88 | INTEGERS { output.state before.all mid.sentence after.sentence after.block }
89 | FUNCTION {init.state.consts}
90 | { #0 'before.all :=
91 | #1 'mid.sentence :=
92 | #2 'after.sentence :=
93 | #3 'after.block :=
94 | }
95 | STRINGS { s t}
96 | FUNCTION {output.nonnull}
97 | { 's :=
98 | output.state mid.sentence =
99 | { ", " * write$ }
100 | { output.state after.block =
101 | { add.period$ write$
102 | newline$
103 | "\newblock " write$
104 | }
105 | { output.state before.all =
106 | 'write$
107 | { add.period$ " " * write$ }
108 | if$
109 | }
110 | if$
111 | mid.sentence 'output.state :=
112 | }
113 | if$
114 | s
115 | }
116 | FUNCTION {output}
117 | { duplicate$ empty$
118 | 'pop$
119 | 'output.nonnull
120 | if$
121 | }
122 | FUNCTION {output.check}
123 | { 't :=
124 | duplicate$ empty$
125 | { pop$ "empty " t * " in " * cite$ * warning$ }
126 | 'output.nonnull
127 | if$
128 | }
129 | FUNCTION {fin.entry}
130 | { add.period$
131 | write$
132 | newline$
133 | }
134 |
135 | FUNCTION {new.block}
136 | { output.state before.all =
137 | 'skip$
138 | { after.block 'output.state := }
139 | if$
140 | }
141 | FUNCTION {new.sentence}
142 | { output.state after.block =
143 | 'skip$
144 | { output.state before.all =
145 | 'skip$
146 | { after.sentence 'output.state := }
147 | if$
148 | }
149 | if$
150 | }
151 | FUNCTION {add.blank}
152 | { " " * before.all 'output.state :=
153 | }
154 |
155 | FUNCTION {date.block}
156 | {
157 | new.block
158 | }
159 |
160 | FUNCTION {not}
161 | { { #0 }
162 | { #1 }
163 | if$
164 | }
165 | FUNCTION {and}
166 | { 'skip$
167 | { pop$ #0 }
168 | if$
169 | }
170 | FUNCTION {or}
171 | { { pop$ #1 }
172 | 'skip$
173 | if$
174 | }
175 | FUNCTION {non.stop}
176 | { duplicate$
177 | "}" * add.period$
178 | #-1 #1 substring$ "." =
179 | }
180 |
181 | STRINGS {z}
182 |
183 | FUNCTION {remove.dots}
184 | { 'z :=
185 | ""
186 | { z empty$ not }
187 | { z #1 #2 substring$
188 | duplicate$ "\." =
189 | { z #3 global.max$ substring$ 'z := * }
190 | { pop$
191 | z #1 #1 substring$
192 | z #2 global.max$ substring$ 'z :=
193 | duplicate$ "." = 'pop$
194 | { * }
195 | if$
196 | }
197 | if$
198 | }
199 | while$
200 | }
201 | FUNCTION {new.block.checkb}
202 | { empty$
203 | swap$ empty$
204 | and
205 | 'skip$
206 | 'new.block
207 | if$
208 | }
209 | FUNCTION {field.or.null}
210 | { duplicate$ empty$
211 | { pop$ "" }
212 | 'skip$
213 | if$
214 | }
215 | FUNCTION {emphasize}
216 | { duplicate$ empty$
217 | { pop$ "" }
218 | { "\emph{" swap$ * "}" * }
219 | if$
220 | }
221 | FUNCTION {bolden}
222 | { duplicate$ empty$
223 | { pop$ "" }
224 | { "\textbf{" swap$ * "}" * }
225 | if$
226 | }
227 | FUNCTION {tie.or.space.prefix}
228 | { duplicate$ text.length$ #3 <
229 | { "~" }
230 | { " " }
231 | if$
232 | swap$
233 | }
234 |
235 | FUNCTION {capitalize}
236 | { "u" change.case$ "t" change.case$ }
237 |
238 | FUNCTION {space.word}
239 | { " " swap$ * " " * }
240 | % Here are the language-specific definitions for explicit words.
241 | % Each function has a name bbl.xxx where xxx is the English word.
242 | % The language selected here is ENGLISH
243 | FUNCTION {bbl.and}
244 | { "and"}
245 |
246 | FUNCTION {bbl.etal}
247 | { "et~al." }
248 |
249 | FUNCTION {bbl.editors}
250 | { "eds." }
251 |
252 | FUNCTION {bbl.editor}
253 | { "ed." }
254 |
255 | FUNCTION {bbl.edby}
256 | { "edited by" }
257 |
258 | FUNCTION {bbl.edition}
259 | { "edition" }
260 |
261 | FUNCTION {bbl.volume}
262 | { "volume" }
263 |
264 | FUNCTION {bbl.of}
265 | { "of" }
266 |
267 | FUNCTION {bbl.number}
268 | { "number" }
269 |
270 | FUNCTION {bbl.nr}
271 | { "no." }
272 |
273 | FUNCTION {bbl.in}
274 | { "in" }
275 |
276 | FUNCTION {bbl.pages}
277 | { "pp." }
278 |
279 | FUNCTION {bbl.page}
280 | { "p." }
281 |
282 | FUNCTION {bbl.eidpp}
283 | { "pages" }
284 |
285 | FUNCTION {bbl.chapter}
286 | { "chapter" }
287 |
288 | FUNCTION {bbl.techrep}
289 | { "Technical Report" }
290 |
291 | FUNCTION {bbl.mthesis}
292 | { "Master's thesis" }
293 |
294 | FUNCTION {bbl.phdthesis}
295 | { "Ph.D. thesis" }
296 |
297 | MACRO {jan} {"January"}
298 |
299 | MACRO {feb} {"February"}
300 |
301 | MACRO {mar} {"March"}
302 |
303 | MACRO {apr} {"April"}
304 |
305 | MACRO {may} {"May"}
306 |
307 | MACRO {jun} {"June"}
308 |
309 | MACRO {jul} {"July"}
310 |
311 | MACRO {aug} {"August"}
312 |
313 | MACRO {sep} {"September"}
314 |
315 | MACRO {oct} {"October"}
316 |
317 | MACRO {nov} {"November"}
318 |
319 | MACRO {dec} {"December"}
320 |
321 | MACRO {acmcs} {"ACM Computing Surveys"}
322 |
323 | MACRO {acta} {"Acta Informatica"}
324 |
325 | MACRO {cacm} {"Communications of the ACM"}
326 |
327 | MACRO {ibmjrd} {"IBM Journal of Research and Development"}
328 |
329 | MACRO {ibmsj} {"IBM Systems Journal"}
330 |
331 | MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
332 |
333 | MACRO {ieeetc} {"IEEE Transactions on Computers"}
334 |
335 | MACRO {ieeetcad}
336 | {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
337 |
338 | MACRO {ipl} {"Information Processing Letters"}
339 |
340 | MACRO {jacm} {"Journal of the ACM"}
341 |
342 | MACRO {jcss} {"Journal of Computer and System Sciences"}
343 |
344 | MACRO {scp} {"Science of Computer Programming"}
345 |
346 | MACRO {sicomp} {"SIAM Journal on Computing"}
347 |
348 | MACRO {tocs} {"ACM Transactions on Computer Systems"}
349 |
350 | MACRO {tods} {"ACM Transactions on Database Systems"}
351 |
352 | MACRO {tog} {"ACM Transactions on Graphics"}
353 |
354 | MACRO {toms} {"ACM Transactions on Mathematical Software"}
355 |
356 | MACRO {toois} {"ACM Transactions on Office Information Systems"}
357 |
358 | MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
359 |
360 | MACRO {tcs} {"Theoretical Computer Science"}
361 | FUNCTION {bibinfo.check}
362 | { swap$
363 | duplicate$ missing$
364 | {
365 | pop$ pop$
366 | ""
367 | }
368 | { duplicate$ empty$
369 | {
370 | swap$ pop$
371 | }
372 | { swap$
373 | pop$
374 | }
375 | if$
376 | }
377 | if$
378 | }
379 | FUNCTION {bibinfo.warn}
380 | { swap$
381 | duplicate$ missing$
382 | {
383 | swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
384 | ""
385 | }
386 | { duplicate$ empty$
387 | {
388 | swap$ "empty " swap$ * " in " * cite$ * warning$
389 | }
390 | { swap$
391 | pop$
392 | }
393 | if$
394 | }
395 | if$
396 | }
397 | FUNCTION {format.eprint}
398 | { eprint duplicate$ empty$
399 | 'skip$
400 | { "\eprint"
401 | archive empty$
402 | 'skip$
403 | { "[" * archive * "]" * }
404 | if$
405 | "{" * swap$ * "}" *
406 | }
407 | if$
408 | }
409 | FUNCTION {format.url}
410 | {
411 | url
412 | duplicate$ empty$
413 | { pop$ "" }
414 | { "\urlprefix\url{" swap$ * "}" * }
415 | if$
416 | }
417 |
418 | INTEGERS { nameptr namesleft numnames }
419 |
420 |
421 | STRINGS { bibinfo}
422 |
423 | FUNCTION {format.names}
424 | { 'bibinfo :=
425 | duplicate$ empty$ 'skip$ {
426 | 's :=
427 | "" 't :=
428 | #1 'nameptr :=
429 | s num.names$ 'numnames :=
430 | numnames 'namesleft :=
431 | { namesleft #0 > }
432 | { s nameptr
433 | "{vv~}{ll}{ jj}{ f{}}"
434 | format.name$
435 | remove.dots
436 | bibinfo bibinfo.check
437 | 't :=
438 | nameptr #1 >
439 | {
440 | namesleft #1 >
441 | { ", " * t * }
442 | {
443 | s nameptr "{ll}" format.name$ duplicate$ "others" =
444 | { 't := }
445 | { pop$ }
446 | if$
447 | "," *
448 | t "others" =
449 | {
450 | " " * bbl.etal emphasize *
451 | }
452 | { " " * t * }
453 | if$
454 | }
455 | if$
456 | }
457 | 't
458 | if$
459 | nameptr #1 + 'nameptr :=
460 | namesleft #1 - 'namesleft :=
461 | }
462 | while$
463 | } if$
464 | }
465 | FUNCTION {format.names.ed}
466 | {
467 | 'bibinfo :=
468 | duplicate$ empty$ 'skip$ {
469 | 's :=
470 | "" 't :=
471 | #1 'nameptr :=
472 | s num.names$ 'numnames :=
473 | numnames 'namesleft :=
474 | { namesleft #0 > }
475 | { s nameptr
476 | "{f{}~}{vv~}{ll}{ jj}"
477 | format.name$
478 | remove.dots
479 | bibinfo bibinfo.check
480 | 't :=
481 | nameptr #1 >
482 | {
483 | namesleft #1 >
484 | { ", " * t * }
485 | {
486 | s nameptr "{ll}" format.name$ duplicate$ "others" =
487 | { 't := }
488 | { pop$ }
489 | if$
490 | "," *
491 | t "others" =
492 | {
493 |
494 | " " * bbl.etal emphasize *
495 | }
496 | { " " * t * }
497 | if$
498 | }
499 | if$
500 | }
501 | 't
502 | if$
503 | nameptr #1 + 'nameptr :=
504 | namesleft #1 - 'namesleft :=
505 | }
506 | while$
507 | } if$
508 | }
509 | FUNCTION {format.key}
510 | { empty$
511 | { key field.or.null }
512 | { "" }
513 | if$
514 | }
515 |
516 | FUNCTION {format.authors}
517 | { author "author" format.names
518 | duplicate$ empty$ 'skip$
519 | { collaboration "collaboration" bibinfo.check
520 | duplicate$ empty$ 'skip$
521 | { " (" swap$ * ")" * }
522 | if$
523 | *
524 | }
525 | if$
526 | }
527 | FUNCTION {get.bbl.editor}
528 | { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
529 |
530 | FUNCTION {format.editors}
531 | { editor "editor" format.names duplicate$ empty$ 'skip$
532 | {
533 | " " *
534 | get.bbl.editor
535 | "(" swap$ * ")" *
536 | *
537 | }
538 | if$
539 | }
540 | FUNCTION {format.isbn}
541 | { isbn "isbn" bibinfo.check
542 | duplicate$ empty$ 'skip$
543 | {
544 | new.block
545 | "ISBN " swap$ *
546 | }
547 | if$
548 | }
549 |
550 | FUNCTION {format.issn}
551 | { issn "issn" bibinfo.check
552 | duplicate$ empty$ 'skip$
553 | {
554 | new.block
555 | "ISSN " swap$ *
556 | }
557 | if$
558 | }
559 |
560 | FUNCTION {format.doi}
561 | { doi empty$
562 | { "" }
563 | {
564 | new.block
565 | "\doi{" doi * "}" *
566 | }
567 | if$
568 | }
569 | FUNCTION {format.note}
570 | {
571 | note empty$
572 | { "" }
573 | { note #1 #1 substring$
574 | duplicate$ "{" =
575 | 'skip$
576 | { output.state mid.sentence =
577 | { "l" }
578 | { "u" }
579 | if$
580 | change.case$
581 | }
582 | if$
583 | note #2 global.max$ substring$ * "note" bibinfo.check
584 | }
585 | if$
586 | }
587 |
588 | FUNCTION {format.title}
589 | { title
590 | "title" bibinfo.check
591 | duplicate$ empty$ 'skip$
592 | {
593 | "\enquote{" swap$ *
594 | add.period$ "}" *
595 | }
596 | if$
597 | }
598 | FUNCTION {format.full.names}
599 | {'s :=
600 | "" 't :=
601 | #1 'nameptr :=
602 | s num.names$ 'numnames :=
603 | numnames 'namesleft :=
604 | { namesleft #0 > }
605 | { s nameptr
606 | "{vv~}{ll}" format.name$
607 | 't :=
608 | nameptr #1 >
609 | {
610 | namesleft #1 >
611 | { ", " * t * }
612 | {
613 | s nameptr "{ll}" format.name$ duplicate$ "others" =
614 | { 't := }
615 | { pop$ }
616 | if$
617 | t "others" =
618 | {
619 | " " * bbl.etal emphasize *
620 | }
621 | {
622 | numnames #2 >
623 | { "," * }
624 | 'skip$
625 | if$
626 | bbl.and
627 | space.word * t *
628 | }
629 | if$
630 | }
631 | if$
632 | }
633 | 't
634 | if$
635 | nameptr #1 + 'nameptr :=
636 | namesleft #1 - 'namesleft :=
637 | }
638 | while$
639 | }
640 |
641 | FUNCTION {author.editor.key.full}
642 | { author empty$
643 | { editor empty$
644 | { key empty$
645 | { cite$ #1 #3 substring$ }
646 | 'key
647 | if$
648 | }
649 | { editor format.full.names }
650 | if$
651 | }
652 | { author format.full.names }
653 | if$
654 | }
655 |
656 | FUNCTION {author.key.full}
657 | { author empty$
658 | { key empty$
659 | { cite$ #1 #3 substring$ }
660 | 'key
661 | if$
662 | }
663 | { author format.full.names }
664 | if$
665 | }
666 |
667 | FUNCTION {editor.key.full}
668 | { editor empty$
669 | { key empty$
670 | { cite$ #1 #3 substring$ }
671 | 'key
672 | if$
673 | }
674 | { editor format.full.names }
675 | if$
676 | }
677 |
678 | FUNCTION {make.full.names}
679 | { type$ "book" =
680 | type$ "inbook" =
681 | or
682 | 'author.editor.key.full
683 | { type$ "proceedings" =
684 | 'editor.key.full
685 | 'author.key.full
686 | if$
687 | }
688 | if$
689 | }
690 |
691 | FUNCTION {output.bibitem}
692 | { newline$
693 | "\bibitem[{" write$
694 | label write$
695 | ")" make.full.names duplicate$ short.list =
696 | { pop$ }
697 | { * }
698 | if$
699 | "}]{" * write$
700 | cite$ write$
701 | "}" write$
702 | newline$
703 | ""
704 | before.all 'output.state :=
705 | }
706 |
707 | FUNCTION {n.dashify}
708 | {
709 | 't :=
710 | ""
711 | { t empty$ not }
712 | { t #1 #1 substring$ "-" =
713 | { t #1 #2 substring$ "--" = not
714 | { "--" *
715 | t #2 global.max$ substring$ 't :=
716 | }
717 | { { t #1 #1 substring$ "-" = }
718 | { "-" *
719 | t #2 global.max$ substring$ 't :=
720 | }
721 | while$
722 | }
723 | if$
724 | }
725 | { t #1 #1 substring$ *
726 | t #2 global.max$ substring$ 't :=
727 | }
728 | if$
729 | }
730 | while$
731 | }
732 |
733 | FUNCTION {word.in}
734 | { bbl.in capitalize
735 | " " * }
736 |
737 | FUNCTION {format.date}
738 | { year "year" bibinfo.check duplicate$ empty$
739 | {
740 | "empty year in " cite$ * "; set to ????" * warning$
741 | pop$ "????"
742 | }
743 | 'skip$
744 | if$
745 | extra.label *
746 | before.all 'output.state :=
747 | " (" swap$ * ")" *
748 | }
749 | FUNCTION {format.btitle}
750 | { title "title" bibinfo.check
751 | duplicate$ empty$ 'skip$
752 | {
753 | emphasize
754 | }
755 | if$
756 | }
757 | FUNCTION {either.or.check}
758 | { empty$
759 | 'pop$
760 | { "can't use both " swap$ * " fields in " * cite$ * warning$ }
761 | if$
762 | }
763 | FUNCTION {format.bvolume}
764 | { volume empty$
765 | { "" }
766 | { bbl.volume volume tie.or.space.prefix
767 | "volume" bibinfo.check * *
768 | series "series" bibinfo.check
769 | duplicate$ empty$ 'pop$
770 | { swap$ bbl.of space.word * swap$
771 | emphasize * }
772 | if$
773 | "volume and number" number either.or.check
774 | }
775 | if$
776 | }
777 | FUNCTION {format.number.series}
778 | { volume empty$
779 | { number empty$
780 | { series field.or.null }
781 | { series empty$
782 | { number "number" bibinfo.check }
783 | { output.state mid.sentence =
784 | { bbl.number }
785 | { bbl.number capitalize }
786 | if$
787 | number tie.or.space.prefix "number" bibinfo.check * *
788 | bbl.in space.word *
789 | series "series" bibinfo.check *
790 | }
791 | if$
792 | }
793 | if$
794 | }
795 | { "" }
796 | if$
797 | }
798 |
799 | FUNCTION {format.edition}
800 | { edition duplicate$ empty$ 'skip$
801 | {
802 | output.state mid.sentence =
803 | { "l" }
804 | { "t" }
805 | if$ change.case$
806 | "edition" bibinfo.check
807 | " " * bbl.edition *
808 | }
809 | if$
810 | }
811 | INTEGERS { multiresult }
812 | FUNCTION {multi.page.check}
813 | { 't :=
814 | #0 'multiresult :=
815 | { multiresult not
816 | t empty$ not
817 | and
818 | }
819 | { t #1 #1 substring$
820 | duplicate$ "-" =
821 | swap$ duplicate$ "," =
822 | swap$ "+" =
823 | or or
824 | { #1 'multiresult := }
825 | { t #2 global.max$ substring$ 't := }
826 | if$
827 | }
828 | while$
829 | multiresult
830 | }
831 | FUNCTION {format.pages}
832 | { pages duplicate$ empty$ 'skip$
833 | { duplicate$ multi.page.check
834 | {
835 | bbl.pages swap$
836 | n.dashify
837 | }
838 | {
839 | bbl.page swap$
840 | }
841 | if$
842 | tie.or.space.prefix
843 | "pages" bibinfo.check
844 | * *
845 | }
846 | if$
847 | }
848 | FUNCTION {format.journal.pages}
849 | { pages duplicate$ empty$ 'pop$
850 | { swap$ duplicate$ empty$
851 | { pop$ pop$ format.pages }
852 | {
853 | ", " *
854 | swap$
855 | n.dashify
856 | "pages" bibinfo.check
857 | *
858 | }
859 | if$
860 | }
861 | if$
862 | }
863 | FUNCTION {format.journal.eid}
864 | { eid "eid" bibinfo.check
865 | duplicate$ empty$ 'pop$
866 | { swap$ duplicate$ empty$ 'skip$
867 | {
868 | ", " *
869 | }
870 | if$
871 | swap$ *
872 | numpages empty$ 'skip$
873 | { bbl.eidpp numpages tie.or.space.prefix
874 | "numpages" bibinfo.check * *
875 | " (" swap$ * ")" * *
876 | }
877 | if$
878 | }
879 | if$
880 | }
881 | FUNCTION {format.vol.num.pages}
882 | { volume field.or.null
883 | duplicate$ empty$ 'skip$
884 | {
885 | "volume" bibinfo.check
886 | }
887 | if$
888 | bolden
889 | number "number" bibinfo.check duplicate$ empty$ 'skip$
890 | {
891 | swap$ duplicate$ empty$
892 | { "there's a number but no volume in " cite$ * warning$ }
893 | 'skip$
894 | if$
895 | swap$
896 | "(" swap$ * ")" *
897 | }
898 | if$ *
899 | eid empty$
900 | { format.journal.pages }
901 | { format.journal.eid }
902 | if$
903 | }
904 |
905 | FUNCTION {format.chapter.pages}
906 | { chapter empty$
907 | 'format.pages
908 | { type empty$
909 | { bbl.chapter }
910 | { type "l" change.case$
911 | "type" bibinfo.check
912 | }
913 | if$
914 | chapter tie.or.space.prefix
915 | "chapter" bibinfo.check
916 | * *
917 | pages empty$
918 | 'skip$
919 | { ", " * format.pages * }
920 | if$
921 | }
922 | if$
923 | }
924 |
925 | FUNCTION {format.booktitle}
926 | {
927 | booktitle "booktitle" bibinfo.check
928 | emphasize
929 | }
930 | FUNCTION {format.in.ed.booktitle}
931 | { format.booktitle duplicate$ empty$ 'skip$
932 | {
933 | editor "editor" format.names.ed duplicate$ empty$ 'pop$
934 | {
935 | " " *
936 | get.bbl.editor
937 | "(" swap$ * "), " *
938 | * swap$
939 | * }
940 | if$
941 | word.in swap$ *
942 | }
943 | if$
944 | }
945 | FUNCTION {format.thesis.type}
946 | { type duplicate$ empty$
947 | 'pop$
948 | { swap$ pop$
949 | "t" change.case$ "type" bibinfo.check
950 | }
951 | if$
952 | }
953 | FUNCTION {format.tr.number}
954 | { number "number" bibinfo.check
955 | type duplicate$ empty$
956 | { pop$ bbl.techrep }
957 | 'skip$
958 | if$
959 | "type" bibinfo.check
960 | swap$ duplicate$ empty$
961 | { pop$ "t" change.case$ }
962 | { tie.or.space.prefix * * }
963 | if$
964 | }
965 | FUNCTION {format.article.crossref}
966 | {
967 | word.in
968 | " \cite{" * crossref * "}" *
969 | }
970 | FUNCTION {format.book.crossref}
971 | { volume duplicate$ empty$
972 | { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
973 | pop$ word.in
974 | }
975 | { bbl.volume
976 | capitalize
977 | swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
978 | }
979 | if$
980 | " \cite{" * crossref * "}" *
981 | }
982 | FUNCTION {format.incoll.inproc.crossref}
983 | {
984 | word.in
985 | " \cite{" * crossref * "}" *
986 | }
987 | FUNCTION {format.org.or.pub}
988 | { 't :=
989 | ""
990 | address empty$ t empty$ and
991 | 'skip$
992 | {
993 | t empty$
994 | { address "address" bibinfo.check *
995 | }
996 | { t *
997 | address empty$
998 | 'skip$
999 | { ", " * address "address" bibinfo.check * }
1000 | if$
1001 | }
1002 | if$
1003 | }
1004 | if$
1005 | }
1006 | FUNCTION {format.publisher.address}
1007 | { publisher "publisher" bibinfo.warn format.org.or.pub
1008 | }
1009 |
1010 | FUNCTION {format.organization.address}
1011 | { organization "organization" bibinfo.check format.org.or.pub
1012 | }
1013 |
1014 | FUNCTION {article}
1015 | { output.bibitem
1016 | format.authors "author" output.check
1017 | author format.key output
1018 | format.date "year" output.check
1019 | date.block
1020 | format.title "title" output.check
1021 | new.block
1022 | crossref missing$
1023 | {
1024 | journal
1025 | "journal" bibinfo.check
1026 | emphasize
1027 | "journal" output.check
1028 | format.vol.num.pages output
1029 | }
1030 | { format.article.crossref output.nonnull
1031 | format.pages output
1032 | }
1033 | if$
1034 | format.issn output
1035 | format.doi output
1036 | new.block
1037 | format.note output
1038 | format.eprint output
1039 | format.url output
1040 | fin.entry
1041 | }
1042 | FUNCTION {book}
1043 | { output.bibitem
1044 | author empty$
1045 | { format.editors "author and editor" output.check
1046 | editor format.key output
1047 | }
1048 | { format.authors output.nonnull
1049 | crossref missing$
1050 | { "author and editor" editor either.or.check }
1051 | 'skip$
1052 | if$
1053 | }
1054 | if$
1055 | format.date "year" output.check
1056 | date.block
1057 | format.btitle "title" output.check
1058 | crossref missing$
1059 | { format.bvolume output
1060 | new.block
1061 | format.number.series output
1062 | format.edition output
1063 | new.sentence
1064 | format.publisher.address output
1065 | }
1066 | {
1067 | new.block
1068 | format.book.crossref output.nonnull
1069 | }
1070 | if$
1071 | format.isbn output
1072 | format.doi output
1073 | new.block
1074 | format.note output
1075 | format.eprint output
1076 | format.url output
1077 | fin.entry
1078 | }
1079 | FUNCTION {booklet}
1080 | { output.bibitem
1081 | format.authors output
1082 | author format.key output
1083 | format.date "year" output.check
1084 | date.block
1085 | format.title "title" output.check
1086 | new.block
1087 | howpublished "howpublished" bibinfo.check output
1088 | address "address" bibinfo.check output
1089 | format.isbn output
1090 | format.doi output
1091 | new.block
1092 | format.note output
1093 | format.eprint output
1094 | format.url output
1095 | fin.entry
1096 | }
1097 |
1098 | FUNCTION {inbook}
1099 | { output.bibitem
1100 | author empty$
1101 | { format.editors "author and editor" output.check
1102 | editor format.key output
1103 | }
1104 | { format.authors output.nonnull
1105 | crossref missing$
1106 | { "author and editor" editor either.or.check }
1107 | 'skip$
1108 | if$
1109 | }
1110 | if$
1111 | format.date "year" output.check
1112 | date.block
1113 | format.btitle "title" output.check
1114 | crossref missing$
1115 | {
1116 | format.bvolume output
1117 | format.chapter.pages "chapter and pages" output.check
1118 | new.block
1119 | format.number.series output
1120 | format.edition output
1121 | new.sentence
1122 | format.publisher.address output
1123 | }
1124 | {
1125 | format.chapter.pages "chapter and pages" output.check
1126 | new.block
1127 | format.book.crossref output.nonnull
1128 | }
1129 | if$
1130 | crossref missing$
1131 | { format.isbn output }
1132 | 'skip$
1133 | if$
1134 | format.doi output
1135 | new.block
1136 | format.note output
1137 | format.eprint output
1138 | format.url output
1139 | fin.entry
1140 | }
1141 |
1142 | FUNCTION {incollection}
1143 | { output.bibitem
1144 | format.authors "author" output.check
1145 | author format.key output
1146 | format.date "year" output.check
1147 | date.block
1148 | format.title "title" output.check
1149 | new.block
1150 | crossref missing$
1151 | { format.in.ed.booktitle "booktitle" output.check
1152 | format.bvolume output
1153 | format.number.series output
1154 | format.edition output
1155 | format.chapter.pages output
1156 | new.sentence
1157 | format.publisher.address output
1158 | format.isbn output
1159 | }
1160 | { format.incoll.inproc.crossref output.nonnull
1161 | format.chapter.pages output
1162 | }
1163 | if$
1164 | format.doi output
1165 | new.block
1166 | format.note output
1167 | format.eprint output
1168 | format.url output
1169 | fin.entry
1170 | }
1171 | FUNCTION {inproceedings}
1172 | { output.bibitem
1173 | format.authors "author" output.check
1174 | author format.key output
1175 | format.date "year" output.check
1176 | date.block
1177 | format.title "title" output.check
1178 | new.block
1179 | crossref missing$
1180 | { format.in.ed.booktitle "booktitle" output.check
1181 | format.bvolume output
1182 | format.number.series output
1183 | format.pages output
1184 | new.sentence
1185 | publisher empty$
1186 | { format.organization.address output }
1187 | { organization "organization" bibinfo.check output
1188 | format.publisher.address output
1189 | }
1190 | if$
1191 | format.isbn output
1192 | format.issn output
1193 | }
1194 | { format.incoll.inproc.crossref output.nonnull
1195 | format.pages output
1196 | }
1197 | if$
1198 | format.doi output
1199 | new.block
1200 | format.note output
1201 | format.eprint output
1202 | format.url output
1203 | fin.entry
1204 | }
1205 | FUNCTION {conference} { inproceedings }
1206 | FUNCTION {manual}
1207 | { output.bibitem
1208 | format.authors output
1209 | author format.key output
1210 | format.date "year" output.check
1211 | date.block
1212 | format.btitle "title" output.check
1213 | organization address new.block.checkb
1214 | organization "organization" bibinfo.check output
1215 | address "address" bibinfo.check output
1216 | format.edition output
1217 | format.doi output
1218 | new.block
1219 | format.note output
1220 | format.eprint output
1221 | format.url output
1222 | fin.entry
1223 | }
1224 |
1225 | FUNCTION {mastersthesis}
1226 | { output.bibitem
1227 | format.authors "author" output.check
1228 | author format.key output
1229 | format.date "year" output.check
1230 | date.block
1231 | format.btitle
1232 | "title" output.check
1233 | new.block
1234 | bbl.mthesis format.thesis.type output.nonnull
1235 | school "school" bibinfo.warn output
1236 | address "address" bibinfo.check output
1237 | format.doi output
1238 | new.block
1239 | format.note output
1240 | format.eprint output
1241 | format.url output
1242 | fin.entry
1243 | }
1244 |
1245 | FUNCTION {misc}
1246 | { output.bibitem
1247 | format.authors output
1248 | author format.key output
1249 | format.date "year" output.check
1250 | date.block
1251 | format.title output
1252 | new.block
1253 | howpublished "howpublished" bibinfo.check output
1254 | format.doi output
1255 | new.block
1256 | format.note output
1257 | format.eprint output
1258 | format.url output
1259 | fin.entry
1260 | }
1261 | FUNCTION {phdthesis}
1262 | { output.bibitem
1263 | format.authors "author" output.check
1264 | author format.key output
1265 | format.date "year" output.check
1266 | date.block
1267 | format.btitle
1268 | "title" output.check
1269 | new.block
1270 | bbl.phdthesis format.thesis.type output.nonnull
1271 | school "school" bibinfo.warn output
1272 | address "address" bibinfo.check output
1273 | format.doi output
1274 | new.block
1275 | format.note output
1276 | format.eprint output
1277 | format.url output
1278 | fin.entry
1279 | }
1280 |
1281 | FUNCTION {proceedings}
1282 | { output.bibitem
1283 | format.editors output
1284 | editor format.key output
1285 | format.date "year" output.check
1286 | date.block
1287 | format.btitle "title" output.check
1288 | format.bvolume output
1289 | format.number.series output
1290 | new.sentence
1291 | publisher empty$
1292 | { format.organization.address output }
1293 | { organization "organization" bibinfo.check output
1294 | format.publisher.address output
1295 | }
1296 | if$
1297 | format.isbn output
1298 | format.issn output
1299 | format.doi output
1300 | new.block
1301 | format.note output
1302 | format.eprint output
1303 | format.url output
1304 | fin.entry
1305 | }
1306 |
1307 | FUNCTION {techreport}
1308 | { output.bibitem
1309 | format.authors "author" output.check
1310 | author format.key output
1311 | format.date "year" output.check
1312 | date.block
1313 | format.title
1314 | "title" output.check
1315 | new.block
1316 | format.tr.number emphasize output.nonnull
1317 | institution "institution" bibinfo.warn output
1318 | address "address" bibinfo.check output
1319 | format.doi output
1320 | new.block
1321 | format.note output
1322 | format.eprint output
1323 | format.url output
1324 | fin.entry
1325 | }
1326 |
1327 | FUNCTION {unpublished}
1328 | { output.bibitem
1329 | format.authors "author" output.check
1330 | author format.key output
1331 | format.date "year" output.check
1332 | date.block
1333 | format.title "title" output.check
1334 | format.doi output
1335 | new.block
1336 | format.note "note" output.check
1337 | format.eprint output
1338 | format.url output
1339 | fin.entry
1340 | }
1341 |
1342 | FUNCTION {default.type} { misc }
1343 | READ
1344 | FUNCTION {sortify}
1345 | { purify$
1346 | "l" change.case$
1347 | }
1348 | INTEGERS { len }
1349 | FUNCTION {chop.word}
1350 | { 's :=
1351 | 'len :=
1352 | s #1 len substring$ =
1353 | { s len #1 + global.max$ substring$ }
1354 | 's
1355 | if$
1356 | }
1357 | FUNCTION {format.lab.names}
1358 | { 's :=
1359 | "" 't :=
1360 | s #1 "{vv~}{ll}" format.name$
1361 | s num.names$ duplicate$
1362 | #2 >
1363 | { pop$
1364 | " " * bbl.etal emphasize *
1365 | }
1366 | { #2 <
1367 | 'skip$
1368 | { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1369 | {
1370 | " " * bbl.etal emphasize *
1371 | }
1372 | { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
1373 | * }
1374 | if$
1375 | }
1376 | if$
1377 | }
1378 | if$
1379 | }
1380 |
1381 | FUNCTION {author.key.label}
1382 | { author empty$
1383 | { key empty$
1384 | { cite$ #1 #3 substring$ }
1385 | 'key
1386 | if$
1387 | }
1388 | { author format.lab.names }
1389 | if$
1390 | }
1391 |
1392 | FUNCTION {author.editor.key.label}
1393 | { author empty$
1394 | { editor empty$
1395 | { key empty$
1396 | { cite$ #1 #3 substring$ }
1397 | 'key
1398 | if$
1399 | }
1400 | { editor format.lab.names }
1401 | if$
1402 | }
1403 | { author format.lab.names }
1404 | if$
1405 | }
1406 |
1407 | FUNCTION {editor.key.label}
1408 | { editor empty$
1409 | { key empty$
1410 | { cite$ #1 #3 substring$ }
1411 | 'key
1412 | if$
1413 | }
1414 | { editor format.lab.names }
1415 | if$
1416 | }
1417 |
1418 | FUNCTION {calc.short.authors}
1419 | { type$ "book" =
1420 | type$ "inbook" =
1421 | or
1422 | 'author.editor.key.label
1423 | { type$ "proceedings" =
1424 | 'editor.key.label
1425 | 'author.key.label
1426 | if$
1427 | }
1428 | if$
1429 | 'short.list :=
1430 | }
1431 |
1432 | FUNCTION {calc.label}
1433 | { calc.short.authors
1434 | short.list
1435 | "("
1436 | *
1437 | year duplicate$ empty$
1438 | short.list key field.or.null = or
1439 | { pop$ "" }
1440 | 'skip$
1441 | if$
1442 | *
1443 | 'label :=
1444 | }
1445 |
1446 | FUNCTION {sort.format.names}
1447 | { 's :=
1448 | #1 'nameptr :=
1449 | ""
1450 | s num.names$ 'numnames :=
1451 | numnames 'namesleft :=
1452 | { namesleft #0 > }
1453 | { s nameptr
1454 | "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
1455 | format.name$ 't :=
1456 | nameptr #1 >
1457 | {
1458 | " " *
1459 | namesleft #1 = t "others" = and
1460 | { "zzzzz" 't := }
1461 | 'skip$
1462 | if$
1463 | t sortify *
1464 | }
1465 | { t sortify * }
1466 | if$
1467 | nameptr #1 + 'nameptr :=
1468 | namesleft #1 - 'namesleft :=
1469 | }
1470 | while$
1471 | }
1472 |
1473 | FUNCTION {sort.format.title}
1474 | { 't :=
1475 | "A " #2
1476 | "An " #3
1477 | "The " #4 t chop.word
1478 | chop.word
1479 | chop.word
1480 | sortify
1481 | #1 global.max$ substring$
1482 | }
1483 | FUNCTION {author.sort}
1484 | { author empty$
1485 | { key empty$
1486 | { "to sort, need author or key in " cite$ * warning$
1487 | ""
1488 | }
1489 | { key sortify }
1490 | if$
1491 | }
1492 | { author sort.format.names }
1493 | if$
1494 | }
1495 | FUNCTION {author.editor.sort}
1496 | { author empty$
1497 | { editor empty$
1498 | { key empty$
1499 | { "to sort, need author, editor, or key in " cite$ * warning$
1500 | ""
1501 | }
1502 | { key sortify }
1503 | if$
1504 | }
1505 | { editor sort.format.names }
1506 | if$
1507 | }
1508 | { author sort.format.names }
1509 | if$
1510 | }
1511 | FUNCTION {editor.sort}
1512 | { editor empty$
1513 | { key empty$
1514 | { "to sort, need editor or key in " cite$ * warning$
1515 | ""
1516 | }
1517 | { key sortify }
1518 | if$
1519 | }
1520 | { editor sort.format.names }
1521 | if$
1522 | }
1523 | FUNCTION {presort}
1524 | { calc.label
1525 | label sortify
1526 | " "
1527 | *
1528 | type$ "book" =
1529 | type$ "inbook" =
1530 | or
1531 | 'author.editor.sort
1532 | { type$ "proceedings" =
1533 | 'editor.sort
1534 | 'author.sort
1535 | if$
1536 | }
1537 | if$
1538 | #1 entry.max$ substring$
1539 | 'sort.label :=
1540 | sort.label
1541 | *
1542 | " "
1543 | *
1544 | title field.or.null
1545 | sort.format.title
1546 | *
1547 | #1 entry.max$ substring$
1548 | 'sort.key$ :=
1549 | }
1550 |
1551 | ITERATE {presort}
1552 | SORT
1553 | STRINGS { last.label next.extra }
1554 | INTEGERS { last.extra.num last.extra.num.extended last.extra.num.blank number.label }
1555 | FUNCTION {initialize.extra.label.stuff}
1556 | { #0 int.to.chr$ 'last.label :=
1557 | "" 'next.extra :=
1558 | #0 'last.extra.num :=
1559 | "a" chr.to.int$ #1 - 'last.extra.num.blank :=
1560 | last.extra.num.blank 'last.extra.num.extended :=
1561 | #0 'number.label :=
1562 | }
1563 | FUNCTION {forward.pass}
1564 | { last.label label =
1565 | { last.extra.num #1 + 'last.extra.num :=
1566 | last.extra.num "z" chr.to.int$ >
1567 | { "a" chr.to.int$ 'last.extra.num :=
1568 | last.extra.num.extended #1 + 'last.extra.num.extended :=
1569 | }
1570 | 'skip$
1571 | if$
1572 | last.extra.num.extended last.extra.num.blank >
1573 | { last.extra.num.extended int.to.chr$
1574 | last.extra.num int.to.chr$
1575 | * 'extra.label := }
1576 | { last.extra.num int.to.chr$ 'extra.label := }
1577 | if$
1578 | }
1579 | { "a" chr.to.int$ 'last.extra.num :=
1580 | "" 'extra.label :=
1581 | label 'last.label :=
1582 | }
1583 | if$
1584 | number.label #1 + 'number.label :=
1585 | }
1586 | FUNCTION {reverse.pass}
1587 | { next.extra "b" =
1588 | { "a" 'extra.label := }
1589 | 'skip$
1590 | if$
1591 | extra.label 'next.extra :=
1592 | extra.label
1593 | duplicate$ empty$
1594 | 'skip$
1595 | { "{\natexlab{" swap$ * "}}" * }
1596 | if$
1597 | 'extra.label :=
1598 | label extra.label * 'label :=
1599 | }
1600 | EXECUTE {initialize.extra.label.stuff}
1601 | ITERATE {forward.pass}
1602 | REVERSE {reverse.pass}
1603 | FUNCTION {bib.sort.order}
1604 | { sort.label
1605 | " "
1606 | *
1607 | year field.or.null sortify
1608 | *
1609 | " "
1610 | *
1611 | title field.or.null
1612 | sort.format.title
1613 | *
1614 | #1 entry.max$ substring$
1615 | 'sort.key$ :=
1616 | }
1617 | ITERATE {bib.sort.order}
1618 | SORT
1619 | FUNCTION {begin.bib}
1620 | { preamble$ empty$
1621 | 'skip$
1622 | { preamble$ write$ newline$ }
1623 | if$
1624 | "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1625 | write$ newline$
1626 | "\newcommand{\enquote}[1]{``#1''}"
1627 | write$ newline$
1628 | "\providecommand{\natexlab}[1]{#1}"
1629 | write$ newline$
1630 | "\providecommand{\url}[1]{\texttt{#1}}"
1631 | write$ newline$
1632 | "\providecommand{\urlprefix}{URL }"
1633 | write$ newline$
1634 | "\expandafter\ifx\csname urlstyle\endcsname\relax"
1635 | write$ newline$
1636 | " \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else"
1637 | write$ newline$
1638 | " \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi"
1639 | write$ newline$
1640 | "\providecommand{\eprint}[2][]{\url{#2}}"
1641 | write$ newline$
1642 | }
1643 | EXECUTE {begin.bib}
1644 | EXECUTE {init.state.consts}
1645 | ITERATE {call.type$}
1646 | FUNCTION {end.bib}
1647 | { newline$
1648 | "\end{thebibliography}" write$ newline$
1649 | }
1650 | EXECUTE {end.bib}
1651 | %% End of customized bst file
1652 | %%
1653 | %% End of file `jss.bst'.
1654 |
--------------------------------------------------------------------------------
/style-guide/jss.cls:
--------------------------------------------------------------------------------
1 | %%
2 | %% This is file `jss.cls',
3 | \def\fileversion{3.3}
4 | \def\filename{jss}
5 | \def\filedate{2021/05/23}
6 | %%
7 | %% Package `jss' to use with LaTeX2e for JSS publications (http://www.jstatsoft.org/)
8 | %% License: GPL-2 | GPL-3
9 | %% Copyright: (C) Achim Zeileis
10 | %% Please report errors to Achim.Zeileis@R-project.org
11 | %%
12 | \NeedsTeXFormat{LaTeX2e}
13 | \ProvidesClass{jss}[\filedate\space\fileversion\space jss class by Achim Zeileis]
14 | %% options
15 | \newif\if@article
16 | \newif\if@codesnippet
17 | \newif\if@bookreview
18 | \newif\if@softwarereview
19 | \newif\if@review
20 | \newif\if@shortnames
21 | \newif\if@nojss
22 | \newif\if@notitle
23 | \newif\if@noheadings
24 | \newif\if@nofooter
25 |
26 | \@articletrue
27 | \@codesnippetfalse
28 | \@bookreviewfalse
29 | \@softwarereviewfalse
30 | \@reviewfalse
31 | \@shortnamesfalse
32 | \@nojssfalse
33 | \@notitlefalse
34 | \@noheadingsfalse
35 | \@nofooterfalse
36 |
37 | \DeclareOption{article}{\@articletrue%
38 | \@codesnippetfalse \@bookreviewfalse \@softwarereviewfalse}
39 | \DeclareOption{codesnippet}{\@articlefalse%
40 | \@codesnippettrue \@bookreviewfalse \@softwarereviewfalse}
41 | \DeclareOption{bookreview}{\@articlefalse%
42 | \@codesnippetfalse \@bookreviewtrue \@softwarereviewfalse}
43 | \DeclareOption{softwarereview}{\@articlefalse%
44 | \@codesnippetfalse \@bookreviewfalse \@softwarereviewtrue}
45 | \DeclareOption{shortnames}{\@shortnamestrue}
46 | \DeclareOption{nojss}{\@nojsstrue}
47 | \DeclareOption{notitle}{\@notitletrue}
48 | \DeclareOption{noheadings}{\@noheadingstrue}
49 | \DeclareOption{nofooter}{\@nofootertrue}
50 |
51 | \ProcessOptions
52 | \LoadClass[11pt,a4paper,twoside]{article}
53 | %% required packages
54 | \RequirePackage{graphicx,xcolor,ae,fancyvrb}
55 | \RequirePackage[T1]{fontenc}
56 | \IfFileExists{upquote.sty}{\RequirePackage{upquote}}{}
57 | \IfFileExists{lmodern.sty}{\RequirePackage{lmodern}}{}
58 | %% bibliography
59 | \if@shortnames
60 | \usepackage[authoryear,round]{natbib}
61 | \else
62 | \usepackage[authoryear,round,longnamesfirst]{natbib}
63 | \fi
64 | \bibpunct{(}{)}{;}{a}{}{,}
65 | \bibliographystyle{jss}
66 | %% page layout
67 | \topmargin 0pt
68 | \textheight 46\baselineskip
69 | \advance\textheight by \topskip
70 | \oddsidemargin 0.1in
71 | \evensidemargin 0.15in
72 | \marginparwidth 1in
73 | \oddsidemargin 0.125in
74 | \evensidemargin 0.125in
75 | \marginparwidth 0.75in
76 | \textwidth 6.125in
77 | %% paragraphs
78 | \setlength{\parskip}{0.7ex plus0.1ex minus0.1ex}
79 | \setlength{\parindent}{0em}
80 | %% for all publications
81 | \newcommand{\Address}[1]{\def\@Address{#1}}
82 | \newcommand{\Plaintitle}[1]{\def\@Plaintitle{#1}}
83 | \newcommand{\Shorttitle}[1]{\def\@Shorttitle{#1}}
84 | \newcommand{\Plainauthor}[1]{\def\@Plainauthor{#1}}
85 | \newcommand{\Volume}[1]{\def\@Volume{#1}}
86 | \newcommand{\Year}[1]{\def\@Year{#1}}
87 | \newcommand{\Month}[1]{\def\@Month{#1}}
88 | \newcommand{\Issue}[1]{\def\@Issue{#1}}
89 | \newcommand{\Submitdate}[1]{\def\@Submitdate{#1}}
90 | %% for articles and code snippets
91 | \newcommand{\Acceptdate}[1]{\def\@Acceptdate{#1}}
92 | \newcommand{\Abstract}[1]{\def\@Abstract{#1}}
93 | \newcommand{\Keywords}[1]{\def\@Keywords{#1}}
94 | \newcommand{\Plainkeywords}[1]{\def\@Plainkeywords{#1}}
95 | %% for book and software reviews
96 | \newcommand{\Reviewer}[1]{\def\@Reviewer{#1}}
97 | \newcommand{\Booktitle}[1]{\def\@Booktitle{#1}}
98 | \newcommand{\Bookauthor}[1]{\def\@Bookauthor{#1}}
99 | \newcommand{\Publisher}[1]{\def\@Publisher{#1}}
100 | \newcommand{\Pubaddress}[1]{\def\@Pubaddress{#1}}
101 | \newcommand{\Pubyear}[1]{\def\@Pubyear{#1}}
102 | \newcommand{\ISBN}[1]{\def\@ISBN{#1}}
103 | \newcommand{\Pages}[1]{\def\@Pages{#1}}
104 | \newcommand{\Price}[1]{\def\@Price{#1}}
105 | \newcommand{\Plainreviewer}[1]{\def\@Plainreviewer{#1}}
106 | \newcommand{\Softwaretitle}[1]{\def\@Softwaretitle{#1}}
107 | \newcommand{\URL}[1]{\def\@URL{#1}}
108 | \newcommand{\DOI}[1]{\def\@DOI{#1}}
109 | %% for internal use
110 | \newcommand{\Seriesname}[1]{\def\@Seriesname{#1}}
111 | \newcommand{\Hypersubject}[1]{\def\@Hypersubject{#1}}
112 | \newcommand{\Hyperauthor}[1]{\def\@Hyperauthor{#1}}
113 | \newcommand{\Footername}[1]{\def\@Footername{#1}}
114 | \newcommand{\Firstdate}[1]{\def\@Firstdate{#1}}
115 | \newcommand{\Seconddate}[1]{\def\@Seconddate{#1}}
116 | \newcommand{\Reviewauthor}[1]{\def\@Reviewauthor{#1}}
117 | %% defaults
118 | \author{Firstname Lastname\\Affiliation}
119 | \title{Title}
120 | \Abstract{---!!!---an abstract is required---!!!---}
121 | \Plainauthor{\@author}
122 | \Volume{VV}
123 | \Year{YYYY}
124 | \Month{MMMMMM}
125 | \Issue{II}
126 | \Submitdate{yyyy-mm-dd}
127 | \Acceptdate{yyyy-mm-dd}
128 | \Address{
129 | Firstname Lastname\\
130 | Affiliation\\
131 | Address, Country\\
132 | E-mail: \email{name@address}\\
133 | URL: \url{http://link/to/webpage/}
134 | }
135 |
136 | \Reviewer{Firstname Lastname\\Affiliation}
137 | \Plainreviewer{Firstname Lastname}
138 | \Booktitle{Book Title}
139 | \Bookauthor{Book Author}
140 | \Publisher{Publisher}
141 | \Pubaddress{Publisher's Address}
142 | \Pubyear{YYY}
143 | \ISBN{x-xxxxx-xxx-x}
144 | \Pages{xv + 123}
145 | \Price{USD 69.95 (P)}
146 | \URL{http://link/to/webpage/}
147 | \DOI{10.18637/jss.v000.i00}
148 | \if@article
149 | \Seriesname{Issue}
150 | \Hypersubject{Journal of Statistical Software}
151 | \Plaintitle{\@title}
152 | \Shorttitle{\@title}
153 | \Plainkeywords{\@Keywords}
154 | \fi
155 |
156 | \if@codesnippet
157 | \Seriesname{Code Snippet}
158 | \Hypersubject{Journal of Statistical Software -- Code Snippets}
159 | \Plaintitle{\@title}
160 | \Shorttitle{\@title}
161 | \Plainkeywords{\@Keywords}
162 | \fi
163 |
164 | \if@bookreview
165 | \Seriesname{Book Review}
166 | \Hypersubject{Journal of Statistical Software -- Book Reviews}
167 | \Plaintitle{\@Booktitle}
168 | \Shorttitle{\@Booktitle}
169 | \Reviewauthor{\@Bookauthor\\
170 | \@Publisher, \@Pubaddress, \@Pubyear.\\
171 | ISBN~\@ISBN. \@Pages~pp. \@Price.\\
172 | \url{\@URL}}
173 | \Plainkeywords{}
174 | \@reviewtrue
175 | \fi
176 |
177 | \if@softwarereview
178 | \Seriesname{Software Review}
179 | \Hypersubject{Journal of Statistical Software -- Software Reviews}
180 | \Plaintitle{\@Softwaretitle}
181 | \Shorttitle{\@Softwaretitle}
182 | \Booktitle{\@Softwaretitle}
183 | \Reviewauthor{\@Publisher, \@Pubaddress. \@Price.\\
184 | \url{\@URL}}
185 | \Plainkeywords{}
186 | \@reviewtrue
187 | \fi
188 |
189 | \if@review
190 | \Hyperauthor{\@Plainreviewer}
191 | \Keywords{}
192 | \Footername{Reviewer}
193 | \Firstdate{\textit{Published:} \@Submitdate}
194 | \Seconddate{}
195 | \else
196 | \Hyperauthor{\@Plainauthor}
197 | \Keywords{---!!!---at least one keyword is required---!!!---}
198 | \Footername{Affiliation}
199 | \Firstdate{\textit{Submitted:} \@Submitdate}
200 | \Seconddate{\textit{Accepted:} \@Acceptdate}
201 | \fi
202 | %% Sweave(-like)
203 | \DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl}
204 | \DefineVerbatimEnvironment{Soutput}{Verbatim}{}
205 | \DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl}
206 | \newenvironment{Schunk}{}{}
207 | \DefineVerbatimEnvironment{Code}{Verbatim}{}
208 | \DefineVerbatimEnvironment{CodeInput}{Verbatim}{fontshape=sl}
209 | \DefineVerbatimEnvironment{CodeOutput}{Verbatim}{}
210 | \newenvironment{CodeChunk}{}{}
211 | \setkeys{Gin}{width=0.8\textwidth}
212 | %% footer
213 | \newlength{\footerskip}
214 | \setlength{\footerskip}{2.5\baselineskip plus 2ex minus 0.5ex}
215 |
216 | \newcommand{\makefooter}{%
217 | \vspace{\footerskip}
218 |
219 | \if@nojss
220 | \begin{samepage}
221 | \textbf{\large \@Footername: \nopagebreak}\\[.3\baselineskip] \nopagebreak
222 | \@Address \nopagebreak
223 | \end{samepage}
224 | \else
225 | \begin{samepage}
226 | \textbf{\large \@Footername: \nopagebreak}\\[.3\baselineskip] \nopagebreak
227 | \@Address \nopagebreak
228 | \vfill
229 | \hrule \nopagebreak
230 | \vspace{.1\baselineskip}
231 | {\fontfamily{pzc} \fontsize{13}{15} \selectfont Journal of Statistical Software}
232 | \hfill
233 | \url{http://www.jstatsoft.org/}\\ \nopagebreak
234 | published by the Foundation for Open Access Statistics
235 | \hfill
236 | \url{http://www.foastat.org/}\\[.3\baselineskip] \nopagebreak
237 | {\@Month{} \@Year, Volume~\@Volume, \@Seriesname~\@Issue}
238 | \hfill
239 | \@Firstdate\\ \nopagebreak
240 | {\href{https://doi.org/\@DOI}{\tt doi:\@DOI}}
241 | \hfill
242 | \@Seconddate \nopagebreak
243 | \vspace{.3\baselineskip}
244 | \hrule
245 | \end{samepage}
246 | \fi
247 | }
248 | \if@nofooter
249 | %% \AtEndDocument{\makefooter}
250 | \else
251 | \AtEndDocument{\makefooter}
252 | \fi
253 | %% required packages
254 | \RequirePackage{hyperref}
255 | %% new \maketitle
256 | \def\@myoddhead{
257 | {\color{white} JSS}\\[-1.42cm]
258 | \hspace{-2em} \includegraphics[height=23mm,keepaspectratio]{jsslogo} \hfill
259 | \parbox[b][23mm]{118mm}{\hrule height 3pt
260 | \center{
261 | {\fontfamily{pzc} \fontsize{28}{32} \selectfont Journal of Statistical Software}
262 | \vfill
263 | {\it \small \@Month{} \@Year, Volume~\@Volume, \@Seriesname~\@Issue.%
264 | \hfill \href{https://doi.org/\@DOI}{doi:\,\@DOI}}}\\[0.1cm]
265 | \hrule height 3pt}}
266 | \if@review
267 | \renewcommand{\maketitle}{
268 | \if@nojss
269 | %% \@oddhead{\@myoddhead}\\[3\baselineskip]
270 | \else
271 | \@oddhead{\@myoddhead}\\[3\baselineskip]
272 | \fi
273 | {\large
274 | \noindent
275 | Reviewer: \@Reviewer
276 | \vspace{\baselineskip}
277 | \hrule
278 | \vspace{\baselineskip}
279 | \textbf{\@Booktitle}
280 | \begin{quotation} \noindent
281 | \@Reviewauthor
282 | \end{quotation}
283 | \vspace{0.7\baselineskip}
284 | \hrule
285 | \vspace{1.3\baselineskip}
286 | }
287 |
288 | \thispagestyle{empty}
289 | \if@nojss
290 | \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hyperauthor}}
291 | \else
292 | \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}}
293 | \fi
294 | \pagestyle{myheadings}
295 | }
296 | \else
297 | \def\maketitle{
298 | \if@nojss
299 | %% \@oddhead{\@myoddhead} \par
300 | \else
301 | \@oddhead{\@myoddhead} \par
302 | \fi
303 | \begingroup
304 | \def\thefootnote{\fnsymbol{footnote}}
305 | \def\@makefnmark{\hbox to 0pt{$^{\@thefnmark}$\hss}}
306 | \long\def\@makefntext##1{\parindent 1em\noindent
307 | \hbox to1.8em{\hss $\m@th ^{\@thefnmark}$}##1}
308 | \@maketitle \@thanks
309 | \endgroup
310 | \setcounter{footnote}{0}
311 |
312 | \if@noheadings
313 | %% \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}}
314 | \else
315 | \thispagestyle{empty}
316 | \if@nojss
317 | \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hyperauthor}}
318 | \else
319 | \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}}
320 | \fi
321 | \pagestyle{myheadings}
322 | \fi
323 |
324 | \let\maketitle\relax \let\@maketitle\relax
325 | \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax
326 | }
327 |
328 | \def\@maketitle{\vbox{\hsize\textwidth \linewidth\hsize
329 | \if@nojss
330 | %% \vskip 1in
331 | \else
332 | \vskip 1in
333 | \fi
334 | {\centering
335 | {\LARGE\bf \@title\par}
336 | \vskip 0.2in plus 1fil minus 0.1in
337 | {
338 | \def\and{\unskip\enspace{\rm and}\enspace}%
339 | \def\And{\end{tabular}\hss \egroup \hskip 1in plus 2fil
340 | \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\ignorespaces}%
341 | \def\AND{\end{tabular}\hss\egroup \hfil\hfil\egroup
342 | \vskip 0.1in plus 1fil minus 0.05in
343 | \hbox to \linewidth\bgroup\rule{\z@}{10pt} \hfil\hfil
344 | \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\ignorespaces}
345 | \hbox to \linewidth\bgroup\rule{\z@}{10pt} \hfil\hfil
346 | \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\@author
347 | \end{tabular}\hss\egroup
348 | \hfil\hfil\egroup}
349 | \vskip 0.3in minus 0.1in
350 | \hrule
351 | \begin{abstract}
352 | \@Abstract
353 | \end{abstract}}
354 | \textit{Keywords}:~\@Keywords.
355 | \vskip 0.1in minus 0.05in
356 | \hrule
357 | \vskip 0.2in minus 0.1in
358 | }}
359 | \fi
360 | %% sections, subsections, and subsubsections
361 | \newlength{\preXLskip}
362 | \newlength{\preLskip}
363 | \newlength{\preMskip}
364 | \newlength{\preSskip}
365 | \newlength{\postMskip}
366 | \newlength{\postSskip}
367 | \setlength{\preXLskip}{1.8\baselineskip plus 0.5ex minus 0ex}
368 | \setlength{\preLskip}{1.5\baselineskip plus 0.3ex minus 0ex}
369 | \setlength{\preMskip}{1\baselineskip plus 0.2ex minus 0ex}
370 | \setlength{\preSskip}{.8\baselineskip plus 0.2ex minus 0ex}
371 | \setlength{\postMskip}{.5\baselineskip plus 0ex minus 0.1ex}
372 | \setlength{\postSskip}{.3\baselineskip plus 0ex minus 0.1ex}
373 |
374 | \newcommand{\jsssec}[2][default]{\vskip \preXLskip%
375 | \pdfbookmark[1]{#1}{Section.\thesection.#1}%
376 | \refstepcounter{section}%
377 | \centerline{\textbf{\Large \thesection. #2}} \nopagebreak
378 | \vskip \postMskip \nopagebreak}
379 | \newcommand{\jsssecnn}[1]{\vskip \preXLskip%
380 | \centerline{\textbf{\Large #1}} \nopagebreak
381 | \vskip \postMskip \nopagebreak}
382 |
383 | \newcommand{\jsssubsec}[2][default]{\vskip \preMskip%
384 | \pdfbookmark[2]{#1}{Subsection.\thesubsection.#1}%
385 | \refstepcounter{subsection}%
386 | \textbf{\large \thesubsection. #2} \nopagebreak
387 | \vskip \postSskip \nopagebreak}
388 | \newcommand{\jsssubsecnn}[1]{\vskip \preMskip%
389 | \textbf{\large #1} \nopagebreak
390 | \vskip \postSskip \nopagebreak}
391 |
392 | \newcommand{\jsssubsubsec}[2][default]{\vskip \preSskip%
393 | \pdfbookmark[3]{#1}{Subsubsection.\thesubsubsection.#1}%
394 | \refstepcounter{subsubsection}%
395 | {\large \textit{#2}} \nopagebreak
396 | \vskip \postSskip \nopagebreak}
397 | \newcommand{\jsssubsubsecnn}[1]{\vskip \preSskip%
398 | {\textit{\large #1}} \nopagebreak
399 | \vskip \postSskip \nopagebreak}
400 |
401 | \newcommand{\jsssimplesec}[2][default]{\vskip \preLskip%
402 | %% \pdfbookmark[1]{#1}{Section.\thesection.#1}%
403 | \refstepcounter{section}%
404 | \textbf{\large #1} \nopagebreak
405 | \vskip \postSskip \nopagebreak}
406 | \newcommand{\jsssimplesecnn}[1]{\vskip \preLskip%
407 | \textbf{\large #1} \nopagebreak
408 | \vskip \postSskip \nopagebreak}
409 |
410 | \if@review
411 | \renewcommand{\section}{\secdef \jsssimplesec \jsssimplesecnn}
412 | \renewcommand{\subsection}{\secdef \jsssimplesec \jsssimplesecnn}
413 | \renewcommand{\subsubsection}{\secdef \jsssimplesec \jsssimplesecnn}
414 | \else
415 | \renewcommand{\section}{\secdef \jsssec \jsssecnn}
416 | \renewcommand{\subsection}{\secdef \jsssubsec \jsssubsecnn}
417 | \renewcommand{\subsubsection}{\secdef \jsssubsubsec \jsssubsubsecnn}
418 | \fi
419 | %% colors
420 | \definecolor{Red}{rgb}{0.5,0,0}
421 | \definecolor{Blue}{rgb}{0,0,0.5}
422 | \if@review
423 | \hypersetup{%
424 | hyperindex = {true},
425 | colorlinks = {true},
426 | linktocpage = {true},
427 | plainpages = {false},
428 | linkcolor = {Blue},
429 | citecolor = {Blue},
430 | urlcolor = {Red},
431 | pdfstartview = {Fit},
432 | pdfpagemode = {None},
433 | pdfview = {XYZ null null null}
434 | }
435 | \else
436 | \hypersetup{%
437 | hyperindex = {true},
438 | colorlinks = {true},
439 | linktocpage = {true},
440 | plainpages = {false},
441 | linkcolor = {Blue},
442 | citecolor = {Blue},
443 | urlcolor = {Red},
444 | pdfstartview = {Fit},
445 | pdfpagemode = {UseOutlines},
446 | pdfview = {XYZ null null null}
447 | }
448 | \fi
449 | \if@nojss
450 | \AtBeginDocument{
451 | \hypersetup{%
452 | pdfauthor = {\@Hyperauthor},
453 | pdftitle = {\@Plaintitle},
454 | pdfkeywords = {\@Plainkeywords}
455 | }
456 | }
457 | \else
458 | \AtBeginDocument{
459 | \hypersetup{%
460 | pdfauthor = {\@Hyperauthor},
461 | pdftitle = {\@Plaintitle},
462 | pdfsubject = {\@Hypersubject},
463 | pdfkeywords = {\@Plainkeywords}
464 | }
465 | }
466 | \fi
467 | \if@notitle
468 | %% \AtBeginDocument{\maketitle}
469 | \else
470 | \@ifundefined{AddToHook}{\AtBeginDocument{\maketitle}}{\AddToHook{begindocument}[maketitle]{\maketitle}}
471 | \fi
472 | %% commands
473 | \newcommand\code{\bgroup\@makeother\_\@makeother\~\@makeother\$\@codex}
474 | \def\@codex#1{{\normalfont\ttfamily\hyphenchar\font=-1 #1}\egroup}
475 | %%\let\code=\texttt
476 | \let\proglang=\textsf
477 | \newcommand{\pkg}[1]{{\fontseries{m}\fontseries{b}\selectfont #1}}
478 | \newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}}
479 | \ifx\csname urlstyle\endcsname\relax
480 | \newcommand\@doi[1]{doi:\discretionary{}{}{}#1}\else
481 | \newcommand\@doi{doi:\discretionary{}{}{}\begingroup
482 | \urlstyle{tt}\Url}\fi
483 | \newcommand{\doi}[1]{\href{https://doi.org/#1}{\normalfont\texttt{\@doi{#1}}}}
484 | \newcommand{\E}{\mathsf{E}}
485 | \newcommand{\VAR}{\mathsf{VAR}}
486 | \newcommand{\COV}{\mathsf{COV}}
487 | \newcommand{\Prob}{\mathsf{P}}
488 | \endinput
489 | %%
490 | %% End of file `jss.cls'.
491 |
--------------------------------------------------------------------------------
/style-guide/jss.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/quarto-journals/jss/715e9f007d104c23763cebaf03782b8e80cb5445/style-guide/jss.pdf
--------------------------------------------------------------------------------
/style-guide/jsslogo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/quarto-journals/jss/715e9f007d104c23763cebaf03782b8e80cb5445/style-guide/jsslogo.jpg
--------------------------------------------------------------------------------
/style-guide/refs.bib:
--------------------------------------------------------------------------------
1 | @Book{Cameron+Trivedi:2013,
2 | author = {A. Colin Cameron and Pravin K. Trivedi},
3 | title = {Regression Analysis of Count Data},
4 | year = {2013},
5 | edition = {2nd},
6 | publisher = {Cambridge University Press},
7 | address = {Cambridge},
8 | }
9 |
10 | @Book{Chambers+Hastie:1992,
11 | editor = {John M. Chambers and Trevor J. Hastie},
12 | title = {Statistical Models in \proglang{S}},
13 | publisher = {Chapman \& Hall},
14 | year = {1992},
15 | address = {London},
16 | }
17 |
18 | @Manual{Jackman:2015,
19 | title = {\pkg{pscl}: Classes and Methods for \proglang{R} Developed in the Political Science Computational Laboratory, Stanford University},
20 | author = {Simon Jackman},
21 | year = {2015},
22 | note = {\proglang{R} package version 1.4.9},
23 | url = {https://CRAN.R-project.org/package=pscl},
24 | }
25 |
26 | @Article{Mullahy:1986,
27 | author = {John Mullahy},
28 | title = {Specification and Testing of Some Modified Count Data Models},
29 | year = {1986},
30 | journal = {Journal of Econometrics},
31 | volume = {33},
32 | number = {3},
33 | pages = {341--365},
34 | doi = {10.1016/0304-4076(86)90002-3},
35 | }
36 |
37 | @Book{McCullagh+Nelder:1989,
38 | author = {Peter McCullagh and John A. Nelder},
39 | title = {Generalized Linear Models},
40 | edition = {2nd},
41 | year = {1989},
42 | publisher = {Chapman \& Hall},
43 | address = {London},
44 | doi = {10.1007/978-1-4899-3242-6},
45 | }
46 |
47 | @Manual{R,
48 | title = {\proglang{R}: {A} Language and Environment for Statistical Computing},
49 | author = {{\proglang{R} Core Team}},
50 | organization = {\proglang{R} Foundation for Statistical Computing},
51 | address = {Vienna, Austria},
52 | year = {2017},
53 | url = {https://www.R-project.org/},
54 | }
55 |
56 | @Article{Stasinopoulos+Rigby:2007,
57 | author = {D. Mikis Stasinopoulos and Robert A. Rigby},
58 | title = {Generalized Additive Models for Location Scale and Shape ({GAMLSS}) in \proglang{R}},
59 | journal = {Journal of Statistical Software},
60 | year = {2007},
61 | volume = {23},
62 | number = {7},
63 | pages = {1--46},
64 | doi = {10.18637/jss.v023.i07},
65 | }
66 |
67 | @Book{Venables+Ripley:2002,
68 | author = {William N. Venables and Brian D. Ripley},
69 | title = {Modern Applied Statistics with \proglang{S}},
70 | edition = {4th},
71 | year = {2002},
72 | pages = {495},
73 | publisher = {Springer-Verlag},
74 | address = {New York},
75 | doi = {10.1007/978-0-387-21706-2},
76 | }
77 |
78 | @Book{Wood:2006,
79 | author = {Simon N. Wood},
80 | title = {Generalized Additive Models: An Introduction with \proglang{R}},
81 | year = {2006},
82 | publisher = {Chapman \& Hall/CRC},
83 | address = {Boca Raton},
84 | }
85 |
86 | @Article{Yee:2009,
87 | author = {Thomas W. Yee},
88 | title = {The \pkg{VGAM} Package for Categorical Data Analysis},
89 | journal = {Journal of Statistical Software},
90 | year = {2010},
91 | volume = {32},
92 | number = {10},
93 | pages = {1--34},
94 | doi = {10.18637/jss.v032.i10},
95 | }
96 |
97 | @Article{Zeileis+Kleiber+Jackman:2008,
98 | author = {Achim Zeileis and Christian Kleiber and Simon Jackman},
99 | title = {Regression Models for Count Data in \proglang{R}},
100 | journal = {Journal of Statistical Software},
101 | year = {2008},
102 | volume = {27},
103 | number = {8},
104 | pages = {1--25},
105 | doi = {10.18637/jss.v027.i08},
106 | }
107 |
--------------------------------------------------------------------------------
/template.qmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "A Short Demo Article: Regression Models for Count Data in R"
3 | format:
4 | jss-pdf:
5 | keep-tex: true
6 | jss-html: default
7 | author:
8 | - name: Achim Zeileis
9 | affiliations:
10 | - name: Universität Innsbruck
11 | department: Department of Statistics
12 | address: Universitätsstr. 15
13 | city: Innsbruck
14 | country: Austria
15 | postal-code: 6020
16 | - Journal of Statistical Software
17 | orcid: 0000-0003-0918-3766
18 | email: Achim.Zeileis@R-project.org
19 | url: https://www.zeileis.org/
20 | - name: Second Author
21 | affiliations:
22 | - Plus Affiliation
23 | abstract: |
24 | This short article illustrates how to write a manuscript for the
25 | _Journal of Statistical Software_ (JSS) using its {{< latex >}} style files.
26 | Generally, we ask to follow JSS's style guide and FAQs precisely. Also,
27 | it is recommended to keep the {{< latex >}} code as simple as possible,
28 | i.e., avoid inclusion of packages/commands that are not necessary.
29 | For outlining the typical structure of a JSS article some brief text snippets are employed that have been inspired by @ZeileisKleiberJackman2008, discussing count data regression in [R]{.proglang}. Editorial comments and instructions are marked by vertical bars.
30 |
31 | keywords: [JSS, style guide, comma-separated, not capitalized, R]
32 | keywords-formatted: [JSS, style guide, comma-separated, not capitalized, "[R]{.proglang}"]
33 |
34 | bibliography: bibliography.bib
35 | ---
36 |
37 | ## Introduction: Count data regression in R {#sec-intro}
38 |
39 | ::: callout
40 | The introduction is in principle "as usual". However, it should usually embed both the implemented *methods* and the *software* into the respective relevant literature. For the latter both competing and complementary software should be discussed (within the same software environment and beyond), bringing out relative (dis)advantages. All software mentioned should be properly `@cited`'d. (See also [Using BibTeX] for more details on {{< bibtex >}}.)
41 |
42 | For writing about software JSS requires authors to use the markup `[]{.proglang}` (programming languages and large programmable systems), `[]{.pkg}` (software packages), back ticks like \`code\` for code (functions, commands, arguments, etc.).
43 |
44 | If there is such markup in (sub)section titles (as above), a plain text version has to be provided in the {{< latex >}} command as well. Below we also illustrate how abbrevations should be introduced and citation commands can be employed. See the {{< latex >}} code for more details.
45 | :::
46 |
47 | Modeling count variables is a common task in economics and the social sciences. The classical Poisson regression model for count data is often of limited use in these disciplines because empirical count data sets typically exhibit overdispersion and/or an excess number of zeros. The former issue can be addressed by extending the plain Poisson regression model in various directions: e.g., using sandwich covariances or estimating an additional dispersion parameter (in a so-called quasi-Poisson model). Another more formal way is to use a negative binomial (NB) regression. All of these models belong to the family of generalized linear models (GLMs). However, although these models typically can capture overdispersion rather well, they are in many applications not sufficient for modeling excess zeros. Since @Mullahy1986 there is increased interest in zero-augmented models that address this issue by a second model component capturing zero counts. An overview of count data models in econometrics, including hurdle and zero-inflated models, is provided in @CameronTrivedi2013.
48 |
49 | In [R]{.proglang} @R, GLMs are provided by the model fitting functions [glm]{.fct} in the [stats]{.pkg} package and [glm.nb]{.fct} in the [MASS]{.pkg} package [@VenablesRipley2002] along with associated methods for diagnostics and inference. The manuscript that this document is based on [@ZeileisKleiberJackman2008] then introduced hurdle and zero-inflated count models in the functions [hurdle]{.fct} and [zeroinfl]{.fct} in the [pcsl]{.pkg} package @Jackman2015. Of course, much more software could be discussed here, including (but not limited to) generalized additive models for count data as available in the [R]{.proglang} packages [mgcv]{.pkg} @Wood2006, [gamlss]{.pkg} @StasinopoulosRigby2007, or [VGAM]{.pkg} @Yee2009.
50 |
51 | ## Models and software {#sec-models}
52 |
53 | The basic Poisson regression model for count data is a special case of the GLM framework @McCullaghNelder1989. It describes the dependence of a count response variable $y_i$ ($i = 1, \dots, n$) by assuming a Poisson distribution $y_i \sim \mathrm{Pois}(\mu_i)$. The dependence of the conditional mean $E[y_i \, | \, x_i] = \mu_i$ on the regressors $x_i$ is then specified via a log link and a linear predictor
54 |
55 | $$
56 | \log(\mu_i) \quad = \quad x_i^\top \beta,
57 | $$ {#eq-mean}
58 |
59 | where the regression coefficients $\beta$ are estimated by maximum likelihood (ML) using the iterative weighted least squares (IWLS) algorithm.
60 |
61 | ::: callout
62 | TODO: Note that around the equation above there should be no spaces (avoided in the {{< latex >}} code by `%` lines) so that "normal" spacing is used and not a new paragraph started.
63 | :::
64 |
65 | [R]{.proglang} provides a very flexible implementation of the general GLM framework in the function [glm]{.fct} @ChambersHastie1992 in the [stats]{.pkg} package. Its most important arguments are
66 |
67 | ```r
68 | glm(formula, data, subset, na.action, weights, offset,
69 | family = gaussian, start = NULL, control = glm.control(…),
70 | model = TRUE, y = TRUE, x = FALSE, …)
71 | ```
72 |
73 | where `formula` plus `data` is the now standard way of specifying regression relationships in [R]{.proglang}/[S]{.proglang} introduced in @ChambersHastie1992. The remaining arguments in the first line (`subset`, `na.action`, `weights`, and `offset`) are also standard for setting up formula-based regression models in [R]{.proglang}/[S]{.proglang}. The arguments in the second line control aspects specific to GLMs while the arguments in the last line specify which components are returned in the fitted model object (of class [glm]{.class} which inherits from [lm]{.class}). For further arguments to [glm]{.fct} (including alternative specifications of starting values) see `?glm`. For estimating a Poisson model `family = poisson` has to be specified.
74 |
75 | ::: callout
76 | As the synopsis above is a code listing that is not meant to be executed, one can use either the dedicated `{Code}` environment or a simple `{verbatim}` environment for this. Again, spaces before and after should be avoided.
77 |
78 | Finally, there might be a reference to a `{table}` such as @tbl-overview. Usually, these are placed at the top of the page (`[t!]`), centered (`\centering`), with a caption below the table, column headers and captions in sentence style, and if possible avoiding vertical lines.
79 | :::
80 |
81 | | Type | Distribution | Method | Description |
82 | |---------|---------|---------|-----------------------------------------------|
83 | | GLM | Poisson | ML | Poisson regression: classical GLM, estimated by maximum likelihood (ML) |
84 | | | | Quasi | "Quasi-Poisson regression'': same mean function, estimated by quasi-ML (QML) or equivalently generalized estimating equations (GEE), inference adjustment via estimated dispersion parameter |
85 | | | | Adjusted | "Adjusted Poisson regression'': same mean function, estimated by QML/GEE, inference adjustment via sandwich covariances |
86 | | | NB | ML | NB regression: extended GLM, estimated by ML including additional shape parameter |
87 | | Zero-augmented | Poisson | ML | Zero-inflated Poisson (ZIP), hurdle Poisson |
88 | | | NB | ML | Zero-inflated NB (ZINB), hurdle NB |
89 | : Overview of various count regression models. The table is usually placed at the top of the page (`[t!]`), centered (`centering`), has a caption below the table, column headers and captions are in sentence style, and if possible vertical lines should be avoided. {#tbl-overview}
90 |
91 | ## Illustrations {#sec-illustrations}
92 |
93 | For a simple illustration of basic Poisson and NB count regression the
94 | `quine` data from the [MASS]{.pkg} package is used. This provides the number
95 | of `Days` that children were absent from school in Australia in a
96 | particular year, along with several covariates that can be employed as regressors. The data can be loaded by
97 |
98 | ```{R}
99 | #| prompt: true
100 | data("quine", package = "MASS")
101 | ```
102 | and a basic frequency distribution of the response variable is displayed in
103 | @fig-quine.
104 |
105 | :::{.callout}
106 | For code input and output, the style files provide dedicated environments.
107 | Either the "agnostic" `{CodeInput}` and `{CodeOutput}` can be used
108 | or, equivalently, the environments `{Sinput}` and `{Soutput}` as
109 | produced by [Sweave]{.fct} or [knitr]{.pkg} when using the `render_sweave()`
110 | hook. Please make sure that all code is properly spaced, e.g., using
111 | `y = a + b * x` and _not_ `y=a+b*x`. Moreover, code input should use "the usual" command prompt in the respective software system. For
112 | [R]{.proglang} code, the prompt `R> ` should be used with `+ ` as
113 | the continuation prompt. Generally, comments within the code chunks should be
114 | avoided -- and made in the regular {{< latex >}} text instead. Finally, empty lines before and after code input/output should be avoided (see above).
115 | :::
116 |
117 | ::: {#fig-quine}
118 |
119 | 
120 |
121 | Frequency distribution for number of days absent from school.
122 | :::
123 |
124 | As a first model for the `quine` data, we fit the basic Poisson regression
125 | model. (Note that JSS prefers when the second line of code is indented by two
126 | spaces.)
127 |
128 | ```{R}
129 | #| prompt: true
130 | m_pois <- glm(Days ~ (Eth + Sex + Age + Lrn)^2, data = quine, family = poisson)
131 | ```
132 |
133 | To account for potential overdispersion we also consider a negative binomial
134 | GLM.
135 |
136 | ```{R}
137 | #| prompt: true
138 | library("MASS")
139 | m_nbin <- glm.nb(Days ~ (Eth + Sex + Age + Lrn)^2, data = quine)
140 | ```
141 |
142 | In a comparison with the BIC the latter model is clearly preferred.
143 |
144 | ```{R}
145 | #| prompt: true
146 | library("MASS")
147 | BIC(m_pois, m_nbin)
148 | ```
149 |
150 | Hence, the full summary of that model is shown below.
151 |
152 | ```{R}
153 | #| prompt: true
154 | summary(m_nbin)
155 | ```
156 |
157 | ## Summary and discussion {#sec-summary}
158 |
159 | :::{.callout}
160 |
161 | As usual…
162 |
163 | :::
164 |
165 | ## Computational details {.unnumbered}
166 |
167 | :::{.callout}
168 |
169 | If necessary or useful, information about certain computational details
170 | such as version numbers, operating systems, or compilers could be included
171 | in an unnumbered section. Also, auxiliary packages (say, for visualizations,
172 | maps, tables, …) that are not cited in the main text can be credited here.
173 |
174 | :::
175 |
176 | The results in this paper were obtained using [R]{.proglang}~3.4.1 with the
177 | [MASS]{.pkg}~7.3.47 package. [R]{.proglang} itself and all packages used are available from the Comprehensive [R]{.proglang} Archive Network (CRAN) at
178 | [https://CRAN.R-project.org/].
179 |
180 |
181 | ## Acknowledgments {.unnumbered}
182 |
183 | :::{.callout}
184 |
185 | All acknowledgments (note the AE spelling) should be collected in this
186 | unnumbered section before the references. It may contain the usual information
187 | about funding and feedback from colleagues/reviewers/etc. Furthermore,
188 | information such as relative contributions of the authors may be added here
189 | (if any).
190 |
191 | :::
192 |
193 | ## References {.unnumbered}
194 |
195 | :::{#refs}
196 |
197 | :::
198 |
199 | {{< pagebreak >}}
200 |
201 | ## More technical details {#sec-techdetails .unnumbered}
202 |
203 | :::{.callout}
204 |
205 | Appendices can be included after the bibliography (with a page break). Each
206 | section within the appendix should have a proper section title (rather than
207 | just _Appendix_).
208 |
209 | For more technical style details, please check out JSS's style FAQ at
210 | [https://www.jstatsoft.org/pages/view/style#frequently-asked-questions]
211 | which includes the following topics:
212 |
213 | - Title vs. sentence case.
214 | - Graphics formatting.
215 | - Naming conventions.
216 | - Turning JSS manuscripts into [R]{.proglang} package vignettes.
217 | - Trouble shooting.
218 | - Many other potentially helpful details…
219 |
220 | :::
221 |
222 | ## Using BibTeX {#sec-bibtex .unnumbered}
223 |
224 | :::{.callout}
225 |
226 | References need to be provided in a {{< bibtex >}} file (`.bib`). All
227 | references should be made with `@cite` syntax. This commands yield different
228 | formats of author-year citations and allow to include additional details (e.g.,pages, chapters, \dots) in brackets. In case you are not familiar with these
229 | commands see the JSS style FAQ for details.
230 |
231 | Cleaning up {{< bibtex >}} files is a somewhat tedious task -- especially
232 | when acquiring the entries automatically from mixed online sources. However,
233 | it is important that informations are complete and presented in a consistent
234 | style to avoid confusions. JSS requires the following format.
235 |
236 | - item JSS-specific markup (`\proglang`, `\pkg`, `\code`) should be used in the references.
237 | - item Titles should be in title case.
238 | - item Journal titles should not be abbreviated and in title case.
239 | - item DOIs should be included where available.
240 | - item Software should be properly cited as well. For [R]{.proglang} packages `citation("pkgname")` typically provides a good starting point.
241 |
242 | :::
243 |
244 |
245 |
--------------------------------------------------------------------------------