Commutative diagramm (tikzcd) in margin











up vote
1
down vote

favorite












The following example gives me an error



documentclass[12pt,oneside]{report}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[french]{babel}
usepackage[a4paper,
inner=10mm,
outer=60mm,
top=20mm,
bottom=25mm,
marginparsep=10mm,
marginparwidth=40mm]{geometry}

usepackage{tikz}
usepackage{tikz-cd}

begin{document}

foo
marginpar{
begin{tikzcd}
E
arrow[bend right=50]{rr}[,label=below:scriptsize $gcirc f$]{}
arrow[r]{}[,label=above:scriptsize $f$]{}
& F
arrow[r]{}[,label=above:scriptsize $g$]{}
& G
end{tikzcd}
}
bar

end{document}


while the commutative diagramm is compiling correctly when it's not in the margin.



Error is :




! Undefined control sequence.
pgf@matrix@last@nextcell@options ! Package pgf Error: Single
ampersand used with wrong catcode.











share|improve this question


























    up vote
    1
    down vote

    favorite












    The following example gives me an error



    documentclass[12pt,oneside]{report}
    usepackage[utf8]{inputenc}
    usepackage[T1]{fontenc}
    usepackage[french]{babel}
    usepackage[a4paper,
    inner=10mm,
    outer=60mm,
    top=20mm,
    bottom=25mm,
    marginparsep=10mm,
    marginparwidth=40mm]{geometry}

    usepackage{tikz}
    usepackage{tikz-cd}

    begin{document}

    foo
    marginpar{
    begin{tikzcd}
    E
    arrow[bend right=50]{rr}[,label=below:scriptsize $gcirc f$]{}
    arrow[r]{}[,label=above:scriptsize $f$]{}
    & F
    arrow[r]{}[,label=above:scriptsize $g$]{}
    & G
    end{tikzcd}
    }
    bar

    end{document}


    while the commutative diagramm is compiling correctly when it's not in the margin.



    Error is :




    ! Undefined control sequence.
    pgf@matrix@last@nextcell@options ! Package pgf Error: Single
    ampersand used with wrong catcode.











    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      The following example gives me an error



      documentclass[12pt,oneside]{report}
      usepackage[utf8]{inputenc}
      usepackage[T1]{fontenc}
      usepackage[french]{babel}
      usepackage[a4paper,
      inner=10mm,
      outer=60mm,
      top=20mm,
      bottom=25mm,
      marginparsep=10mm,
      marginparwidth=40mm]{geometry}

      usepackage{tikz}
      usepackage{tikz-cd}

      begin{document}

      foo
      marginpar{
      begin{tikzcd}
      E
      arrow[bend right=50]{rr}[,label=below:scriptsize $gcirc f$]{}
      arrow[r]{}[,label=above:scriptsize $f$]{}
      & F
      arrow[r]{}[,label=above:scriptsize $g$]{}
      & G
      end{tikzcd}
      }
      bar

      end{document}


      while the commutative diagramm is compiling correctly when it's not in the margin.



      Error is :




      ! Undefined control sequence.
      pgf@matrix@last@nextcell@options ! Package pgf Error: Single
      ampersand used with wrong catcode.











      share|improve this question













      The following example gives me an error



      documentclass[12pt,oneside]{report}
      usepackage[utf8]{inputenc}
      usepackage[T1]{fontenc}
      usepackage[french]{babel}
      usepackage[a4paper,
      inner=10mm,
      outer=60mm,
      top=20mm,
      bottom=25mm,
      marginparsep=10mm,
      marginparwidth=40mm]{geometry}

      usepackage{tikz}
      usepackage{tikz-cd}

      begin{document}

      foo
      marginpar{
      begin{tikzcd}
      E
      arrow[bend right=50]{rr}[,label=below:scriptsize $gcirc f$]{}
      arrow[r]{}[,label=above:scriptsize $f$]{}
      & F
      arrow[r]{}[,label=above:scriptsize $g$]{}
      & G
      end{tikzcd}
      }
      bar

      end{document}


      while the commutative diagramm is compiling correctly when it's not in the margin.



      Error is :




      ! Undefined control sequence.
      pgf@matrix@last@nextcell@options ! Package pgf Error: Single
      ampersand used with wrong catcode.








      margins marginpar tikz-cd






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      Romain

      765




      765






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          This is a wellknown issue, when it is dealing with & used inside an argument, things go wrong (presumably catcodes). Solution use this:



          marginpar{
          begin{tikzcd}[ampersand replacement=&]
          E
          arrow[bend right=50]{rr}[,label=below:scriptsize $gcirc f$]{}
          arrow[r]{}[,label=above:scriptsize $f$]{}
          & F
          arrow[r]{}[,label=above:scriptsize $g$]{}
          & G
          end{tikzcd}
          }





          share|improve this answer





















          • Works well! Thank you.
            – Romain
            yesterday











          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%2f461097%2fcommutative-diagramm-tikzcd-in-margin%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








          up vote
          2
          down vote



          accepted










          This is a wellknown issue, when it is dealing with & used inside an argument, things go wrong (presumably catcodes). Solution use this:



          marginpar{
          begin{tikzcd}[ampersand replacement=&]
          E
          arrow[bend right=50]{rr}[,label=below:scriptsize $gcirc f$]{}
          arrow[r]{}[,label=above:scriptsize $f$]{}
          & F
          arrow[r]{}[,label=above:scriptsize $g$]{}
          & G
          end{tikzcd}
          }





          share|improve this answer





















          • Works well! Thank you.
            – Romain
            yesterday















          up vote
          2
          down vote



          accepted










          This is a wellknown issue, when it is dealing with & used inside an argument, things go wrong (presumably catcodes). Solution use this:



          marginpar{
          begin{tikzcd}[ampersand replacement=&]
          E
          arrow[bend right=50]{rr}[,label=below:scriptsize $gcirc f$]{}
          arrow[r]{}[,label=above:scriptsize $f$]{}
          & F
          arrow[r]{}[,label=above:scriptsize $g$]{}
          & G
          end{tikzcd}
          }





          share|improve this answer





















          • Works well! Thank you.
            – Romain
            yesterday













          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          This is a wellknown issue, when it is dealing with & used inside an argument, things go wrong (presumably catcodes). Solution use this:



          marginpar{
          begin{tikzcd}[ampersand replacement=&]
          E
          arrow[bend right=50]{rr}[,label=below:scriptsize $gcirc f$]{}
          arrow[r]{}[,label=above:scriptsize $f$]{}
          & F
          arrow[r]{}[,label=above:scriptsize $g$]{}
          & G
          end{tikzcd}
          }





          share|improve this answer












          This is a wellknown issue, when it is dealing with & used inside an argument, things go wrong (presumably catcodes). Solution use this:



          marginpar{
          begin{tikzcd}[ampersand replacement=&]
          E
          arrow[bend right=50]{rr}[,label=below:scriptsize $gcirc f$]{}
          arrow[r]{}[,label=above:scriptsize $f$]{}
          & F
          arrow[r]{}[,label=above:scriptsize $g$]{}
          & G
          end{tikzcd}
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered yesterday









          daleif

          31.7k251112




          31.7k251112












          • Works well! Thank you.
            – Romain
            yesterday


















          • Works well! Thank you.
            – Romain
            yesterday
















          Works well! Thank you.
          – Romain
          yesterday




          Works well! Thank you.
          – Romain
          yesterday


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461097%2fcommutative-diagramm-tikzcd-in-margin%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

          サソリ

          広島県道265号伴広島線

          Accessing regular linux commands in Huawei's Dopra Linux