Change position of year in reference - biblatex biber












2















Starting from this question I edited the code presented there to achieve a citation like, journal-title+volume+pages+year



renewbibmacro*{journal+issuetitle}{%
usebibmacro{journal}%
setunit*{addspace}%
iffieldundef{series}
{}
{newunit
printfield{series}%
setunit{addspace}}%
printfield{volume}%
setunit{addcommaspace}%
printfield{pages}%
setunit{space (}%
usebibmacro{date})%
newunit}


Could it have been done better? Most likely, I dont know how macros is used but it works as intended with one minor problem. After the year, the pages are added again. I assume it is because the macro journal+issuetitle doesn't encompass pages, so try adding +pages to the name but it didn't do anything.



Was wondering what needs to be changed in the redefinition of the macros so pages is not shown again at the end.



Pic of how it looks like (there are more editions done to biblatex):
enter image description here



Edit:



A working minimal example without the rest of the editions so that is shorter would be



documentclass{article}
usepackage[backend=biber, style=numeric-comp, sortcites=true, sorting=none, url=false,maxbibnames=99]{biblatex}
addbibresource{biblatex-examples.bib}
usepackage[utf8]{inputenc}
renewbibmacro*{journal+issuetitle}{%
usebibmacro{journal}%
setunit*{addspace}%
iffieldundef{series}
{}
{newunit
printfield{series}%
setunit{addspace}}%
printfield{volume}%
setunit{addcommaspace}%
printfield{pages}%
setunit{space (}%
usebibmacro{date})%
newunit}

title{mwe}

begin{document}
maketitle

Lorem ipsum~cite{sigfridsson} dolor~cite{worman}.
printbibliography
end{document}


Thanks!










