Biblatex, APA style, hyperlink parencite not displaying author on 2nd cite












3















I'm having trouble with my code.
I'd like the 2nd parencite to also include the authors name.



The DeclareCiteCommand is causing the authors name to be absent after the first cite



documentclass{article}

begin{filecontents}{jobname.bib}
@misc{A01,
author = {Sutherland and Varnam},
year = {2001},
title = {Title},
}
end{filecontents}

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

addbibresource{jobname.bib}

DeclareCiteCommand{parencite}[mkbibparens]
{usebibmacro{prenote}}
{usebibmacro{citeindex}%
printtext[bibhyperref]{usebibmacro{cite}}}
{multicitedelim}
{usebibmacro{postnote}}

usepackage{hyperref}

begin{document}

First cite parencite{A01}.

Second cite parencite{A01}.

printbibliography

end{document}









share|improve this question





























    3















    I'm having trouble with my code.
    I'd like the 2nd parencite to also include the authors name.



    The DeclareCiteCommand is causing the authors name to be absent after the first cite



    documentclass{article}

    begin{filecontents}{jobname.bib}
    @misc{A01,
    author = {Sutherland and Varnam},
    year = {2001},
    title = {Title},
    }
    end{filecontents}

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

    addbibresource{jobname.bib}

    DeclareCiteCommand{parencite}[mkbibparens]
    {usebibmacro{prenote}}
    {usebibmacro{citeindex}%
    printtext[bibhyperref]{usebibmacro{cite}}}
    {multicitedelim}
    {usebibmacro{postnote}}

    usepackage{hyperref}

    begin{document}

    First cite parencite{A01}.

    Second cite parencite{A01}.

    printbibliography

    end{document}









    share|improve this question



























      3












      3








      3








      I'm having trouble with my code.
      I'd like the 2nd parencite to also include the authors name.



      The DeclareCiteCommand is causing the authors name to be absent after the first cite



      documentclass{article}

      begin{filecontents}{jobname.bib}
      @misc{A01,
      author = {Sutherland and Varnam},
      year = {2001},
      title = {Title},
      }
      end{filecontents}

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

      addbibresource{jobname.bib}

      DeclareCiteCommand{parencite}[mkbibparens]
      {usebibmacro{prenote}}
      {usebibmacro{citeindex}%
      printtext[bibhyperref]{usebibmacro{cite}}}
      {multicitedelim}
      {usebibmacro{postnote}}

      usepackage{hyperref}

      begin{document}

      First cite parencite{A01}.

      Second cite parencite{A01}.

      printbibliography

      end{document}









      share|improve this question
















      I'm having trouble with my code.
      I'd like the 2nd parencite to also include the authors name.



      The DeclareCiteCommand is causing the authors name to be absent after the first cite



      documentclass{article}

      begin{filecontents}{jobname.bib}
      @misc{A01,
      author = {Sutherland and Varnam},
      year = {2001},
      title = {Title},
      }
      end{filecontents}

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

      addbibresource{jobname.bib}

      DeclareCiteCommand{parencite}[mkbibparens]
      {usebibmacro{prenote}}
      {usebibmacro{citeindex}%
      printtext[bibhyperref]{usebibmacro{cite}}}
      {multicitedelim}
      {usebibmacro{postnote}}

      usepackage{hyperref}

      begin{document}

      First cite parencite{A01}.

      Second cite parencite{A01}.

      printbibliography

      end{document}






      biblatex hyperref apa-style






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 29 '18 at 20:33









      Stefan Pinnow

      20.3k83578




      20.3k83578










      asked Oct 29 '18 at 20:29









      SocadilloSocadillo

      182




      182






















          1 Answer
          1






          active

          oldest

          votes


















          3














          biblatex-apa defines parencite slightly different than the redefinition in your example assumes. That definition works for some of the standard styles, but not for more complicated styles like authoryear-icomp and apa.



          For apa you need



          documentclass{article}

          usepackage[style=apa,backend=biber]{biblatex}
          usepackage{hyperref}

          addbibresource{biblatex-examples.bib}

          DeclareFieldFormat{bibhyperrefnonest}{%
          DeclareFieldFormat{bibhyperref}{##1}%
          bibhyperref{#1}}

          DeclareCiteCommand{parencite}[mkbibparens]
          {usebibmacro{cite:init}%
          usebibmacro{prenote}}
          {usebibmacro{citeindex}%
          printtext[bibhyperrefnonest]{usebibmacro{cite}}}
          {}
          {usebibmacro{postnote}%
          usebibmacro{cite:post}}

          DeclareCiteCommand{textcite}
          {usebibmacro{cite:init}%
          usebibmacro{prenote}}
          {usebibmacro{citeindex}%
          printtext[bibhyperrefnonest]{usebibmacro{textcite}}}
          {}
          {usebibmacro{textcite:postnote}%
          usebibmacro{cite:post}}


          begin{document}
          First cite parencite{sigfridsson}.

          Second cite parencite{sigfridsson}.

          citereset

          First cite textcite{sigfridsson}.

          Second cite textcite{sigfridsson}.

          printbibliography
          end{document}


          The MWE shows both citations with links and identical text "Sigfridsson & Ryde, 1998"



          edit: Added a redefinition for textcite as well. Note that the parentheses in textcite may not be linked as expected. Fixing that would be much more complicated.






          share|improve this answer


























          • I had the same issue and your answer solved it for me, Moewe. Do you know of a similar workaround for the textcite command by any chance? Thanks in advance!

            – Michiel Schreurs
            6 hours ago











          • @MichielSchreurs See the edit for the analogue redefinition of textcite. Note that that might not give exactly what you want w.r.t. the parentheses. Getting the links right there is much more complicated. If you want that you can ask a new question.

            – moewe
            4 hours 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%2f457411%2fbiblatex-apa-style-hyperlink-parencite-not-displaying-author-on-2nd-cite%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









          3














          biblatex-apa defines parencite slightly different than the redefinition in your example assumes. That definition works for some of the standard styles, but not for more complicated styles like authoryear-icomp and apa.



          For apa you need



          documentclass{article}

          usepackage[style=apa,backend=biber]{biblatex}
          usepackage{hyperref}

          addbibresource{biblatex-examples.bib}

          DeclareFieldFormat{bibhyperrefnonest}{%
          DeclareFieldFormat{bibhyperref}{##1}%
          bibhyperref{#1}}

          DeclareCiteCommand{parencite}[mkbibparens]
          {usebibmacro{cite:init}%
          usebibmacro{prenote}}
          {usebibmacro{citeindex}%
          printtext[bibhyperrefnonest]{usebibmacro{cite}}}
          {}
          {usebibmacro{postnote}%
          usebibmacro{cite:post}}

          DeclareCiteCommand{textcite}
          {usebibmacro{cite:init}%
          usebibmacro{prenote}}
          {usebibmacro{citeindex}%
          printtext[bibhyperrefnonest]{usebibmacro{textcite}}}
          {}
          {usebibmacro{textcite:postnote}%
          usebibmacro{cite:post}}


          begin{document}
          First cite parencite{sigfridsson}.

          Second cite parencite{sigfridsson}.

          citereset

          First cite textcite{sigfridsson}.

          Second cite textcite{sigfridsson}.

          printbibliography
          end{document}


          The MWE shows both citations with links and identical text "Sigfridsson & Ryde, 1998"



          edit: Added a redefinition for textcite as well. Note that the parentheses in textcite may not be linked as expected. Fixing that would be much more complicated.






          share|improve this answer


























          • I had the same issue and your answer solved it for me, Moewe. Do you know of a similar workaround for the textcite command by any chance? Thanks in advance!

            – Michiel Schreurs
            6 hours ago











          • @MichielSchreurs See the edit for the analogue redefinition of textcite. Note that that might not give exactly what you want w.r.t. the parentheses. Getting the links right there is much more complicated. If you want that you can ask a new question.

            – moewe
            4 hours ago
















          3














          biblatex-apa defines parencite slightly different than the redefinition in your example assumes. That definition works for some of the standard styles, but not for more complicated styles like authoryear-icomp and apa.



          For apa you need



          documentclass{article}

          usepackage[style=apa,backend=biber]{biblatex}
          usepackage{hyperref}

          addbibresource{biblatex-examples.bib}

          DeclareFieldFormat{bibhyperrefnonest}{%
          DeclareFieldFormat{bibhyperref}{##1}%
          bibhyperref{#1}}

          DeclareCiteCommand{parencite}[mkbibparens]
          {usebibmacro{cite:init}%
          usebibmacro{prenote}}
          {usebibmacro{citeindex}%
          printtext[bibhyperrefnonest]{usebibmacro{cite}}}
          {}
          {usebibmacro{postnote}%
          usebibmacro{cite:post}}

          DeclareCiteCommand{textcite}
          {usebibmacro{cite:init}%
          usebibmacro{prenote}}
          {usebibmacro{citeindex}%
          printtext[bibhyperrefnonest]{usebibmacro{textcite}}}
          {}
          {usebibmacro{textcite:postnote}%
          usebibmacro{cite:post}}


          begin{document}
          First cite parencite{sigfridsson}.

          Second cite parencite{sigfridsson}.

          citereset

          First cite textcite{sigfridsson}.

          Second cite textcite{sigfridsson}.

          printbibliography
          end{document}


          The MWE shows both citations with links and identical text "Sigfridsson & Ryde, 1998"



          edit: Added a redefinition for textcite as well. Note that the parentheses in textcite may not be linked as expected. Fixing that would be much more complicated.






          share|improve this answer


























          • I had the same issue and your answer solved it for me, Moewe. Do you know of a similar workaround for the textcite command by any chance? Thanks in advance!

            – Michiel Schreurs
            6 hours ago











          • @MichielSchreurs See the edit for the analogue redefinition of textcite. Note that that might not give exactly what you want w.r.t. the parentheses. Getting the links right there is much more complicated. If you want that you can ask a new question.

            – moewe
            4 hours ago














          3












          3








          3







          biblatex-apa defines parencite slightly different than the redefinition in your example assumes. That definition works for some of the standard styles, but not for more complicated styles like authoryear-icomp and apa.



          For apa you need



          documentclass{article}

          usepackage[style=apa,backend=biber]{biblatex}
          usepackage{hyperref}

          addbibresource{biblatex-examples.bib}

          DeclareFieldFormat{bibhyperrefnonest}{%
          DeclareFieldFormat{bibhyperref}{##1}%
          bibhyperref{#1}}

          DeclareCiteCommand{parencite}[mkbibparens]
          {usebibmacro{cite:init}%
          usebibmacro{prenote}}
          {usebibmacro{citeindex}%
          printtext[bibhyperrefnonest]{usebibmacro{cite}}}
          {}
          {usebibmacro{postnote}%
          usebibmacro{cite:post}}

          DeclareCiteCommand{textcite}
          {usebibmacro{cite:init}%
          usebibmacro{prenote}}
          {usebibmacro{citeindex}%
          printtext[bibhyperrefnonest]{usebibmacro{textcite}}}
          {}
          {usebibmacro{textcite:postnote}%
          usebibmacro{cite:post}}


          begin{document}
          First cite parencite{sigfridsson}.

          Second cite parencite{sigfridsson}.

          citereset

          First cite textcite{sigfridsson}.

          Second cite textcite{sigfridsson}.

          printbibliography
          end{document}


          The MWE shows both citations with links and identical text "Sigfridsson & Ryde, 1998"



          edit: Added a redefinition for textcite as well. Note that the parentheses in textcite may not be linked as expected. Fixing that would be much more complicated.






          share|improve this answer















          biblatex-apa defines parencite slightly different than the redefinition in your example assumes. That definition works for some of the standard styles, but not for more complicated styles like authoryear-icomp and apa.



          For apa you need



          documentclass{article}

          usepackage[style=apa,backend=biber]{biblatex}
          usepackage{hyperref}

          addbibresource{biblatex-examples.bib}

          DeclareFieldFormat{bibhyperrefnonest}{%
          DeclareFieldFormat{bibhyperref}{##1}%
          bibhyperref{#1}}

          DeclareCiteCommand{parencite}[mkbibparens]
          {usebibmacro{cite:init}%
          usebibmacro{prenote}}
          {usebibmacro{citeindex}%
          printtext[bibhyperrefnonest]{usebibmacro{cite}}}
          {}
          {usebibmacro{postnote}%
          usebibmacro{cite:post}}

          DeclareCiteCommand{textcite}
          {usebibmacro{cite:init}%
          usebibmacro{prenote}}
          {usebibmacro{citeindex}%
          printtext[bibhyperrefnonest]{usebibmacro{textcite}}}
          {}
          {usebibmacro{textcite:postnote}%
          usebibmacro{cite:post}}


          begin{document}
          First cite parencite{sigfridsson}.

          Second cite parencite{sigfridsson}.

          citereset

          First cite textcite{sigfridsson}.

          Second cite textcite{sigfridsson}.

          printbibliography
          end{document}


          The MWE shows both citations with links and identical text "Sigfridsson & Ryde, 1998"



          edit: Added a redefinition for textcite as well. Note that the parentheses in textcite may not be linked as expected. Fixing that would be much more complicated.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 4 hours ago

























          answered Oct 29 '18 at 20:49









          moewemoewe

          96.5k10118362




          96.5k10118362













          • I had the same issue and your answer solved it for me, Moewe. Do you know of a similar workaround for the textcite command by any chance? Thanks in advance!

            – Michiel Schreurs
            6 hours ago











          • @MichielSchreurs See the edit for the analogue redefinition of textcite. Note that that might not give exactly what you want w.r.t. the parentheses. Getting the links right there is much more complicated. If you want that you can ask a new question.

            – moewe
            4 hours ago



















          • I had the same issue and your answer solved it for me, Moewe. Do you know of a similar workaround for the textcite command by any chance? Thanks in advance!

            – Michiel Schreurs
            6 hours ago











          • @MichielSchreurs See the edit for the analogue redefinition of textcite. Note that that might not give exactly what you want w.r.t. the parentheses. Getting the links right there is much more complicated. If you want that you can ask a new question.

            – moewe
            4 hours ago

















          I had the same issue and your answer solved it for me, Moewe. Do you know of a similar workaround for the textcite command by any chance? Thanks in advance!

          – Michiel Schreurs
          6 hours ago





          I had the same issue and your answer solved it for me, Moewe. Do you know of a similar workaround for the textcite command by any chance? Thanks in advance!

          – Michiel Schreurs
          6 hours ago













          @MichielSchreurs See the edit for the analogue redefinition of textcite. Note that that might not give exactly what you want w.r.t. the parentheses. Getting the links right there is much more complicated. If you want that you can ask a new question.

          – moewe
          4 hours ago





          @MichielSchreurs See the edit for the analogue redefinition of textcite. Note that that might not give exactly what you want w.r.t. the parentheses. Getting the links right there is much more complicated. If you want that you can ask a new question.

          – moewe
          4 hours 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%2f457411%2fbiblatex-apa-style-hyperlink-parencite-not-displaying-author-on-2nd-cite%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

          Lallio

          Futebolista

          Jornalista