Modifying citation commandBeamer, Citation coloringBiblatex supercite command with use of square brackets...

Case protection with emphasis in biblatex

Can a player sacrifice a creature after declaring that creature as blocker while taking lethal damage?

Is there any way to make an Apex method parameter lazy?

hrule into tikz circle node

Critique vs nitpicking

Boss asked me to sign a resignation paper without a date on it along with my new contract

Where does documentation like business and software requirement spec docs fit in an agile project?

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?

Sitecore 9.1 Installation - Skip to particular step

How to write cases in LaTeX?

Is `Object` a function in javascript?

What is a good reason for every spaceship to carry gun on board?

Allow console draw poker game to output more hands

Why some papers can be published in top-tier journals while others cannot?

How do I avoid the "chosen hero" feeling?

What does からか mean?

Illustrator to chemdraw

Word for something that's always reliable, but never the best?

Coworker asking me to not bring cakes due to self control issue. What should I do?

How to deal with an underperforming subordinate?

Is Screenshot Time-tracking Common?

How to completely remove a package in Ubuntu (like it never existed)

Why do neural networks need so many examples to perform?

What kind of places would goblins live in a fantasy setting with strong states?



Modifying citation command


Beamer, Citation coloringBiblatex supercite command with use of square brackets (like a reference style in Wikipedia)Citation format and style in biberCustomized Citation StyleHyperref: linkg full citationBibLaTeX: Custom citation command for softwaresProblem with citation on the following pageCitation of Books vs. Patents using verbose styleHow to (properly) remove the parentheses around the year in authoryear style? (v3)citations not rendering correctly with biblatexMake custom citation command link to bibliography entry













0















I am using the code provided in this question regarding coloring citations.



The problem is that I don't know how to make (redefine) the cite command to add parentheses around the year










share|improve this question





























    0















    I am using the code provided in this question regarding coloring citations.



    The problem is that I don't know how to make (redefine) the cite command to add parentheses around the year










    share|improve this question



























      0












      0








      0








      I am using the code provided in this question regarding coloring citations.



      The problem is that I don't know how to make (redefine) the cite command to add parentheses around the year










      share|improve this question
















      I am using the code provided in this question regarding coloring citations.



      The problem is that I don't know how to make (redefine) the cite command to add parentheses around the year







      biblatex






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago









      moewe

      91.9k10115347




      91.9k10115347










      asked 4 hours ago









      YorgosYorgos

      1,32511525




      1,32511525






















          1 Answer
          1






          active

          oldest

          votes


















          3














          Here is a simple hack, defining a colortextcite command, based on textcite:



          documentclass[presentation]{beamer}

          usepackage[backend=biber, uniquename=false, maxbibnames=99, maxcitenames=2, citestyle=authoryear, bibstyle=authoryear]{biblatex}

          addbibresource{references.bib}

          DeclareCiteCommand{cite}
          {color{red}usebibmacro{prenote}}%
          {usebibmacro{citeindex}%
          usebibmacro{cite}}
          {multicitedelim}
          {usebibmacro{postnote}}

          DeclareCiteCommand{parencite}[mkcolorbibparens]
          {usebibmacro{prenote}}%
          {usebibmacro{citeindex}%
          usebibmacro{cite}}
          {multicitedelim}
          {usebibmacro{postnote}}

          makeatletter
          newrobustcmd{mkcolorbibparens}[1]{%
          begingroup
          color{red}%
          blx@blxinit
          blx@setsfcodes
          bibopenparen#1bibcloseparen
          endgroup}
          makeatother

          usepackage{filecontents}
          begin{filecontents}{references.bib}
          @Book{bartolini-mair-1990,
          author = {Bartolini, Stefano AND Mair, Peter},
          title = {Identity, Competition and Electoral Availability. The Stabilization of European Electorates 1885-1985},
          publisher = {Cambridge University Press},
          year = 1990,
          address = {Cambridge},
          }
          end{filecontents}

          newcommand{colortextcite}[1]{textcolor{red}{textcite{#1}}}

          begin{document}

          begin{frame}
          Text cite{bartolini-mair-1990} text

          Text parencite{bartolini-mair-1990} text

          Text colortextcite{bartolini-mair-1990} text
          end{frame}

          begin{frame}
          printbibliography
          end{frame}

          end{document}


          enter image description here






          share|improve this answer
























          • i need to learn how to create my own command/macros...the problem is that i don't know where to start and i don't understand their syntax (e.g. in your hack i don't understand the purpose of [1] and #1

            – Yorgos
            3 hours ago











          • [1] is the number of arguments of the macro, and inside the definition of the macro, #1 denotes this argument (which here is replaced by the biblatex key). This being said, you can find lots of tutorials on tug.org.

            – Bernard
            2 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%2f476576%2fmodifying-citation-command%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














          Here is a simple hack, defining a colortextcite command, based on textcite:



          documentclass[presentation]{beamer}

          usepackage[backend=biber, uniquename=false, maxbibnames=99, maxcitenames=2, citestyle=authoryear, bibstyle=authoryear]{biblatex}

          addbibresource{references.bib}

          DeclareCiteCommand{cite}
          {color{red}usebibmacro{prenote}}%
          {usebibmacro{citeindex}%
          usebibmacro{cite}}
          {multicitedelim}
          {usebibmacro{postnote}}

          DeclareCiteCommand{parencite}[mkcolorbibparens]
          {usebibmacro{prenote}}%
          {usebibmacro{citeindex}%
          usebibmacro{cite}}
          {multicitedelim}
          {usebibmacro{postnote}}

          makeatletter
          newrobustcmd{mkcolorbibparens}[1]{%
          begingroup
          color{red}%
          blx@blxinit
          blx@setsfcodes
          bibopenparen#1bibcloseparen
          endgroup}
          makeatother

          usepackage{filecontents}
          begin{filecontents}{references.bib}
          @Book{bartolini-mair-1990,
          author = {Bartolini, Stefano AND Mair, Peter},
          title = {Identity, Competition and Electoral Availability. The Stabilization of European Electorates 1885-1985},
          publisher = {Cambridge University Press},
          year = 1990,
          address = {Cambridge},
          }
          end{filecontents}

          newcommand{colortextcite}[1]{textcolor{red}{textcite{#1}}}

          begin{document}

          begin{frame}
          Text cite{bartolini-mair-1990} text

          Text parencite{bartolini-mair-1990} text

          Text colortextcite{bartolini-mair-1990} text
          end{frame}

          begin{frame}
          printbibliography
          end{frame}

          end{document}


          enter image description here






          share|improve this answer
























          • i need to learn how to create my own command/macros...the problem is that i don't know where to start and i don't understand their syntax (e.g. in your hack i don't understand the purpose of [1] and #1

            – Yorgos
            3 hours ago











          • [1] is the number of arguments of the macro, and inside the definition of the macro, #1 denotes this argument (which here is replaced by the biblatex key). This being said, you can find lots of tutorials on tug.org.

            – Bernard
            2 hours ago


















          3














          Here is a simple hack, defining a colortextcite command, based on textcite:



          documentclass[presentation]{beamer}

          usepackage[backend=biber, uniquename=false, maxbibnames=99, maxcitenames=2, citestyle=authoryear, bibstyle=authoryear]{biblatex}

          addbibresource{references.bib}

          DeclareCiteCommand{cite}
          {color{red}usebibmacro{prenote}}%
          {usebibmacro{citeindex}%
          usebibmacro{cite}}
          {multicitedelim}
          {usebibmacro{postnote}}

          DeclareCiteCommand{parencite}[mkcolorbibparens]
          {usebibmacro{prenote}}%
          {usebibmacro{citeindex}%
          usebibmacro{cite}}
          {multicitedelim}
          {usebibmacro{postnote}}

          makeatletter
          newrobustcmd{mkcolorbibparens}[1]{%
          begingroup
          color{red}%
          blx@blxinit
          blx@setsfcodes
          bibopenparen#1bibcloseparen
          endgroup}
          makeatother

          usepackage{filecontents}
          begin{filecontents}{references.bib}
          @Book{bartolini-mair-1990,
          author = {Bartolini, Stefano AND Mair, Peter},
          title = {Identity, Competition and Electoral Availability. The Stabilization of European Electorates 1885-1985},
          publisher = {Cambridge University Press},
          year = 1990,
          address = {Cambridge},
          }
          end{filecontents}

          newcommand{colortextcite}[1]{textcolor{red}{textcite{#1}}}

          begin{document}

          begin{frame}
          Text cite{bartolini-mair-1990} text

          Text parencite{bartolini-mair-1990} text

          Text colortextcite{bartolini-mair-1990} text
          end{frame}

          begin{frame}
          printbibliography
          end{frame}

          end{document}


          enter image description here






          share|improve this answer
























          • i need to learn how to create my own command/macros...the problem is that i don't know where to start and i don't understand their syntax (e.g. in your hack i don't understand the purpose of [1] and #1

            – Yorgos
            3 hours ago











          • [1] is the number of arguments of the macro, and inside the definition of the macro, #1 denotes this argument (which here is replaced by the biblatex key). This being said, you can find lots of tutorials on tug.org.

            – Bernard
            2 hours ago
















          3












          3








          3







          Here is a simple hack, defining a colortextcite command, based on textcite:



          documentclass[presentation]{beamer}

          usepackage[backend=biber, uniquename=false, maxbibnames=99, maxcitenames=2, citestyle=authoryear, bibstyle=authoryear]{biblatex}

          addbibresource{references.bib}

          DeclareCiteCommand{cite}
          {color{red}usebibmacro{prenote}}%
          {usebibmacro{citeindex}%
          usebibmacro{cite}}
          {multicitedelim}
          {usebibmacro{postnote}}

          DeclareCiteCommand{parencite}[mkcolorbibparens]
          {usebibmacro{prenote}}%
          {usebibmacro{citeindex}%
          usebibmacro{cite}}
          {multicitedelim}
          {usebibmacro{postnote}}

          makeatletter
          newrobustcmd{mkcolorbibparens}[1]{%
          begingroup
          color{red}%
          blx@blxinit
          blx@setsfcodes
          bibopenparen#1bibcloseparen
          endgroup}
          makeatother

          usepackage{filecontents}
          begin{filecontents}{references.bib}
          @Book{bartolini-mair-1990,
          author = {Bartolini, Stefano AND Mair, Peter},
          title = {Identity, Competition and Electoral Availability. The Stabilization of European Electorates 1885-1985},
          publisher = {Cambridge University Press},
          year = 1990,
          address = {Cambridge},
          }
          end{filecontents}

          newcommand{colortextcite}[1]{textcolor{red}{textcite{#1}}}

          begin{document}

          begin{frame}
          Text cite{bartolini-mair-1990} text

          Text parencite{bartolini-mair-1990} text

          Text colortextcite{bartolini-mair-1990} text
          end{frame}

          begin{frame}
          printbibliography
          end{frame}

          end{document}


          enter image description here






          share|improve this answer













          Here is a simple hack, defining a colortextcite command, based on textcite:



          documentclass[presentation]{beamer}

          usepackage[backend=biber, uniquename=false, maxbibnames=99, maxcitenames=2, citestyle=authoryear, bibstyle=authoryear]{biblatex}

          addbibresource{references.bib}

          DeclareCiteCommand{cite}
          {color{red}usebibmacro{prenote}}%
          {usebibmacro{citeindex}%
          usebibmacro{cite}}
          {multicitedelim}
          {usebibmacro{postnote}}

          DeclareCiteCommand{parencite}[mkcolorbibparens]
          {usebibmacro{prenote}}%
          {usebibmacro{citeindex}%
          usebibmacro{cite}}
          {multicitedelim}
          {usebibmacro{postnote}}

          makeatletter
          newrobustcmd{mkcolorbibparens}[1]{%
          begingroup
          color{red}%
          blx@blxinit
          blx@setsfcodes
          bibopenparen#1bibcloseparen
          endgroup}
          makeatother

          usepackage{filecontents}
          begin{filecontents}{references.bib}
          @Book{bartolini-mair-1990,
          author = {Bartolini, Stefano AND Mair, Peter},
          title = {Identity, Competition and Electoral Availability. The Stabilization of European Electorates 1885-1985},
          publisher = {Cambridge University Press},
          year = 1990,
          address = {Cambridge},
          }
          end{filecontents}

          newcommand{colortextcite}[1]{textcolor{red}{textcite{#1}}}

          begin{document}

          begin{frame}
          Text cite{bartolini-mair-1990} text

          Text parencite{bartolini-mair-1990} text

          Text colortextcite{bartolini-mair-1990} text
          end{frame}

          begin{frame}
          printbibliography
          end{frame}

          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 3 hours ago









          BernardBernard

          171k775202




          171k775202













          • i need to learn how to create my own command/macros...the problem is that i don't know where to start and i don't understand their syntax (e.g. in your hack i don't understand the purpose of [1] and #1

            – Yorgos
            3 hours ago











          • [1] is the number of arguments of the macro, and inside the definition of the macro, #1 denotes this argument (which here is replaced by the biblatex key). This being said, you can find lots of tutorials on tug.org.

            – Bernard
            2 hours ago





















          • i need to learn how to create my own command/macros...the problem is that i don't know where to start and i don't understand their syntax (e.g. in your hack i don't understand the purpose of [1] and #1

            – Yorgos
            3 hours ago











          • [1] is the number of arguments of the macro, and inside the definition of the macro, #1 denotes this argument (which here is replaced by the biblatex key). This being said, you can find lots of tutorials on tug.org.

            – Bernard
            2 hours ago



















          i need to learn how to create my own command/macros...the problem is that i don't know where to start and i don't understand their syntax (e.g. in your hack i don't understand the purpose of [1] and #1

          – Yorgos
          3 hours ago





          i need to learn how to create my own command/macros...the problem is that i don't know where to start and i don't understand their syntax (e.g. in your hack i don't understand the purpose of [1] and #1

          – Yorgos
          3 hours ago













          [1] is the number of arguments of the macro, and inside the definition of the macro, #1 denotes this argument (which here is replaced by the biblatex key). This being said, you can find lots of tutorials on tug.org.

          – Bernard
          2 hours ago







          [1] is the number of arguments of the macro, and inside the definition of the macro, #1 denotes this argument (which here is replaced by the biblatex key). This being said, you can find lots of tutorials on tug.org.

          – Bernard
          2 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%2f476576%2fmodifying-citation-command%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

          Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

          Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

          How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...