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!!










share|improve this question




















  • 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 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










  • 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















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!!










share|improve this question




















  • 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 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










  • 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













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!!










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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










  • 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




    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












  • 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










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



enter image description here



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



enter image description here






share|improve this answer




























    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}.






    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "85"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














       

      draft saved


      draft discarded


















      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

























      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



      enter image description here



      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



      enter image description here






      share|improve this answer

























        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



        enter image description here



        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



        enter image description here






        share|improve this answer























          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



          enter image description here



          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



          enter image description here






          share|improve this answer












          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



          enter image description here



          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



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 3 at 19:35









          moewe

          83k8106318




          83k8106318






















              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}.






              share|improve this answer

























                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}.






                share|improve this answer























                  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}.






                  share|improve this answer












                  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}.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 28 mins ago









                  Louis

                  2314




                  2314






























                       

                      draft saved


                      draft discarded



















































                       


                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      Contact image not getting when fetch all contact list from iPhone by CNContact

                      count number of partitions of a set with n elements into k subsets

                      A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks