numexpr behavior in math mode and/or TikZnullfont in mathmodeTable of 2x2 tikzpicturesDefine tikz node based on pagenodesBehavior of , in both text and math modeWeird Behavior of Math mode in beamerDefault spaces between letters in math-modeLegends in Externalized Graphics with TikZnarrow mode math environment in tikz nodesMath mode and beamermacros and math mode

To string or not to string

Today is the Center

Is this a crack on the carbon frame?

Languages that we cannot (dis)prove to be Context-Free

Approximately how much travel time was saved by the opening of the Suez Canal in 1869?

What's the output of a record cartridge playing an out-of-speed record

Risk of getting Chronic Wasting Disease (CWD) in the United States?

Font hinting is lost in Chrome-like browsers (for some languages )

What does CI-V stand for?

LaTeX closing $ signs makes cursor jump

the place where lots of roads meet

strToHex ( string to its hex representation as string)

Show that if two triangles built on parallel lines, with equal bases have the same perimeter only if they are congruent.

If I cast Expeditious Retreat, can I Dash as a bonus action on the same turn?

Why was the small council so happy for Tyrion to become the Master of Coin?

The use of multiple foreign keys on same column in SQL Server

What do you call a Matrix-like slowdown and camera movement effect?

How can I make my BBEG immortal short of making them a Lich or Vampire?

Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?

A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?

Fencing style for blades that can attack from a distance

Arthur Somervell: 1000 Exercises - Meaning of this notation

How to write a macro that is braces sensitive?

TGV timetables / schedules?



numexpr behavior in math mode and/or TikZ


nullfont in mathmodeTable of 2x2 tikzpicturesDefine tikz node based on pagenodesBehavior of , in both text and math modeWeird Behavior of Math mode in beamerDefault spaces between letters in math-modeLegends in Externalized Graphics with TikZnarrow mode math environment in tikz nodesMath mode and beamermacros and math mode













7















I am attempting to create a triangular grid of numbers like shown below:



enter image description here



This was created in TikZ by hard-coding each point, but I would like to generate the grid procedurally so I can make adjustments easily with a large number of points. The following code is how I have approached the problem:



documentclassarticle
usepackagetikz

begintikzpicture[scale=1.5]
foreach s in 2,...,4
foreach m in 1,...,numexprs-1
defns-m
draw (n,-m) node $a_mn$;


endtikzpicture


However this produces the following undesired result:



enter image description here



My thought to resolve this issue was to add numexpr in the n definition or prior to n in the nodes. However this produces the error you can't use 'numexpr' in math mode.



I'm at a loss as to what to do next. How can I evaluate variables like this in math mode in a tikzpicture?



As a further note, if I for testing purposes ignore my need for math mode and simply put numexprn in the node text I instead receive the similar error message you can't use 'numexpr' in restricted horizontal mode.



Also, if possible I would like to preserve this foreach iteration structure as it is ideal for other annotations I am using in my full application.










share|improve this question
























  • Probably thenumexprs-1relax

    – Henri Menke
    2 days ago















7















I am attempting to create a triangular grid of numbers like shown below:



enter image description here



This was created in TikZ by hard-coding each point, but I would like to generate the grid procedurally so I can make adjustments easily with a large number of points. The following code is how I have approached the problem:



documentclassarticle
usepackagetikz

begintikzpicture[scale=1.5]
foreach s in 2,...,4
foreach m in 1,...,numexprs-1
defns-m
draw (n,-m) node $a_mn$;


endtikzpicture


However this produces the following undesired result:



enter image description here



My thought to resolve this issue was to add numexpr in the n definition or prior to n in the nodes. However this produces the error you can't use 'numexpr' in math mode.



I'm at a loss as to what to do next. How can I evaluate variables like this in math mode in a tikzpicture?



As a further note, if I for testing purposes ignore my need for math mode and simply put numexprn in the node text I instead receive the similar error message you can't use 'numexpr' in restricted horizontal mode.



Also, if possible I would like to preserve this foreach iteration structure as it is ideal for other annotations I am using in my full application.










share|improve this question
























  • Probably thenumexprs-1relax

    – Henri Menke
    2 days ago













7












7








7








I am attempting to create a triangular grid of numbers like shown below:



enter image description here



This was created in TikZ by hard-coding each point, but I would like to generate the grid procedurally so I can make adjustments easily with a large number of points. The following code is how I have approached the problem:



documentclassarticle
usepackagetikz

begintikzpicture[scale=1.5]
foreach s in 2,...,4
foreach m in 1,...,numexprs-1
defns-m
draw (n,-m) node $a_mn$;


endtikzpicture


However this produces the following undesired result:



enter image description here



My thought to resolve this issue was to add numexpr in the n definition or prior to n in the nodes. However this produces the error you can't use 'numexpr' in math mode.



I'm at a loss as to what to do next. How can I evaluate variables like this in math mode in a tikzpicture?



As a further note, if I for testing purposes ignore my need for math mode and simply put numexprn in the node text I instead receive the similar error message you can't use 'numexpr' in restricted horizontal mode.



Also, if possible I would like to preserve this foreach iteration structure as it is ideal for other annotations I am using in my full application.










share|improve this question
















I am attempting to create a triangular grid of numbers like shown below:



enter image description here



This was created in TikZ by hard-coding each point, but I would like to generate the grid procedurally so I can make adjustments easily with a large number of points. The following code is how I have approached the problem:



documentclassarticle
usepackagetikz

begintikzpicture[scale=1.5]
foreach s in 2,...,4
foreach m in 1,...,numexprs-1
defns-m
draw (n,-m) node $a_mn$;


endtikzpicture


However this produces the following undesired result:



enter image description here



My thought to resolve this issue was to add numexpr in the n definition or prior to n in the nodes. However this produces the error you can't use 'numexpr' in math mode.



I'm at a loss as to what to do next. How can I evaluate variables like this in math mode in a tikzpicture?



As a further note, if I for testing purposes ignore my need for math mode and simply put numexprn in the node text I instead receive the similar error message you can't use 'numexpr' in restricted horizontal mode.



Also, if possible I would like to preserve this foreach iteration structure as it is ideal for other annotations I am using in my full application.







tikz-pgf math-mode programming






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









Someone

15411




15411










asked 2 days ago









PGmathPGmath

21114




21114












  • Probably thenumexprs-1relax

    – Henri Menke
    2 days ago

















  • Probably thenumexprs-1relax

    – Henri Menke
    2 days ago
















Probably thenumexprs-1relax

– Henri Menke
2 days ago





Probably thenumexprs-1relax

– Henri Menke
2 days ago










3 Answers
3






active

oldest

votes


















8














You could use edefnthenumexprs-m, or just use it in the subscript:



documentclassarticle
usepackagetikz

begindocument

begintikzpicture[scale=1.5]
foreach s in 2,...,4
foreach m in 1,...,numexprs-1
draw (s-m,-m) node $a_mthenumexprs-m$;


endtikzpicture

enddocument


enter image description here






share|improve this answer






























    4














    Avoid additional calculations. Try to think of another way of using nested foreachs.



    documentclass[tikz]standalone
    begindocument
    begintikzpicture[scale=1.5]
    foreach y in 1,...,3
    foreach x in 1,...,numexpr4-y
    draw (x,-y) node $a_yx$;


    endtikzpicture
    enddocument


    enter image description here






    share|improve this answer























    • Like I said in the post, due to the way I other annotations are drawn I would like to keep the same loop structure I used.

      – PGmath
      2 days ago











    • @PGmath Of course you can always keep the loop structure. However, that means you are making your problem unnecessarily complicated.

      – JouleV
      2 days ago











    • It's not unnecessarily complicated if I necessarily need that structure though.

      – PGmath
      2 days ago


















    4














    There is already one answer how to use numexpr, one how to rewrite your loop to avoid it, and here is another possibility : you can use the tools provided by foreach to make calculations. You can use count and evaluate:



    documentclass[tikz,border=7pt]standalone
    begindocument
    begintikzpicture[scale=1.5]
    foreach[count=t from 1] s in 2,...,4
    foreach[evaluate=n=int(s-m)] m in 1,...,t
    draw (n,-m) node $a_mn$;


    endtikzpicture
    enddocument


    enter image description here






    share|improve this answer























      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%2f483102%2fnumexpr-behavior-in-math-mode-and-or-tikz%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      8














      You could use edefnthenumexprs-m, or just use it in the subscript:



      documentclassarticle
      usepackagetikz

      begindocument

      begintikzpicture[scale=1.5]
      foreach s in 2,...,4
      foreach m in 1,...,numexprs-1
      draw (s-m,-m) node $a_mthenumexprs-m$;


      endtikzpicture

      enddocument


      enter image description here






      share|improve this answer



























        8














        You could use edefnthenumexprs-m, or just use it in the subscript:



        documentclassarticle
        usepackagetikz

        begindocument

        begintikzpicture[scale=1.5]
        foreach s in 2,...,4
        foreach m in 1,...,numexprs-1
        draw (s-m,-m) node $a_mthenumexprs-m$;


        endtikzpicture

        enddocument


        enter image description here






        share|improve this answer

























          8












          8








          8







          You could use edefnthenumexprs-m, or just use it in the subscript:



          documentclassarticle
          usepackagetikz

          begindocument

          begintikzpicture[scale=1.5]
          foreach s in 2,...,4
          foreach m in 1,...,numexprs-1
          draw (s-m,-m) node $a_mthenumexprs-m$;


          endtikzpicture

          enddocument


          enter image description here






          share|improve this answer













          You could use edefnthenumexprs-m, or just use it in the subscript:



          documentclassarticle
          usepackagetikz

          begindocument

          begintikzpicture[scale=1.5]
          foreach s in 2,...,4
          foreach m in 1,...,numexprs-1
          draw (s-m,-m) node $a_mthenumexprs-m$;


          endtikzpicture

          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 days ago









          egregegreg

          732k8919303253




          732k8919303253





















              4














              Avoid additional calculations. Try to think of another way of using nested foreachs.



              documentclass[tikz]standalone
              begindocument
              begintikzpicture[scale=1.5]
              foreach y in 1,...,3
              foreach x in 1,...,numexpr4-y
              draw (x,-y) node $a_yx$;


              endtikzpicture
              enddocument


              enter image description here






              share|improve this answer























              • Like I said in the post, due to the way I other annotations are drawn I would like to keep the same loop structure I used.

                – PGmath
                2 days ago











              • @PGmath Of course you can always keep the loop structure. However, that means you are making your problem unnecessarily complicated.

                – JouleV
                2 days ago











              • It's not unnecessarily complicated if I necessarily need that structure though.

                – PGmath
                2 days ago















              4














              Avoid additional calculations. Try to think of another way of using nested foreachs.



              documentclass[tikz]standalone
              begindocument
              begintikzpicture[scale=1.5]
              foreach y in 1,...,3
              foreach x in 1,...,numexpr4-y
              draw (x,-y) node $a_yx$;


              endtikzpicture
              enddocument


              enter image description here






              share|improve this answer























              • Like I said in the post, due to the way I other annotations are drawn I would like to keep the same loop structure I used.

                – PGmath
                2 days ago











              • @PGmath Of course you can always keep the loop structure. However, that means you are making your problem unnecessarily complicated.

                – JouleV
                2 days ago











              • It's not unnecessarily complicated if I necessarily need that structure though.

                – PGmath
                2 days ago













              4












              4








              4







              Avoid additional calculations. Try to think of another way of using nested foreachs.



              documentclass[tikz]standalone
              begindocument
              begintikzpicture[scale=1.5]
              foreach y in 1,...,3
              foreach x in 1,...,numexpr4-y
              draw (x,-y) node $a_yx$;


              endtikzpicture
              enddocument


              enter image description here






              share|improve this answer













              Avoid additional calculations. Try to think of another way of using nested foreachs.



              documentclass[tikz]standalone
              begindocument
              begintikzpicture[scale=1.5]
              foreach y in 1,...,3
              foreach x in 1,...,numexpr4-y
              draw (x,-y) node $a_yx$;


              endtikzpicture
              enddocument


              enter image description here







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered 2 days ago









              JouleVJouleV

              11.2k22560




              11.2k22560












              • Like I said in the post, due to the way I other annotations are drawn I would like to keep the same loop structure I used.

                – PGmath
                2 days ago











              • @PGmath Of course you can always keep the loop structure. However, that means you are making your problem unnecessarily complicated.

                – JouleV
                2 days ago











              • It's not unnecessarily complicated if I necessarily need that structure though.

                – PGmath
                2 days ago

















              • Like I said in the post, due to the way I other annotations are drawn I would like to keep the same loop structure I used.

                – PGmath
                2 days ago











              • @PGmath Of course you can always keep the loop structure. However, that means you are making your problem unnecessarily complicated.

                – JouleV
                2 days ago











              • It's not unnecessarily complicated if I necessarily need that structure though.

                – PGmath
                2 days ago
















              Like I said in the post, due to the way I other annotations are drawn I would like to keep the same loop structure I used.

              – PGmath
              2 days ago





              Like I said in the post, due to the way I other annotations are drawn I would like to keep the same loop structure I used.

              – PGmath
              2 days ago













              @PGmath Of course you can always keep the loop structure. However, that means you are making your problem unnecessarily complicated.

              – JouleV
              2 days ago





              @PGmath Of course you can always keep the loop structure. However, that means you are making your problem unnecessarily complicated.

              – JouleV
              2 days ago













              It's not unnecessarily complicated if I necessarily need that structure though.

              – PGmath
              2 days ago





              It's not unnecessarily complicated if I necessarily need that structure though.

              – PGmath
              2 days ago











              4














              There is already one answer how to use numexpr, one how to rewrite your loop to avoid it, and here is another possibility : you can use the tools provided by foreach to make calculations. You can use count and evaluate:



              documentclass[tikz,border=7pt]standalone
              begindocument
              begintikzpicture[scale=1.5]
              foreach[count=t from 1] s in 2,...,4
              foreach[evaluate=n=int(s-m)] m in 1,...,t
              draw (n,-m) node $a_mn$;


              endtikzpicture
              enddocument


              enter image description here






              share|improve this answer



























                4














                There is already one answer how to use numexpr, one how to rewrite your loop to avoid it, and here is another possibility : you can use the tools provided by foreach to make calculations. You can use count and evaluate:



                documentclass[tikz,border=7pt]standalone
                begindocument
                begintikzpicture[scale=1.5]
                foreach[count=t from 1] s in 2,...,4
                foreach[evaluate=n=int(s-m)] m in 1,...,t
                draw (n,-m) node $a_mn$;


                endtikzpicture
                enddocument


                enter image description here






                share|improve this answer

























                  4












                  4








                  4







                  There is already one answer how to use numexpr, one how to rewrite your loop to avoid it, and here is another possibility : you can use the tools provided by foreach to make calculations. You can use count and evaluate:



                  documentclass[tikz,border=7pt]standalone
                  begindocument
                  begintikzpicture[scale=1.5]
                  foreach[count=t from 1] s in 2,...,4
                  foreach[evaluate=n=int(s-m)] m in 1,...,t
                  draw (n,-m) node $a_mn$;


                  endtikzpicture
                  enddocument


                  enter image description here






                  share|improve this answer













                  There is already one answer how to use numexpr, one how to rewrite your loop to avoid it, and here is another possibility : you can use the tools provided by foreach to make calculations. You can use count and evaluate:



                  documentclass[tikz,border=7pt]standalone
                  begindocument
                  begintikzpicture[scale=1.5]
                  foreach[count=t from 1] s in 2,...,4
                  foreach[evaluate=n=int(s-m)] m in 1,...,t
                  draw (n,-m) node $a_mn$;


                  endtikzpicture
                  enddocument


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 2 days ago









                  KpymKpym

                  17.8k24191




                  17.8k24191



























                      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%2f483102%2fnumexpr-behavior-in-math-mode-and-or-tikz%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

                      getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

                      Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

                      Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.