Setting label in newcommand via a pgfkeyHow do you test whether a known key value has been set in pgfkeysAssociate dynamic text to a labelSectioning created via titlesec have wrong labelCreating tikz anchors based on pgfkey valuePass a list through pgfkeySetting distance from label to node in TikZCreating own ref-label system without using additional parameters using newcommand?Label naming strategyIgnoring redefined labelChange label numbering prefixManual label to figureSetting polar coordinates for coordinate system in TikZ via macro

Does splitting a potentially monolithic application into several smaller ones help prevent bugs?

Is it ok to include an epilogue dedicated to colleagues who passed away in the end of the manuscript?

Can you reject a postdoc offer after the PI has paid a large sum for flights/accommodation for your visit?

My story is written in English, but is set in my home country. What language should I use for the dialogue?

Want to switch to tankless, but can I use my existing wiring?

How to deal with a cynical class?

Make a transparent 448*448 image

Time dilation for a moving electronic clock

Humans have energy, but not water. What happens?

Do I need to leave some extra space available on the disk which my database log files reside, for log backup operations to successfully occur?

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

Can infringement of a trademark be pursued for using a company's name in a sentence?

Am I not good enough for you?

what does the apostrophe mean in this notation?

Question about partial fractions with irreducible quadratic factors

Unreachable code, but reachable with exception

validation vs test vs training accuracy, which one to compare for claiming overfit?

How is the Swiss post e-voting system supposed to work, and how was it wrong?

What exactly is the purpose of connection links straped between the rocket and the launch pad

Silly Sally's Movie

Straight line with arrows and dots

US to Europe trip with Canada layover- is 52 minutes enough?

How could a female member of a species produce eggs unto death?

Best mythical creature to use as livestock?



Setting label in newcommand via a pgfkey


How do you test whether a known key value has been set in pgfkeysAssociate dynamic text to a labelSectioning created via titlesec have wrong labelCreating tikz anchors based on pgfkey valuePass a list through pgfkeySetting distance from label to node in TikZCreating own ref-label system without using additional parameters using newcommand?Label naming strategyIgnoring redefined labelChange label numbering prefixManual label to figureSetting polar coordinates for coordinate system in TikZ via macro













0















I'm attempting to set a label in a macro(?) I created with a new command. I'm passing several values to the command in the first argument via pgfkeys, but the label macro is just using the literal string I've put in to expand the pgfkey instead of the actual expanded value.



I've tried both of the solutions presented in these answers, together and separately, but not luck.



https://tex.stackexchange.com/a/308164



https://tex.stackexchange.com/a/125099



I've an inkling that what's happening is related to the timing of the expansion for the pgfkey value, but I'll be honest I don't have a firm understanding of how the underlying tex engine does it's magic. I'm also just learning pgfkeys so my understanding of what's happening there is still at a beginner level.



Here's my mwe of what I'm trying to do:



documentclass[twocolumn]book

usepackage[framemethod=TikZ]mdframed%boxes
usepackagepgfkeys

newcountermyCounter

newmdenv[%
frametitlebackgroundcolor=blue,
frametitlefontcolor=white,
backgroundcolor=blue!25,
linecolor=blue,
outerlinewidth=1pt,
roundcorner=1mm,
skipabove=baselineskip,
skipbelow=baselineskip,
font=small,
nobreak=true,
settings=globalrefstepcountermyCounter,
]myTextBox


%Define Macros
makeatletter

pgfkeys/mykeys/textbox/.cd,
title/.initial=,
body/.initial=,
label/.initial=,


defmykeys@set@textbox@keys#1%%
pgfkeys/mykeys/textbox/.cd,#1
defmykeys@get@textbox#1%%
pgfkeysvalueof/mykeys/textbox/#1

newcommandmyBox[1]%%
bgroup
mykeys@set@textbox@keys#1%%
beginmyTextBox[frametitle=textbfmykeys@get@textboxtitlehfill NOTE]
mykeys@get@textboxbody
labelbox:mykeys@get@textboxlabel
endmyTextBox
egroup


makeatother

begindocument
sectionA Section
myBox
title=Box Title,
body=A not so long string of text to go in the box,
label=firstbox

reffirstbox

enddocument


Here's my current result:



current result



I'm not tied to a particular solution (I would prefer a solution that works with pgfkeys) as long as I can get labels and references working properly.










share|improve this question


























    0















    I'm attempting to set a label in a macro(?) I created with a new command. I'm passing several values to the command in the first argument via pgfkeys, but the label macro is just using the literal string I've put in to expand the pgfkey instead of the actual expanded value.



    I've tried both of the solutions presented in these answers, together and separately, but not luck.



    https://tex.stackexchange.com/a/308164



    https://tex.stackexchange.com/a/125099



    I've an inkling that what's happening is related to the timing of the expansion for the pgfkey value, but I'll be honest I don't have a firm understanding of how the underlying tex engine does it's magic. I'm also just learning pgfkeys so my understanding of what's happening there is still at a beginner level.



    Here's my mwe of what I'm trying to do:



    documentclass[twocolumn]book

    usepackage[framemethod=TikZ]mdframed%boxes
    usepackagepgfkeys

    newcountermyCounter

    newmdenv[%
    frametitlebackgroundcolor=blue,
    frametitlefontcolor=white,
    backgroundcolor=blue!25,
    linecolor=blue,
    outerlinewidth=1pt,
    roundcorner=1mm,
    skipabove=baselineskip,
    skipbelow=baselineskip,
    font=small,
    nobreak=true,
    settings=globalrefstepcountermyCounter,
    ]myTextBox


    %Define Macros
    makeatletter

    pgfkeys/mykeys/textbox/.cd,
    title/.initial=,
    body/.initial=,
    label/.initial=,


    defmykeys@set@textbox@keys#1%%
    pgfkeys/mykeys/textbox/.cd,#1
    defmykeys@get@textbox#1%%
    pgfkeysvalueof/mykeys/textbox/#1

    newcommandmyBox[1]%%
    bgroup
    mykeys@set@textbox@keys#1%%
    beginmyTextBox[frametitle=textbfmykeys@get@textboxtitlehfill NOTE]
    mykeys@get@textboxbody
    labelbox:mykeys@get@textboxlabel
    endmyTextBox
    egroup


    makeatother

    begindocument
    sectionA Section
    myBox
    title=Box Title,
    body=A not so long string of text to go in the box,
    label=firstbox

    reffirstbox

    enddocument


    Here's my current result:



    current result



    I'm not tied to a particular solution (I would prefer a solution that works with pgfkeys) as long as I can get labels and references working properly.










    share|improve this question
























      0












      0








      0








      I'm attempting to set a label in a macro(?) I created with a new command. I'm passing several values to the command in the first argument via pgfkeys, but the label macro is just using the literal string I've put in to expand the pgfkey instead of the actual expanded value.



      I've tried both of the solutions presented in these answers, together and separately, but not luck.



      https://tex.stackexchange.com/a/308164



      https://tex.stackexchange.com/a/125099



      I've an inkling that what's happening is related to the timing of the expansion for the pgfkey value, but I'll be honest I don't have a firm understanding of how the underlying tex engine does it's magic. I'm also just learning pgfkeys so my understanding of what's happening there is still at a beginner level.



      Here's my mwe of what I'm trying to do:



      documentclass[twocolumn]book

      usepackage[framemethod=TikZ]mdframed%boxes
      usepackagepgfkeys

      newcountermyCounter

      newmdenv[%
      frametitlebackgroundcolor=blue,
      frametitlefontcolor=white,
      backgroundcolor=blue!25,
      linecolor=blue,
      outerlinewidth=1pt,
      roundcorner=1mm,
      skipabove=baselineskip,
      skipbelow=baselineskip,
      font=small,
      nobreak=true,
      settings=globalrefstepcountermyCounter,
      ]myTextBox


      %Define Macros
      makeatletter

      pgfkeys/mykeys/textbox/.cd,
      title/.initial=,
      body/.initial=,
      label/.initial=,


      defmykeys@set@textbox@keys#1%%
      pgfkeys/mykeys/textbox/.cd,#1
      defmykeys@get@textbox#1%%
      pgfkeysvalueof/mykeys/textbox/#1

      newcommandmyBox[1]%%
      bgroup
      mykeys@set@textbox@keys#1%%
      beginmyTextBox[frametitle=textbfmykeys@get@textboxtitlehfill NOTE]
      mykeys@get@textboxbody
      labelbox:mykeys@get@textboxlabel
      endmyTextBox
      egroup


      makeatother

      begindocument
      sectionA Section
      myBox
      title=Box Title,
      body=A not so long string of text to go in the box,
      label=firstbox

      reffirstbox

      enddocument


      Here's my current result:



      current result



      I'm not tied to a particular solution (I would prefer a solution that works with pgfkeys) as long as I can get labels and references working properly.










      share|improve this question














      I'm attempting to set a label in a macro(?) I created with a new command. I'm passing several values to the command in the first argument via pgfkeys, but the label macro is just using the literal string I've put in to expand the pgfkey instead of the actual expanded value.



      I've tried both of the solutions presented in these answers, together and separately, but not luck.



      https://tex.stackexchange.com/a/308164



      https://tex.stackexchange.com/a/125099



      I've an inkling that what's happening is related to the timing of the expansion for the pgfkey value, but I'll be honest I don't have a firm understanding of how the underlying tex engine does it's magic. I'm also just learning pgfkeys so my understanding of what's happening there is still at a beginner level.



      Here's my mwe of what I'm trying to do:



      documentclass[twocolumn]book

      usepackage[framemethod=TikZ]mdframed%boxes
      usepackagepgfkeys

      newcountermyCounter

      newmdenv[%
      frametitlebackgroundcolor=blue,
      frametitlefontcolor=white,
      backgroundcolor=blue!25,
      linecolor=blue,
      outerlinewidth=1pt,
      roundcorner=1mm,
      skipabove=baselineskip,
      skipbelow=baselineskip,
      font=small,
      nobreak=true,
      settings=globalrefstepcountermyCounter,
      ]myTextBox


      %Define Macros
      makeatletter

      pgfkeys/mykeys/textbox/.cd,
      title/.initial=,
      body/.initial=,
      label/.initial=,


      defmykeys@set@textbox@keys#1%%
      pgfkeys/mykeys/textbox/.cd,#1
      defmykeys@get@textbox#1%%
      pgfkeysvalueof/mykeys/textbox/#1

      newcommandmyBox[1]%%
      bgroup
      mykeys@set@textbox@keys#1%%
      beginmyTextBox[frametitle=textbfmykeys@get@textboxtitlehfill NOTE]
      mykeys@get@textboxbody
      labelbox:mykeys@get@textboxlabel
      endmyTextBox
      egroup


      makeatother

      begindocument
      sectionA Section
      myBox
      title=Box Title,
      body=A not so long string of text to go in the box,
      label=firstbox

      reffirstbox

      enddocument


      Here's my current result:



      current result



      I'm not tied to a particular solution (I would prefer a solution that works with pgfkeys) as long as I can get labels and references working properly.







      tikz-pgf cross-referencing






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 10 mins ago









      TuffwerTuffwer

      1507




      1507




















          0






          active

          oldest

          votes











          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%2f479387%2fsetting-label-in-newcommand-via-a-pgfkey%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          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%2f479387%2fsetting-label-in-newcommand-via-a-pgfkey%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

          Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

          Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

          Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm