TeX - LaTeX Asked by Learn4life on July 20, 2021
I’ve been scouring the internet for the last hour trying to solve this and I can’t yet. I have a list of references, a mix of books, articles/papers, and tech reports. Using biblatex
means these are inconsistently formatted – some years are in brackets, other not, some titles are italicised, others not, and so on…
Here’s my preamble code:
documentclass[a4paper,11pt]{article}
usepackage[utf8]{inputenc}
usepackage[english]{babel}
usepackage[backend=biber, sorting=none, maxbibnames=99, style=numeric]{biblatex}
addbibresource{bibliography.bib}
begindocument
printbibliography
enddocument
My bibliography is really long, so I won’t print all of it, but just as an example of a paper:
Matthew W. Christensen, William K. Jones, and Philip Stier. “Aerosols enhance cloud lifetime and brightness along the stratus-to-cumulus transition”. In: Proceedings of the National Academy of Sciences 117 (2020). visited on 19/04/2021.doi:10.1073/pnas.1921231117
with the .bib
entry:
@article{christensen_aerosols_2020,
title = {Aerosols enhance cloud lifetime and brightness along the stratus-to-cumulus transition},
volume = {117},
journal = {Proceedings of the National Academy of Sciences},
author = {Christensen, Matthew W. and Jones, William K. and Stier, Philip},
year = {2020},
doi={10.1073/pnas.1921231117},
note={visited on 19/04/2021}
and an example of a book:
Esam M.A. Hussein. Computed Radiation Imaging; chapter 1 – Radiation Imaging. 1st edition. visited on 09/07/2021. Elsevier, 2011.doi:10.1016/B978-0-12-387777-2.00021-5
with .bib
entry:
@book{hussein_inverse_2011,
title={Computed Radiation Imaging; chapter 1 - Radiation Imaging},
year={2011},
edition={1st edition},
publisher={Elsevier},
author={Esam M.A. Hussein},
doi={10.1016/B978-0-12-387777-2.00021-5},
note={visited on 09/07/2021},
}
How do I get one to look like the other?
I’ve tried a bunch of packages, but none of them really seem to work. I’ve also considered just calling them all the same entry type, but this doesn’t work because obviously a book and an article have different kinds of associated information (publisher vs journal, for example..).
The output of the standard styles is consistent and makes sense if you cast your mind back to the days of physical libraries and keep in mind that you could see book titles and journal titles on the spines (and the covers) of books/journal volumes and article titles and chapter titles only once you actually opened the book/volume. Titles that are typeset in italics can be seen in a library without opening books, titles in quotation marks can be found in the table of contents once the book is open.
This is not something that biblatex
made up, it can be found in well-known and common styles like APA (https://apastyle.apa.org/style-grammar-guidelines/references/examples/journal-article-references, https://apastyle.apa.org/style-grammar-guidelines/references/examples/book-references), Chicago style (https://www.chicagomanualofstyle.org/tools_citationguide/citation-guide-1.html), MLA (https://style.mla.org/works-cited/works-cited-a-quick-guide/), IEEE (https://ieeeauthorcenter.ieee.org/wp-content/uploads/IEEE-Reference-Guide.pdf), New Hart's Rules.
It kind of makes sense to put the year for @article
s in brackets because the volume and number information usually implies the year and is more fine grained.
Here different styles guides have different opinions. Chicago style puts @article
years in parentheses, but not years of other types (https://www.chicagomanualofstyle.org/tools_citationguide/citation-guide-1.html), IEEE style has no brackets for any year, Hart's has brackets for all years.
If you have to make the output more consistent across types
Remove Quotation Marks from Style explains how type-specific formatting works. For all-italic titles you could try
DeclareFieldFormat*{title}{mkbibemph{#1}}
DeclareFieldFormat{journaltitle}{mkbibemph{#1isdot}}
DeclareFieldFormat{issuetitle}{mkbibemph{#1}}
DeclareFieldFormat{maintitle}{mkbibemph{#1}}
DeclareFieldFormat{booktitle}{mkbibemph{#1}}
the parentheses around the date for @article
s can easily be removed with biblatex-ext
(full disclosure: I'm the author)
renewcommand*{volnumdatedelim}{addcommaspace}
DeclareFieldFormat{issuedate}{#1}
Note that if you want to cite only one chapter from a @book
you should use the @inbook
type and not the @book
type with chapter number in the title
. The MWE below contains entries for both Hussein's @book
and @inbook
. Indeed, using @inbook
here makes things more consistent with @article
s with the default settings, because they work analogous in the 'physical library' sense explained above. That said, usually I see full books listed in the bibliography and not individual chapters. (This is different when we are talking about @incollection
s, i.e. papers in a collection volume. There @incollection
is more common than @collection
.)
documentclass[british]{article}
usepackage[T1]{fontenc}
usepackage{babel}
usepackage{csquotes}
usepackage[backend=biber, style=ext-numeric, sorting=none, maxbibnames=99,]{biblatex}
DeclareFieldFormat*{title}{mkbibemph{#1}}
DeclareFieldFormat{journaltitle}{mkbibemph{#1isdot}}
DeclareFieldFormat{issuetitle}{mkbibemph{#1}}
DeclareFieldFormat{maintitle}{mkbibemph{#1}}
DeclareFieldFormat{booktitle}{mkbibemph{#1}}
renewcommand*{volnumdatedelim}{addcommaspace}
DeclareFieldFormat{issuedate}{#1}
begin{filecontents}{jobname.bib}
@article{christensen_aerosols_2020,
title = {Aerosols Enhance Cloud Lifetime and Brightness
Along the Stratus-to-Cumulus Transition},
volume = {117},
journal = {Proceedings of the National Academy of Sciences},
author = {Christensen, Matthew W. and Jones, William K. and Stier, Philip},
year = {2020},
doi = {10.1073/pnas.1921231117},
urldate = {2021-04-19},
}
@inbook{hussein_inverse_2011:chap1,
author = {Esam M. A. Hussein},
title = {Radiation Imaging},
chapter = {1},
pages = {1-12},
booktitle = {Computed Radiation Imaging},
year = {2011},
edition = {1},
publisher = {Elsevier},
doi = {10.1016/B978-0-12-387777-2.00001-X},
urldate = {2021-07-09},
}
@book{hussein_inverse_2011:book,
author = {Esam M. A. Hussein},
title = {Computed Radiation Imaging},
year = {2011},
edition = {1},
publisher = {Elsevier},
doi = {10.1016/C2011-0-00133-3},
urldate = {2021-07-09},
}
end{filecontents}
addbibresource{jobname.bib}
addbibresource{biblatex-examples.bib}
begin{document}
Lorem autocite{sigfridsson,christensen_aerosols_2020,
hussein_inverse_2011:chap1,worman,nussbaum,hussein_inverse_2011:book}
printbibliography
end{document}
Answered by moewe on July 20, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP