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
I am attempting to create a triangular grid of numbers like shown below:
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:
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
add a comment |
I am attempting to create a triangular grid of numbers like shown below:
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:
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
Probablythenumexprs-1relax
– Henri Menke
2 days ago
add a comment |
I am attempting to create a triangular grid of numbers like shown below:
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:
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
I am attempting to create a triangular grid of numbers like shown below:
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:
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
tikz-pgf math-mode programming
edited 2 days ago
Someone
15411
15411
asked 2 days ago
PGmathPGmath
21114
21114
Probablythenumexprs-1relax
– Henri Menke
2 days ago
add a comment |
Probablythenumexprs-1relax
– Henri Menke
2 days ago
Probably
thenumexprs-1relax
– Henri Menke
2 days ago
Probably
thenumexprs-1relax
– Henri Menke
2 days ago
add a comment |
3 Answers
3
active
oldest
votes
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
add a comment |
Avoid additional calculations. Try to think of another way of using nested foreach
s.
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
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
add a comment |
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
answered 2 days ago
egregegreg
732k8919303253
732k8919303253
add a comment |
add a comment |
Avoid additional calculations. Try to think of another way of using nested foreach
s.
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
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
add a comment |
Avoid additional calculations. Try to think of another way of using nested foreach
s.
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
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
add a comment |
Avoid additional calculations. Try to think of another way of using nested foreach
s.
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
Avoid additional calculations. Try to think of another way of using nested foreach
s.
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
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
add a comment |
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
add a comment |
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
add a comment |
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
add a comment |
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
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
answered 2 days ago
KpymKpym
17.8k24191
17.8k24191
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Probably
thenumexprs-1relax
– Henri Menke
2 days ago