share|improve this question





























    2















    Starting from this question I edited the code presented there to achieve a citation like, journal-title+volume+pages+year



    renewbibmacro*{journal+issuetitle}{%
    usebibmacro{journal}%
    setunit*{addspace}%
    iffieldundef{series}
    {}
    {newunit
    printfield{series}%
    setunit{addspace}}%
    printfield{volume}%
    setunit{addcommaspace}%
    printfield{pages}%
    setunit{space (}%
    usebibmacro{date})%
    newunit}


    Could it have been done better? Most likely, I dont know how macros is used but it works as intended with one minor problem. After the year, the pages are added again. I assume it is because the macro journal+issuetitle doesn't encompass pages, so try adding +pages to the name but it didn't do anything.



    Was wondering what needs to be changed in the redefinition of the macros so pages is not shown again at the end.



    Pic of how it looks like (there are more editions done to biblatex):
    enter image description here



    Edit:



    A working minimal example without the rest of the editions so that is shorter would be



    documentclass{article}
    usepackage[backend=biber, style=numeric-comp, sortcites=true, sorting=none, url=false,maxbibnames=99]{biblatex}
    addbibresource{biblatex-examples.bib}
    usepackage[utf8]{inputenc}
    renewbibmacro*{journal+issuetitle}{%
    usebibmacro{journal}%
    setunit*{addspace}%
    iffieldundef{series}
    {}
    {newunit
    printfield{series}%
    setunit{addspace}}%
    printfield{volume}%
    setunit{addcommaspace}%
    printfield{pages}%
    setunit{space (}%
    usebibmacro{date})%
    newunit}

    title{mwe}

    begin{document}
    maketitle

    Lorem ipsum~cite{sigfridsson} dolor~cite{worman}.
    printbibliography
    end{document}


    Thanks!










    share|improve this question



























      2












      2








      2








      Starting from this question I edited the code presented there to achieve a citation like, journal-title+volume+pages+year



      renewbibmacro*{journal+issuetitle}{%
      usebibmacro{journal}%
      setunit*{addspace}%
      iffieldundef{series}
      {}
      {newunit
      printfield{series}%
      setunit{addspace}}%
      printfield{volume}%
      setunit{addcommaspace}%
      printfield{pages}%
      setunit{space (}%
      usebibmacro{date})%
      newunit}


      Could it have been done better? Most likely, I dont know how macros is used but it works as intended with one minor problem. After the year, the pages are added again. I assume it is because the macro journal+issuetitle doesn't encompass pages, so try adding +pages to the name but it didn't do anything.



      Was wondering what needs to be changed in the redefinition of the macros so pages is not shown again at the end.



      Pic of how it looks like (there are more editions done to biblatex):
      enter image description here



      Edit:



      A working minimal example without the rest of the editions so that is shorter would be



      documentclass{article}
      usepackage[backend=biber, style=numeric-comp, sortcites=true, sorting=none, url=false,maxbibnames=99]{biblatex}
      addbibresource{biblatex-examples.bib}
      usepackage[utf8]{inputenc}
      renewbibmacro*{journal+issuetitle}{%
      usebibmacro{journal}%
      setunit*{addspace}%
      iffieldundef{series}
      {}
      {newunit
      printfield{series}%
      setunit{addspace}}%
      printfield{volume}%
      setunit{addcommaspace}%
      printfield{pages}%
      setunit{space (}%
      usebibmacro{date})%
      newunit}

      title{mwe}

      begin{document}
      maketitle

      Lorem ipsum~cite{sigfridsson} dolor~cite{worman}.
      printbibliography
      end{document}


      Thanks!










      share|improve this question
















      Starting from this question I edited the code presented there to achieve a citation like, journal-title+volume+pages+year



      renewbibmacro*{journal+issuetitle}{%
      usebibmacro{journal}%
      setunit*{addspace}%
      iffieldundef{series}
      {}
      {newunit
      printfield{series}%
      setunit{addspace}}%
      printfield{volume}%
      setunit{addcommaspace}%
      printfield{pages}%
      setunit{space (}%
      usebibmacro{date})%
      newunit}


      Could it have been done better? Most likely, I dont know how macros is used but it works as intended with one minor problem. After the year, the pages are added again. I assume it is because the macro journal+issuetitle doesn't encompass pages, so try adding +pages to the name but it didn't do anything.



      Was wondering what needs to be changed in the redefinition of the macros so pages is not shown again at the end.



      Pic of how it looks like (there are more editions done to biblatex):
      enter image description here



      Edit:



      A working minimal example without the rest of the editions so that is shorter would be



      documentclass{article}
      usepackage[backend=biber, style=numeric-comp, sortcites=true, sorting=none, url=false,maxbibnames=99]{biblatex}
      addbibresource{biblatex-examples.bib}
      usepackage[utf8]{inputenc}
      renewbibmacro*{journal+issuetitle}{%
      usebibmacro{journal}%
      setunit*{addspace}%
      iffieldundef{series}
      {}
      {newunit
      printfield{series}%
      setunit{addspace}}%
      printfield{volume}%
      setunit{addcommaspace}%
      printfield{pages}%
      setunit{space (}%
      usebibmacro{date})%
      newunit}

      title{mwe}

      begin{document}
      maketitle

      Lorem ipsum~cite{sigfridsson} dolor~cite{worman}.
      printbibliography
      end{document}


      Thanks!







      biblatex biber






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago







      M.O.

















      asked 2 days ago









      M.O.M.O.

      258




      258






















          1 Answer
          1






          active

          oldest

          votes


















          4














          The pages are added again, because they are printed by the macro note+pages in the driver for @article. If you also print the pages in journal+issuetitle, you need to suppress the pages in note+pages.



          The redefinition of journal+issuetitle below is based on the standard definition from standard.bbx. The only change is the added pages printing.



          Note that it is usually bad style to have bare parentheses like ( and ) in setunit. In my solution below, I used the ready-made macro issue+date that adds the parentheses and takes care of a few other things as well.



          documentclass[british]{article}
          usepackage[T1]{fontenc}
          usepackage[utf8]{inputenc}
          usepackage{babel}
          usepackage{csquotes}

          usepackage[style=numeric, backend=biber]{biblatex}

          DeclareFieldFormat[article,periodical]{pages}{#1}

          renewbibmacro*{journal+issuetitle}{%
          usebibmacro{journal}%
          setunit*{addspace}%
          iffieldundef{series}
          {}
          {newunit
          printfield{series}%
          setunit{addspace}}%
          usebibmacro{volume+number+eid}%
          setunit{bibpagespunct}%
          printfield{pages}%
          setunit{addspace}%
          usebibmacro{issue+date}%
          setunit{addcolonspace}%
          usebibmacro{issue}%
          newunit}

          renewbibmacro*{note+pages}{%
          printfield{note}%
          newunit}

          addbibresource{biblatex-examples.bib}


          begin{document}
          cite{sigfridsson}
          printbibliography
          end{document}


          Emma Sigfridsson and Ulf Ryde. ‘Comparison of methods for deriving atomic charges from the electrostatic potential and moments’. In: Journal of Computational Chemistry 19.4, 377–395 (1998). doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P.





          If you want to understand how these macros work and why other stuff is printed, you should have a look at the bibliography drivers in standard.bbx, most relevant macros that are called there are either defined in standard.bbx or biblatex.def.



          In biblatex 3.12 the driver for @article can be found in ll. 26-62 of standard.bbx. journal+issuetitle is in ll. 746-761 and note+pages in ll. 857-861.






          share|improve this answer


























          • Thanks! It works perfectly

            – M.O.
            2 days ago











          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',
          autoActivateHeartbeat: false,
          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%2f469831%2fchange-position-of-year-in-reference-biblatex-biber%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          The pages are added again, because they are printed by the macro note+pages in the driver for @article. If you also print the pages in journal+issuetitle, you need to suppress the pages in note+pages.



          The redefinition of journal+issuetitle below is based on the standard definition from standard.bbx. The only change is the added pages printing.



          Note that it is usually bad style to have bare parentheses like ( and ) in setunit. In my solution below, I used the ready-made macro issue+date that adds the parentheses and takes care of a few other things as well.



          documentclass[british]{article}
          usepackage[T1]{fontenc}
          usepackage[utf8]{inputenc}
          usepackage{babel}
          usepackage{csquotes}

          usepackage[style=numeric, backend=biber]{biblatex}

          DeclareFieldFormat[article,periodical]{pages}{#1}

          renewbibmacro*{journal+issuetitle}{%
          usebibmacro{journal}%
          setunit*{addspace}%
          iffieldundef{series}
          {}
          {newunit
          printfield{series}%
          setunit{addspace}}%
          usebibmacro{volume+number+eid}%
          setunit{bibpagespunct}%
          printfield{pages}%
          setunit{addspace}%
          usebibmacro{issue+date}%
          setunit{addcolonspace}%
          usebibmacro{issue}%
          newunit}

          renewbibmacro*{note+pages}{%
          printfield{note}%
          newunit}

          addbibresource{biblatex-examples.bib}


          begin{document}
          cite{sigfridsson}
          printbibliography
          end{document}


          Emma Sigfridsson and Ulf Ryde. ‘Comparison of methods for deriving atomic charges from the electrostatic potential and moments’. In: Journal of Computational Chemistry 19.4, 377–395 (1998). doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P.





          If you want to understand how these macros work and why other stuff is printed, you should have a look at the bibliography drivers in standard.bbx, most relevant macros that are called there are either defined in standard.bbx or biblatex.def.



          In biblatex 3.12 the driver for @article can be found in ll. 26-62 of standard.bbx. journal+issuetitle is in ll. 746-761 and note+pages in ll. 857-861.






          share|improve this answer


























          • Thanks! It works perfectly

            – M.O.
            2 days ago
















          4














          The pages are added again, because they are printed by the macro note+pages in the driver for @article. If you also print the pages in journal+issuetitle, you need to suppress the pages in note+pages.



          The redefinition of journal+issuetitle below is based on the standard definition from standard.bbx. The only change is the added pages printing.



          Note that it is usually bad style to have bare parentheses like ( and ) in setunit. In my solution below, I used the ready-made macro issue+date that adds the parentheses and takes care of a few other things as well.



          documentclass[british]{article}
          usepackage[T1]{fontenc}
          usepackage[utf8]{inputenc}
          usepackage{babel}
          usepackage{csquotes}

          usepackage[style=numeric, backend=biber]{biblatex}

          DeclareFieldFormat[article,periodical]{pages}{#1}

          renewbibmacro*{journal+issuetitle}{%
          usebibmacro{journal}%
          setunit*{addspace}%
          iffieldundef{series}
          {}
          {newunit
          printfield{series}%
          setunit{addspace}}%
          usebibmacro{volume+number+eid}%
          setunit{bibpagespunct}%
          printfield{pages}%
          setunit{addspace}%
          usebibmacro{issue+date}%
          setunit{addcolonspace}%
          usebibmacro{issue}%
          newunit}

          renewbibmacro*{note+pages}{%
          printfield{note}%
          newunit}

          addbibresource{biblatex-examples.bib}


          begin{document}
          cite{sigfridsson}
          printbibliography
          end{document}


          Emma Sigfridsson and Ulf Ryde. ‘Comparison of methods for deriving atomic charges from the electrostatic potential and moments’. In: Journal of Computational Chemistry 19.4, 377–395 (1998). doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P.





          If you want to understand how these macros work and why other stuff is printed, you should have a look at the bibliography drivers in standard.bbx, most relevant macros that are called there are either defined in standard.bbx or biblatex.def.



          In biblatex 3.12 the driver for @article can be found in ll. 26-62 of standard.bbx. journal+issuetitle is in ll. 746-761 and note+pages in ll. 857-861.






          share|improve this answer


























          • Thanks! It works perfectly

            – M.O.
            2 days ago














          4












          4








          4







          The pages are added again, because they are printed by the macro note+pages in the driver for @article. If you also print the pages in journal+issuetitle, you need to suppress the pages in note+pages.



          The redefinition of journal+issuetitle below is based on the standard definition from standard.bbx. The only change is the added pages printing.



          Note that it is usually bad style to have bare parentheses like ( and ) in setunit. In my solution below, I used the ready-made macro issue+date that adds the parentheses and takes care of a few other things as well.



          documentclass[british]{article}
          usepackage[T1]{fontenc}
          usepackage[utf8]{inputenc}
          usepackage{babel}
          usepackage{csquotes}

          usepackage[style=numeric, backend=biber]{biblatex}

          DeclareFieldFormat[article,periodical]{pages}{#1}

          renewbibmacro*{journal+issuetitle}{%
          usebibmacro{journal}%
          setunit*{addspace}%
          iffieldundef{series}
          {}
          {newunit
          printfield{series}%
          setunit{addspace}}%
          usebibmacro{volume+number+eid}%
          setunit{bibpagespunct}%
          printfield{pages}%
          setunit{addspace}%
          usebibmacro{issue+date}%
          setunit{addcolonspace}%
          usebibmacro{issue}%
          newunit}

          renewbibmacro*{note+pages}{%
          printfield{note}%
          newunit}

          addbibresource{biblatex-examples.bib}


          begin{document}
          cite{sigfridsson}
          printbibliography
          end{document}


          Emma Sigfridsson and Ulf Ryde. ‘Comparison of methods for deriving atomic charges from the electrostatic potential and moments’. In: Journal of Computational Chemistry 19.4, 377–395 (1998). doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P.





          If you want to understand how these macros work and why other stuff is printed, you should have a look at the bibliography drivers in standard.bbx, most relevant macros that are called there are either defined in standard.bbx or biblatex.def.



          In biblatex 3.12 the driver for @article can be found in ll. 26-62 of standard.bbx. journal+issuetitle is in ll. 746-761 and note+pages in ll. 857-861.






          share|improve this answer















          The pages are added again, because they are printed by the macro note+pages in the driver for @article. If you also print the pages in journal+issuetitle, you need to suppress the pages in note+pages.



          The redefinition of journal+issuetitle below is based on the standard definition from standard.bbx. The only change is the added pages printing.



          Note that it is usually bad style to have bare parentheses like ( and ) in setunit. In my solution below, I used the ready-made macro issue+date that adds the parentheses and takes care of a few other things as well.



          documentclass[british]{article}
          usepackage[T1]{fontenc}
          usepackage[utf8]{inputenc}
          usepackage{babel}
          usepackage{csquotes}

          usepackage[style=numeric, backend=biber]{biblatex}

          DeclareFieldFormat[article,periodical]{pages}{#1}

          renewbibmacro*{journal+issuetitle}{%
          usebibmacro{journal}%
          setunit*{addspace}%
          iffieldundef{series}
          {}
          {newunit
          printfield{series}%
          setunit{addspace}}%
          usebibmacro{volume+number+eid}%
          setunit{bibpagespunct}%
          printfield{pages}%
          setunit{addspace}%
          usebibmacro{issue+date}%
          setunit{addcolonspace}%
          usebibmacro{issue}%
          newunit}

          renewbibmacro*{note+pages}{%
          printfield{note}%
          newunit}

          addbibresource{biblatex-examples.bib}


          begin{document}
          cite{sigfridsson}
          printbibliography
          end{document}


          Emma Sigfridsson and Ulf Ryde. ‘Comparison of methods for deriving atomic charges from the electrostatic potential and moments’. In: Journal of Computational Chemistry 19.4, 377–395 (1998). doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P.





          If you want to understand how these macros work and why other stuff is printed, you should have a look at the bibliography drivers in standard.bbx, most relevant macros that are called there are either defined in standard.bbx or biblatex.def.



          In biblatex 3.12 the driver for @article can be found in ll. 26-62 of standard.bbx. journal+issuetitle is in ll. 746-761 and note+pages in ll. 857-861.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 2 days ago

























          answered 2 days ago









          moewemoewe

          88k9110335




          88k9110335













          • Thanks! It works perfectly

            – M.O.
            2 days ago



















          • Thanks! It works perfectly

            – M.O.
            2 days ago

















          Thanks! It works perfectly

          – M.O.
          2 days ago





          Thanks! It works perfectly

          – M.O.
          2 days ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469831%2fchange-position-of-year-in-reference-biblatex-biber%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

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          RAC Tourist Trophy