How can I use renewbibmacro with different entry types?
up vote
1
down vote
favorite
Following on from this question, I want j.a.'s to appear thus:
Biernacki, P. and Waldorf, D. (1981). “Snowball sampling: Problems and techniques
of chain referral sampling”, Sociological methods & research
10.2, pp. 141–163.
which moewe's fabulous solution does (getting rid of 'In:'):
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
BUT
at the same time I want incollections to appear as:
Froestad, J., Shearing, C., and Van der Merwe, M. (2015) ‘Criminology: Re-
Imagining Security and Risk.’, in Bourbeau, P. (ed) Security: Dialogue across
Disciplines. Cambridge: Cambridge University Press., pp. 177–195.
but the ', in' appears as ' In:'. So I want to add a comma before, lowercase the I and remove the colon.
I have tried repeating similar code to moewe's answer but I cannot get it to work: only the last renewbibmacro does anything. TIA!!
biblatex bibliographies
|
show 9 more comments
up vote
1
down vote
favorite
Following on from this question, I want j.a.'s to appear thus:
Biernacki, P. and Waldorf, D. (1981). “Snowball sampling: Problems and techniques
of chain referral sampling”, Sociological methods & research
10.2, pp. 141–163.
which moewe's fabulous solution does (getting rid of 'In:'):
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
BUT
at the same time I want incollections to appear as:
Froestad, J., Shearing, C., and Van der Merwe, M. (2015) ‘Criminology: Re-
Imagining Security and Risk.’, in Bourbeau, P. (ed) Security: Dialogue across
Disciplines. Cambridge: Cambridge University Press., pp. 177–195.
but the ', in' appears as ' In:'. So I want to add a comma before, lowercase the I and remove the colon.
I have tried repeating similar code to moewe's answer but I cannot get it to work: only the last renewbibmacro does anything. TIA!!
biblatex bibliographies
1
Please show us a full example (and MWE/MWEB) not just snippets. And include the two example entries as.bib
entries.
– moewe
Jul 3 at 15:50
Because there is no MWE I can't say for sure yet, but it seems to me that thetitle
field of the@incollection
readstitle = {Criminology: Re-Imagining Security and Risk.},
with a full stop at the end. That confusesbiblatex
's punctuation tracker. Remove it and the comma should appear as desired.
– moewe
Jul 3 at 15:54
BTW: Is there any reason why you copied the code snippet with changed indentation? I noticed that in another question (tex.stackexchange.com/q/439086/35864) a few minutes ago. I normally try to use readable indentation in my answers, and while there are several styles of indentation and you need not agree with my choice I feel that the indentation in your question is just arbitrary and makes the whole thing much harder to read.
– moewe
Jul 3 at 15:57
Thanks for changing the indentation. I must say that I was more interested in why and how the change in indentation happened, especially considering that I saw something similar just moments ago. (Does it have to do with your editor?) My primary goal was not to pressure you into changing the indentation. I would however like to pressure you into showing us a fully working example.
– moewe
Jul 3 at 16:09
@moewe Off-topic: I don't know how this came about for the OP, but I believe auto-indentation in Emacs would produce something similar to the original post (as far as I get it, it recognizes open braces and similar constructs, but not the conditional by itself).
– gusbrs
Jul 3 at 16:23
|
show 9 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Following on from this question, I want j.a.'s to appear thus:
Biernacki, P. and Waldorf, D. (1981). “Snowball sampling: Problems and techniques
of chain referral sampling”, Sociological methods & research
10.2, pp. 141–163.
which moewe's fabulous solution does (getting rid of 'In:'):
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
BUT
at the same time I want incollections to appear as:
Froestad, J., Shearing, C., and Van der Merwe, M. (2015) ‘Criminology: Re-
Imagining Security and Risk.’, in Bourbeau, P. (ed) Security: Dialogue across
Disciplines. Cambridge: Cambridge University Press., pp. 177–195.
but the ', in' appears as ' In:'. So I want to add a comma before, lowercase the I and remove the colon.
I have tried repeating similar code to moewe's answer but I cannot get it to work: only the last renewbibmacro does anything. TIA!!
biblatex bibliographies
Following on from this question, I want j.a.'s to appear thus:
Biernacki, P. and Waldorf, D. (1981). “Snowball sampling: Problems and techniques
of chain referral sampling”, Sociological methods & research
10.2, pp. 141–163.
which moewe's fabulous solution does (getting rid of 'In:'):
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
BUT
at the same time I want incollections to appear as:
Froestad, J., Shearing, C., and Van der Merwe, M. (2015) ‘Criminology: Re-
Imagining Security and Risk.’, in Bourbeau, P. (ed) Security: Dialogue across
Disciplines. Cambridge: Cambridge University Press., pp. 177–195.
but the ', in' appears as ' In:'. So I want to add a comma before, lowercase the I and remove the colon.
I have tried repeating similar code to moewe's answer but I cannot get it to work: only the last renewbibmacro does anything. TIA!!
biblatex bibliographies
biblatex bibliographies
edited Jul 3 at 16:36
asked Jul 3 at 15:50
schoon
1185
1185
1
Please show us a full example (and MWE/MWEB) not just snippets. And include the two example entries as.bib
entries.
– moewe
Jul 3 at 15:50
Because there is no MWE I can't say for sure yet, but it seems to me that thetitle
field of the@incollection
readstitle = {Criminology: Re-Imagining Security and Risk.},
with a full stop at the end. That confusesbiblatex
's punctuation tracker. Remove it and the comma should appear as desired.
– moewe
Jul 3 at 15:54
BTW: Is there any reason why you copied the code snippet with changed indentation? I noticed that in another question (tex.stackexchange.com/q/439086/35864) a few minutes ago. I normally try to use readable indentation in my answers, and while there are several styles of indentation and you need not agree with my choice I feel that the indentation in your question is just arbitrary and makes the whole thing much harder to read.
– moewe
Jul 3 at 15:57
Thanks for changing the indentation. I must say that I was more interested in why and how the change in indentation happened, especially considering that I saw something similar just moments ago. (Does it have to do with your editor?) My primary goal was not to pressure you into changing the indentation. I would however like to pressure you into showing us a fully working example.
– moewe
Jul 3 at 16:09
@moewe Off-topic: I don't know how this came about for the OP, but I believe auto-indentation in Emacs would produce something similar to the original post (as far as I get it, it recognizes open braces and similar constructs, but not the conditional by itself).
– gusbrs
Jul 3 at 16:23
|
show 9 more comments
1
Please show us a full example (and MWE/MWEB) not just snippets. And include the two example entries as.bib
entries.
– moewe
Jul 3 at 15:50
Because there is no MWE I can't say for sure yet, but it seems to me that thetitle
field of the@incollection
readstitle = {Criminology: Re-Imagining Security and Risk.},
with a full stop at the end. That confusesbiblatex
's punctuation tracker. Remove it and the comma should appear as desired.
– moewe
Jul 3 at 15:54
BTW: Is there any reason why you copied the code snippet with changed indentation? I noticed that in another question (tex.stackexchange.com/q/439086/35864) a few minutes ago. I normally try to use readable indentation in my answers, and while there are several styles of indentation and you need not agree with my choice I feel that the indentation in your question is just arbitrary and makes the whole thing much harder to read.
– moewe
Jul 3 at 15:57
Thanks for changing the indentation. I must say that I was more interested in why and how the change in indentation happened, especially considering that I saw something similar just moments ago. (Does it have to do with your editor?) My primary goal was not to pressure you into changing the indentation. I would however like to pressure you into showing us a fully working example.
– moewe
Jul 3 at 16:09
@moewe Off-topic: I don't know how this came about for the OP, but I believe auto-indentation in Emacs would produce something similar to the original post (as far as I get it, it recognizes open braces and similar constructs, but not the conditional by itself).
– gusbrs
Jul 3 at 16:23
1
1
Please show us a full example (and MWE/MWEB) not just snippets. And include the two example entries as
.bib
entries.– moewe
Jul 3 at 15:50
Please show us a full example (and MWE/MWEB) not just snippets. And include the two example entries as
.bib
entries.– moewe
Jul 3 at 15:50
Because there is no MWE I can't say for sure yet, but it seems to me that the
title
field of the @incollection
reads title = {Criminology: Re-Imagining Security and Risk.},
with a full stop at the end. That confuses biblatex
's punctuation tracker. Remove it and the comma should appear as desired.– moewe
Jul 3 at 15:54
Because there is no MWE I can't say for sure yet, but it seems to me that the
title
field of the @incollection
reads title = {Criminology: Re-Imagining Security and Risk.},
with a full stop at the end. That confuses biblatex
's punctuation tracker. Remove it and the comma should appear as desired.– moewe
Jul 3 at 15:54
BTW: Is there any reason why you copied the code snippet with changed indentation? I noticed that in another question (tex.stackexchange.com/q/439086/35864) a few minutes ago. I normally try to use readable indentation in my answers, and while there are several styles of indentation and you need not agree with my choice I feel that the indentation in your question is just arbitrary and makes the whole thing much harder to read.
– moewe
Jul 3 at 15:57
BTW: Is there any reason why you copied the code snippet with changed indentation? I noticed that in another question (tex.stackexchange.com/q/439086/35864) a few minutes ago. I normally try to use readable indentation in my answers, and while there are several styles of indentation and you need not agree with my choice I feel that the indentation in your question is just arbitrary and makes the whole thing much harder to read.
– moewe
Jul 3 at 15:57
Thanks for changing the indentation. I must say that I was more interested in why and how the change in indentation happened, especially considering that I saw something similar just moments ago. (Does it have to do with your editor?) My primary goal was not to pressure you into changing the indentation. I would however like to pressure you into showing us a fully working example.
– moewe
Jul 3 at 16:09
Thanks for changing the indentation. I must say that I was more interested in why and how the change in indentation happened, especially considering that I saw something similar just moments ago. (Does it have to do with your editor?) My primary goal was not to pressure you into changing the indentation. I would however like to pressure you into showing us a fully working example.
– moewe
Jul 3 at 16:09
@moewe Off-topic: I don't know how this came about for the OP, but I believe auto-indentation in Emacs would produce something similar to the original post (as far as I get it, it recognizes open braces and similar constructs, but not the conditional by itself).
– gusbrs
Jul 3 at 16:23
@moewe Off-topic: I don't know how this came about for the OP, but I believe auto-indentation in Emacs would produce something similar to the original post (as far as I get it, it recognizes open braces and similar constructs, but not the conditional by itself).
– gusbrs
Jul 3 at 16:23
|
show 9 more comments
2 Answers
2
active
oldest
votes
up vote
3
down vote
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
renewcommand*{intitlepunct}{addspace}
is the correct solution for what you want.
But there is a slight catch to this that becomes apparent when we use the code with the minimal example from your question Why can't my MWE see the references?.
If you have additionally modified the field format of the title
field (I'm speculating here, because you have not shared an MWE, but it is not entirely outlandish that such a thing happened because you must have modified the style heavily to obtain the output you show) the periods that you placed at the ends of the fields of froestad2015Criminology
could confuse biblatex
's punctuation tracker.
RequirePackage{filecontents}
begin{filecontents}{jobname.bib}
@article{friedman2001greedy,
title = {Greedy function approximation: a gradient boosting machine},
author = {Friedman, Jerome H.},
journal = {Annals of Statistics},
pages = {1189--1232},
year = {2001},
publisher = {JSTOR},
}
@incollection {froestad2015Criminology,
author = {Froestad, J. and Shearing, C. and {Van der Merwe}, M.},
title = {Criminology: Re-Imagining Security and Risk.},
booktitle = {Security: Dialogue across Disciplines.},
publisher = {Cambridge: Cambridge University Press.},
year = {2015},
pages = {177--195},
editor = {Bourbeau, P.},
}
end{filecontents}
documentclass{article}
usepackage[%
backend=biber,
style=authortitle,
sorting=nyt,
]{biblatex}
addbibresource{jobname.bib}
DeclareFieldFormat[incollection]{title}{enquote{#1}}
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
renewcommand*{intitlepunct}{addspace}
begin{document}
textcite{friedman2001greedy,froestad2015Criminology}
printbibliography
end{document}
gives
biblatex
tries to suppress double punctuation and so the full stop at the end of
“Criminology: Re-Imagining Security and Risk.”
suppresses the comma that would normally follow it because a full stop can not be followed by a comma.
The effect is not really visible (if you look really closely it is actually) for the
Security: Dialogue across Disciplines.
because that would be followed by a full stop anyway (but if you have the .
in the booktitle
field the period is in italics, while it is upright if biblatex
adds it itself).
The comma is not suppressed in
Cambridge University Press., 2015
because biblatex
(incorrectly in this field) assumes that a .
in the publisher
field always signifies an abbreviation after which a comma is fine.
The solution is to remove the superfluous periods from your .bib
file.
@incollection {froestad2015Criminology,
author = {Froestad, J. and Shearing, C. and {Van der Merwe}, M.},
title = {Criminology: Re-Imagining Security and Risk},
booktitle = {Security: Dialogue across Disciplines},
publisher = {Cambridge University Press},
location = {Cambridge},
year = {2015},
pages = {177--195},
editor = {Bourbeau, P.},
}
works just fine and gives the expected
add a comment |
up vote
0
down vote
As I was trying to accomplish the same result sought in the question posed (save that I need commas inside quote marks), I was pleased to read @moewe's solution to the problem. In implementing it, I noticed an unwanted period appearing so as to produce "in." for entries of the bookinbook and inbook types, and jammed text in some entries of the article and incollection types. I found that this was eliminable by a slight addition to the last line so as to read renewcommand*{intitlepunct}{nopunctaddspace}
.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
renewcommand*{intitlepunct}{addspace}
is the correct solution for what you want.
But there is a slight catch to this that becomes apparent when we use the code with the minimal example from your question Why can't my MWE see the references?.
If you have additionally modified the field format of the title
field (I'm speculating here, because you have not shared an MWE, but it is not entirely outlandish that such a thing happened because you must have modified the style heavily to obtain the output you show) the periods that you placed at the ends of the fields of froestad2015Criminology
could confuse biblatex
's punctuation tracker.
RequirePackage{filecontents}
begin{filecontents}{jobname.bib}
@article{friedman2001greedy,
title = {Greedy function approximation: a gradient boosting machine},
author = {Friedman, Jerome H.},
journal = {Annals of Statistics},
pages = {1189--1232},
year = {2001},
publisher = {JSTOR},
}
@incollection {froestad2015Criminology,
author = {Froestad, J. and Shearing, C. and {Van der Merwe}, M.},
title = {Criminology: Re-Imagining Security and Risk.},
booktitle = {Security: Dialogue across Disciplines.},
publisher = {Cambridge: Cambridge University Press.},
year = {2015},
pages = {177--195},
editor = {Bourbeau, P.},
}
end{filecontents}
documentclass{article}
usepackage[%
backend=biber,
style=authortitle,
sorting=nyt,
]{biblatex}
addbibresource{jobname.bib}
DeclareFieldFormat[incollection]{title}{enquote{#1}}
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
renewcommand*{intitlepunct}{addspace}
begin{document}
textcite{friedman2001greedy,froestad2015Criminology}
printbibliography
end{document}
gives
biblatex
tries to suppress double punctuation and so the full stop at the end of
“Criminology: Re-Imagining Security and Risk.”
suppresses the comma that would normally follow it because a full stop can not be followed by a comma.
The effect is not really visible (if you look really closely it is actually) for the
Security: Dialogue across Disciplines.
because that would be followed by a full stop anyway (but if you have the .
in the booktitle
field the period is in italics, while it is upright if biblatex
adds it itself).
The comma is not suppressed in
Cambridge University Press., 2015
because biblatex
(incorrectly in this field) assumes that a .
in the publisher
field always signifies an abbreviation after which a comma is fine.
The solution is to remove the superfluous periods from your .bib
file.
@incollection {froestad2015Criminology,
author = {Froestad, J. and Shearing, C. and {Van der Merwe}, M.},
title = {Criminology: Re-Imagining Security and Risk},
booktitle = {Security: Dialogue across Disciplines},
publisher = {Cambridge University Press},
location = {Cambridge},
year = {2015},
pages = {177--195},
editor = {Bourbeau, P.},
}
works just fine and gives the expected
add a comment |
up vote
3
down vote
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
renewcommand*{intitlepunct}{addspace}
is the correct solution for what you want.
But there is a slight catch to this that becomes apparent when we use the code with the minimal example from your question Why can't my MWE see the references?.
If you have additionally modified the field format of the title
field (I'm speculating here, because you have not shared an MWE, but it is not entirely outlandish that such a thing happened because you must have modified the style heavily to obtain the output you show) the periods that you placed at the ends of the fields of froestad2015Criminology
could confuse biblatex
's punctuation tracker.
RequirePackage{filecontents}
begin{filecontents}{jobname.bib}
@article{friedman2001greedy,
title = {Greedy function approximation: a gradient boosting machine},
author = {Friedman, Jerome H.},
journal = {Annals of Statistics},
pages = {1189--1232},
year = {2001},
publisher = {JSTOR},
}
@incollection {froestad2015Criminology,
author = {Froestad, J. and Shearing, C. and {Van der Merwe}, M.},
title = {Criminology: Re-Imagining Security and Risk.},
booktitle = {Security: Dialogue across Disciplines.},
publisher = {Cambridge: Cambridge University Press.},
year = {2015},
pages = {177--195},
editor = {Bourbeau, P.},
}
end{filecontents}
documentclass{article}
usepackage[%
backend=biber,
style=authortitle,
sorting=nyt,
]{biblatex}
addbibresource{jobname.bib}
DeclareFieldFormat[incollection]{title}{enquote{#1}}
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
renewcommand*{intitlepunct}{addspace}
begin{document}
textcite{friedman2001greedy,froestad2015Criminology}
printbibliography
end{document}
gives
biblatex
tries to suppress double punctuation and so the full stop at the end of
“Criminology: Re-Imagining Security and Risk.”
suppresses the comma that would normally follow it because a full stop can not be followed by a comma.
The effect is not really visible (if you look really closely it is actually) for the
Security: Dialogue across Disciplines.
because that would be followed by a full stop anyway (but if you have the .
in the booktitle
field the period is in italics, while it is upright if biblatex
adds it itself).
The comma is not suppressed in
Cambridge University Press., 2015
because biblatex
(incorrectly in this field) assumes that a .
in the publisher
field always signifies an abbreviation after which a comma is fine.
The solution is to remove the superfluous periods from your .bib
file.
@incollection {froestad2015Criminology,
author = {Froestad, J. and Shearing, C. and {Van der Merwe}, M.},
title = {Criminology: Re-Imagining Security and Risk},
booktitle = {Security: Dialogue across Disciplines},
publisher = {Cambridge University Press},
location = {Cambridge},
year = {2015},
pages = {177--195},
editor = {Bourbeau, P.},
}
works just fine and gives the expected
add a comment |
up vote
3
down vote
up vote
3
down vote
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
renewcommand*{intitlepunct}{addspace}
is the correct solution for what you want.
But there is a slight catch to this that becomes apparent when we use the code with the minimal example from your question Why can't my MWE see the references?.
If you have additionally modified the field format of the title
field (I'm speculating here, because you have not shared an MWE, but it is not entirely outlandish that such a thing happened because you must have modified the style heavily to obtain the output you show) the periods that you placed at the ends of the fields of froestad2015Criminology
could confuse biblatex
's punctuation tracker.
RequirePackage{filecontents}
begin{filecontents}{jobname.bib}
@article{friedman2001greedy,
title = {Greedy function approximation: a gradient boosting machine},
author = {Friedman, Jerome H.},
journal = {Annals of Statistics},
pages = {1189--1232},
year = {2001},
publisher = {JSTOR},
}
@incollection {froestad2015Criminology,
author = {Froestad, J. and Shearing, C. and {Van der Merwe}, M.},
title = {Criminology: Re-Imagining Security and Risk.},
booktitle = {Security: Dialogue across Disciplines.},
publisher = {Cambridge: Cambridge University Press.},
year = {2015},
pages = {177--195},
editor = {Bourbeau, P.},
}
end{filecontents}
documentclass{article}
usepackage[%
backend=biber,
style=authortitle,
sorting=nyt,
]{biblatex}
addbibresource{jobname.bib}
DeclareFieldFormat[incollection]{title}{enquote{#1}}
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
renewcommand*{intitlepunct}{addspace}
begin{document}
textcite{friedman2001greedy,froestad2015Criminology}
printbibliography
end{document}
gives
biblatex
tries to suppress double punctuation and so the full stop at the end of
“Criminology: Re-Imagining Security and Risk.”
suppresses the comma that would normally follow it because a full stop can not be followed by a comma.
The effect is not really visible (if you look really closely it is actually) for the
Security: Dialogue across Disciplines.
because that would be followed by a full stop anyway (but if you have the .
in the booktitle
field the period is in italics, while it is upright if biblatex
adds it itself).
The comma is not suppressed in
Cambridge University Press., 2015
because biblatex
(incorrectly in this field) assumes that a .
in the publisher
field always signifies an abbreviation after which a comma is fine.
The solution is to remove the superfluous periods from your .bib
file.
@incollection {froestad2015Criminology,
author = {Froestad, J. and Shearing, C. and {Van der Merwe}, M.},
title = {Criminology: Re-Imagining Security and Risk},
booktitle = {Security: Dialogue across Disciplines},
publisher = {Cambridge University Press},
location = {Cambridge},
year = {2015},
pages = {177--195},
editor = {Bourbeau, P.},
}
works just fine and gives the expected
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
renewcommand*{intitlepunct}{addspace}
is the correct solution for what you want.
But there is a slight catch to this that becomes apparent when we use the code with the minimal example from your question Why can't my MWE see the references?.
If you have additionally modified the field format of the title
field (I'm speculating here, because you have not shared an MWE, but it is not entirely outlandish that such a thing happened because you must have modified the style heavily to obtain the output you show) the periods that you placed at the ends of the fields of froestad2015Criminology
could confuse biblatex
's punctuation tracker.
RequirePackage{filecontents}
begin{filecontents}{jobname.bib}
@article{friedman2001greedy,
title = {Greedy function approximation: a gradient boosting machine},
author = {Friedman, Jerome H.},
journal = {Annals of Statistics},
pages = {1189--1232},
year = {2001},
publisher = {JSTOR},
}
@incollection {froestad2015Criminology,
author = {Froestad, J. and Shearing, C. and {Van der Merwe}, M.},
title = {Criminology: Re-Imagining Security and Risk.},
booktitle = {Security: Dialogue across Disciplines.},
publisher = {Cambridge: Cambridge University Press.},
year = {2015},
pages = {177--195},
editor = {Bourbeau, P.},
}
end{filecontents}
documentclass{article}
usepackage[%
backend=biber,
style=authortitle,
sorting=nyt,
]{biblatex}
addbibresource{jobname.bib}
DeclareFieldFormat[incollection]{title}{enquote{#1}}
renewbibmacro*{in:}{%
setunit{addcommaspace}%
ifentrytype{article}
{}
{printtext{%
bibstring{in}intitlepunct}}}
renewcommand*{intitlepunct}{addspace}
begin{document}
textcite{friedman2001greedy,froestad2015Criminology}
printbibliography
end{document}
gives
biblatex
tries to suppress double punctuation and so the full stop at the end of
“Criminology: Re-Imagining Security and Risk.”
suppresses the comma that would normally follow it because a full stop can not be followed by a comma.
The effect is not really visible (if you look really closely it is actually) for the
Security: Dialogue across Disciplines.
because that would be followed by a full stop anyway (but if you have the .
in the booktitle
field the period is in italics, while it is upright if biblatex
adds it itself).
The comma is not suppressed in
Cambridge University Press., 2015
because biblatex
(incorrectly in this field) assumes that a .
in the publisher
field always signifies an abbreviation after which a comma is fine.
The solution is to remove the superfluous periods from your .bib
file.
@incollection {froestad2015Criminology,
author = {Froestad, J. and Shearing, C. and {Van der Merwe}, M.},
title = {Criminology: Re-Imagining Security and Risk},
booktitle = {Security: Dialogue across Disciplines},
publisher = {Cambridge University Press},
location = {Cambridge},
year = {2015},
pages = {177--195},
editor = {Bourbeau, P.},
}
works just fine and gives the expected
answered Jul 3 at 19:35
moewe
83k8106318
83k8106318
add a comment |
add a comment |
up vote
0
down vote
As I was trying to accomplish the same result sought in the question posed (save that I need commas inside quote marks), I was pleased to read @moewe's solution to the problem. In implementing it, I noticed an unwanted period appearing so as to produce "in." for entries of the bookinbook and inbook types, and jammed text in some entries of the article and incollection types. I found that this was eliminable by a slight addition to the last line so as to read renewcommand*{intitlepunct}{nopunctaddspace}
.
add a comment |
up vote
0
down vote
As I was trying to accomplish the same result sought in the question posed (save that I need commas inside quote marks), I was pleased to read @moewe's solution to the problem. In implementing it, I noticed an unwanted period appearing so as to produce "in." for entries of the bookinbook and inbook types, and jammed text in some entries of the article and incollection types. I found that this was eliminable by a slight addition to the last line so as to read renewcommand*{intitlepunct}{nopunctaddspace}
.
add a comment |
up vote
0
down vote
up vote
0
down vote
As I was trying to accomplish the same result sought in the question posed (save that I need commas inside quote marks), I was pleased to read @moewe's solution to the problem. In implementing it, I noticed an unwanted period appearing so as to produce "in." for entries of the bookinbook and inbook types, and jammed text in some entries of the article and incollection types. I found that this was eliminable by a slight addition to the last line so as to read renewcommand*{intitlepunct}{nopunctaddspace}
.
As I was trying to accomplish the same result sought in the question posed (save that I need commas inside quote marks), I was pleased to read @moewe's solution to the problem. In implementing it, I noticed an unwanted period appearing so as to produce "in." for entries of the bookinbook and inbook types, and jammed text in some entries of the article and incollection types. I found that this was eliminable by a slight addition to the last line so as to read renewcommand*{intitlepunct}{nopunctaddspace}
.
answered 28 mins ago
Louis
2314
2314
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f439098%2fhow-can-i-use-renewbibmacro-with-different-entry-types%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Please show us a full example (and MWE/MWEB) not just snippets. And include the two example entries as
.bib
entries.– moewe
Jul 3 at 15:50
Because there is no MWE I can't say for sure yet, but it seems to me that the
title
field of the@incollection
readstitle = {Criminology: Re-Imagining Security and Risk.},
with a full stop at the end. That confusesbiblatex
's punctuation tracker. Remove it and the comma should appear as desired.– moewe
Jul 3 at 15:54
BTW: Is there any reason why you copied the code snippet with changed indentation? I noticed that in another question (tex.stackexchange.com/q/439086/35864) a few minutes ago. I normally try to use readable indentation in my answers, and while there are several styles of indentation and you need not agree with my choice I feel that the indentation in your question is just arbitrary and makes the whole thing much harder to read.
– moewe
Jul 3 at 15:57
Thanks for changing the indentation. I must say that I was more interested in why and how the change in indentation happened, especially considering that I saw something similar just moments ago. (Does it have to do with your editor?) My primary goal was not to pressure you into changing the indentation. I would however like to pressure you into showing us a fully working example.
– moewe
Jul 3 at 16:09
@moewe Off-topic: I don't know how this came about for the OP, but I believe auto-indentation in Emacs would produce something similar to the original post (as far as I get it, it recognizes open braces and similar constructs, but not the conditional by itself).
– gusbrs
Jul 3 at 16:23