dimension too large in pgfmathsetmacro
This works for
test{500}
but not for let say
test{50000}
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
pgfmathsetmacro{saldoo}{#1}
foreach x in {10,20,30}{%
pgfmathsetmacro{saldo}{csname BelegKontozweiSollxendcsname+saldoo}
globalletsaldoo=saldo
}
textbf{saldoo}
}
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{500}
end{document}
how can i pass this problem?
Note: in general my tex file is a little bit longer, so i want to keep
csname .... endcsname
vice versa, i have to change a lot of things in my original tex file, which i wont do that.
Someone have an idea?
pgfmath
add a comment |
This works for
test{500}
but not for let say
test{50000}
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
pgfmathsetmacro{saldoo}{#1}
foreach x in {10,20,30}{%
pgfmathsetmacro{saldo}{csname BelegKontozweiSollxendcsname+saldoo}
globalletsaldoo=saldo
}
textbf{saldoo}
}
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{500}
end{document}
how can i pass this problem?
Note: in general my tex file is a little bit longer, so i want to keep
csname .... endcsname
vice versa, i have to change a lot of things in my original tex file, which i wont do that.
Someone have an idea?
pgfmath
add a comment |
This works for
test{500}
but not for let say
test{50000}
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
pgfmathsetmacro{saldoo}{#1}
foreach x in {10,20,30}{%
pgfmathsetmacro{saldo}{csname BelegKontozweiSollxendcsname+saldoo}
globalletsaldoo=saldo
}
textbf{saldoo}
}
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{500}
end{document}
how can i pass this problem?
Note: in general my tex file is a little bit longer, so i want to keep
csname .... endcsname
vice versa, i have to change a lot of things in my original tex file, which i wont do that.
Someone have an idea?
pgfmath
This works for
test{500}
but not for let say
test{50000}
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
pgfmathsetmacro{saldoo}{#1}
foreach x in {10,20,30}{%
pgfmathsetmacro{saldo}{csname BelegKontozweiSollxendcsname+saldoo}
globalletsaldoo=saldo
}
textbf{saldoo}
}
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{500}
end{document}
how can i pass this problem?
Note: in general my tex file is a little bit longer, so i want to keep
csname .... endcsname
vice versa, i have to change a lot of things in my original tex file, which i wont do that.
Someone have an idea?
pgfmath
pgfmath
asked yesterday
Bilal YilmazBilal Yilmaz
232
232
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Don't use pgf for such large numbers. As it internally uses dimensions its range is a bit restricted. With expl3 and its fp-library there is no problem:
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage{siunitx} %loads expl3
sisetup{locale=DE}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
ExplSyntaxOn
newcommand{test}[1]
{
fp_set:Nnl_tmpa_fp{#1}
clist_map_inline:nn {10,20,30}
{
fp_add:Nn l_tmpa_fp { use:c{ BelegKontozweiSoll##1} }
}
textbf{num[detect-weight]{fp_eval:n{l_tmpa_fp}}}
}
ExplSyntaxOff
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{50000}
end{document}
Thanks a lot! But i dont like to work with this. Is it possible to combine FPeval with csname...endcsname? If it is possible, then i also can use let say round(..) and a lot of other stuff which is easy to use. expl3 is a little bit weird...
– Bilal Yilmaz
yesterday
Sure replaceuse:c {...}bycsname ... endcsname.use:cis only a wrapper around this primitive (and shorter to type ...).
– Ulrike Fischer
yesterday
could you please adapt the codes to fpeval so i can see explicit how do you mean that. I will be very very apretiate
– Bilal Yilmaz
yesterday
Hm. I think you should better get used to expl3. The colons and underscore may look a bit weird at the first glance, but you get quite fast used to it - better than csname, xdef and expandafter. round() and so works there fine too. You can e.g. replace fp_add:Nn by fp_set:Nn .
– Ulrike Fischer
yesterday
can you please read my new answer. I have written down what im looking for.
– Bilal Yilmaz
yesterday
add a comment |
I mean something like this:
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage[nomessages]{fp}% http://ctan.org/pkg/fp -> FPeval
usepackage{fp}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
pgfmathsetmacro{saldoo}{#1}
foreach x in {10,20,30}{%
FPeval{saldo}{ {csname BelegKontozweiSollx endcsname} + saldoo}
FPeval{saldoo}{saldo}
}
textbf{saldoo}
}
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{50000}
end{document}
This works also fine for 50000 but FPeval doesnt take the value
{csname BelegKontozweiSollx endcsname}
Can you please adapt this part of the code? So then i have not to use expl3.
I like FPeval....
You are forgetting that foreach builds a group, the calculated value can't escape.
– Ulrike Fischer
yesterday
I got it! Solution below :) Finally, puhh! Thanks a lot Ulrike
– Bilal Yilmaz
yesterday
add a comment |
Now i got it :)
- its possible to combine FPeval with csname ... endcsname
- its possible that the calculated value in foreach is global (xdef....)
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage[nomessages]{fp}% http://ctan.org/pkg/fp -> FPeval
usepackage{fp}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
FPeval{saldoo}{#1}
foreach x in {1,...,5}{%
FPeval{saldo}{ csname BelegKontozweiSollx endcsname + saldoo}
FPeval{saldoo}{saldo}
xdefsaldoo{saldo}
}
saldoo
}
begin{document}
Beleg{1}{25}
Beleg{2}{25}
Beleg{3}{25}
Beleg{4}{100}
Beleg{5}{100}
test{50000}
end{document}
Finish :)
You shouldn't assign saldoo both locally and globally, it will use up your stack. (fp does it wrong too in quite some places, and that's why e.g. this exploded: tex.stackexchange.com/questions/459626/…. One reason why I don't use fp).
– Ulrike Fischer
yesterday
ok thanks! i changed it to something else.
– Bilal Yilmaz
yesterday
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%2f485097%2fdimension-too-large-in-pgfmathsetmacro%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
Don't use pgf for such large numbers. As it internally uses dimensions its range is a bit restricted. With expl3 and its fp-library there is no problem:
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage{siunitx} %loads expl3
sisetup{locale=DE}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
ExplSyntaxOn
newcommand{test}[1]
{
fp_set:Nnl_tmpa_fp{#1}
clist_map_inline:nn {10,20,30}
{
fp_add:Nn l_tmpa_fp { use:c{ BelegKontozweiSoll##1} }
}
textbf{num[detect-weight]{fp_eval:n{l_tmpa_fp}}}
}
ExplSyntaxOff
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{50000}
end{document}
Thanks a lot! But i dont like to work with this. Is it possible to combine FPeval with csname...endcsname? If it is possible, then i also can use let say round(..) and a lot of other stuff which is easy to use. expl3 is a little bit weird...
– Bilal Yilmaz
yesterday
Sure replaceuse:c {...}bycsname ... endcsname.use:cis only a wrapper around this primitive (and shorter to type ...).
– Ulrike Fischer
yesterday
could you please adapt the codes to fpeval so i can see explicit how do you mean that. I will be very very apretiate
– Bilal Yilmaz
yesterday
Hm. I think you should better get used to expl3. The colons and underscore may look a bit weird at the first glance, but you get quite fast used to it - better than csname, xdef and expandafter. round() and so works there fine too. You can e.g. replace fp_add:Nn by fp_set:Nn .
– Ulrike Fischer
yesterday
can you please read my new answer. I have written down what im looking for.
– Bilal Yilmaz
yesterday
add a comment |
Don't use pgf for such large numbers. As it internally uses dimensions its range is a bit restricted. With expl3 and its fp-library there is no problem:
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage{siunitx} %loads expl3
sisetup{locale=DE}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
ExplSyntaxOn
newcommand{test}[1]
{
fp_set:Nnl_tmpa_fp{#1}
clist_map_inline:nn {10,20,30}
{
fp_add:Nn l_tmpa_fp { use:c{ BelegKontozweiSoll##1} }
}
textbf{num[detect-weight]{fp_eval:n{l_tmpa_fp}}}
}
ExplSyntaxOff
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{50000}
end{document}
Thanks a lot! But i dont like to work with this. Is it possible to combine FPeval with csname...endcsname? If it is possible, then i also can use let say round(..) and a lot of other stuff which is easy to use. expl3 is a little bit weird...
– Bilal Yilmaz
yesterday
Sure replaceuse:c {...}bycsname ... endcsname.use:cis only a wrapper around this primitive (and shorter to type ...).
– Ulrike Fischer
yesterday
could you please adapt the codes to fpeval so i can see explicit how do you mean that. I will be very very apretiate
– Bilal Yilmaz
yesterday
Hm. I think you should better get used to expl3. The colons and underscore may look a bit weird at the first glance, but you get quite fast used to it - better than csname, xdef and expandafter. round() and so works there fine too. You can e.g. replace fp_add:Nn by fp_set:Nn .
– Ulrike Fischer
yesterday
can you please read my new answer. I have written down what im looking for.
– Bilal Yilmaz
yesterday
add a comment |
Don't use pgf for such large numbers. As it internally uses dimensions its range is a bit restricted. With expl3 and its fp-library there is no problem:
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage{siunitx} %loads expl3
sisetup{locale=DE}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
ExplSyntaxOn
newcommand{test}[1]
{
fp_set:Nnl_tmpa_fp{#1}
clist_map_inline:nn {10,20,30}
{
fp_add:Nn l_tmpa_fp { use:c{ BelegKontozweiSoll##1} }
}
textbf{num[detect-weight]{fp_eval:n{l_tmpa_fp}}}
}
ExplSyntaxOff
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{50000}
end{document}
Don't use pgf for such large numbers. As it internally uses dimensions its range is a bit restricted. With expl3 and its fp-library there is no problem:
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage{siunitx} %loads expl3
sisetup{locale=DE}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
ExplSyntaxOn
newcommand{test}[1]
{
fp_set:Nnl_tmpa_fp{#1}
clist_map_inline:nn {10,20,30}
{
fp_add:Nn l_tmpa_fp { use:c{ BelegKontozweiSoll##1} }
}
textbf{num[detect-weight]{fp_eval:n{l_tmpa_fp}}}
}
ExplSyntaxOff
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{50000}
end{document}
answered yesterday
Ulrike FischerUlrike Fischer
199k9306692
199k9306692
Thanks a lot! But i dont like to work with this. Is it possible to combine FPeval with csname...endcsname? If it is possible, then i also can use let say round(..) and a lot of other stuff which is easy to use. expl3 is a little bit weird...
– Bilal Yilmaz
yesterday
Sure replaceuse:c {...}bycsname ... endcsname.use:cis only a wrapper around this primitive (and shorter to type ...).
– Ulrike Fischer
yesterday
could you please adapt the codes to fpeval so i can see explicit how do you mean that. I will be very very apretiate
– Bilal Yilmaz
yesterday
Hm. I think you should better get used to expl3. The colons and underscore may look a bit weird at the first glance, but you get quite fast used to it - better than csname, xdef and expandafter. round() and so works there fine too. You can e.g. replace fp_add:Nn by fp_set:Nn .
– Ulrike Fischer
yesterday
can you please read my new answer. I have written down what im looking for.
– Bilal Yilmaz
yesterday
add a comment |
Thanks a lot! But i dont like to work with this. Is it possible to combine FPeval with csname...endcsname? If it is possible, then i also can use let say round(..) and a lot of other stuff which is easy to use. expl3 is a little bit weird...
– Bilal Yilmaz
yesterday
Sure replaceuse:c {...}bycsname ... endcsname.use:cis only a wrapper around this primitive (and shorter to type ...).
– Ulrike Fischer
yesterday
could you please adapt the codes to fpeval so i can see explicit how do you mean that. I will be very very apretiate
– Bilal Yilmaz
yesterday
Hm. I think you should better get used to expl3. The colons and underscore may look a bit weird at the first glance, but you get quite fast used to it - better than csname, xdef and expandafter. round() and so works there fine too. You can e.g. replace fp_add:Nn by fp_set:Nn .
– Ulrike Fischer
yesterday
can you please read my new answer. I have written down what im looking for.
– Bilal Yilmaz
yesterday
Thanks a lot! But i dont like to work with this. Is it possible to combine FPeval with csname...endcsname? If it is possible, then i also can use let say round(..) and a lot of other stuff which is easy to use. expl3 is a little bit weird...
– Bilal Yilmaz
yesterday
Thanks a lot! But i dont like to work with this. Is it possible to combine FPeval with csname...endcsname? If it is possible, then i also can use let say round(..) and a lot of other stuff which is easy to use. expl3 is a little bit weird...
– Bilal Yilmaz
yesterday
Sure replace
use:c {...} by csname ... endcsname. use:c is only a wrapper around this primitive (and shorter to type ...).– Ulrike Fischer
yesterday
Sure replace
use:c {...} by csname ... endcsname. use:c is only a wrapper around this primitive (and shorter to type ...).– Ulrike Fischer
yesterday
could you please adapt the codes to fpeval so i can see explicit how do you mean that. I will be very very apretiate
– Bilal Yilmaz
yesterday
could you please adapt the codes to fpeval so i can see explicit how do you mean that. I will be very very apretiate
– Bilal Yilmaz
yesterday
Hm. I think you should better get used to expl3. The colons and underscore may look a bit weird at the first glance, but you get quite fast used to it - better than csname, xdef and expandafter. round() and so works there fine too. You can e.g. replace fp_add:Nn by fp_set:Nn .
– Ulrike Fischer
yesterday
Hm. I think you should better get used to expl3. The colons and underscore may look a bit weird at the first glance, but you get quite fast used to it - better than csname, xdef and expandafter. round() and so works there fine too. You can e.g. replace fp_add:Nn by fp_set:Nn .
– Ulrike Fischer
yesterday
can you please read my new answer. I have written down what im looking for.
– Bilal Yilmaz
yesterday
can you please read my new answer. I have written down what im looking for.
– Bilal Yilmaz
yesterday
add a comment |
I mean something like this:
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage[nomessages]{fp}% http://ctan.org/pkg/fp -> FPeval
usepackage{fp}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
pgfmathsetmacro{saldoo}{#1}
foreach x in {10,20,30}{%
FPeval{saldo}{ {csname BelegKontozweiSollx endcsname} + saldoo}
FPeval{saldoo}{saldo}
}
textbf{saldoo}
}
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{50000}
end{document}
This works also fine for 50000 but FPeval doesnt take the value
{csname BelegKontozweiSollx endcsname}
Can you please adapt this part of the code? So then i have not to use expl3.
I like FPeval....
You are forgetting that foreach builds a group, the calculated value can't escape.
– Ulrike Fischer
yesterday
I got it! Solution below :) Finally, puhh! Thanks a lot Ulrike
– Bilal Yilmaz
yesterday
add a comment |
I mean something like this:
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage[nomessages]{fp}% http://ctan.org/pkg/fp -> FPeval
usepackage{fp}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
pgfmathsetmacro{saldoo}{#1}
foreach x in {10,20,30}{%
FPeval{saldo}{ {csname BelegKontozweiSollx endcsname} + saldoo}
FPeval{saldoo}{saldo}
}
textbf{saldoo}
}
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{50000}
end{document}
This works also fine for 50000 but FPeval doesnt take the value
{csname BelegKontozweiSollx endcsname}
Can you please adapt this part of the code? So then i have not to use expl3.
I like FPeval....
You are forgetting that foreach builds a group, the calculated value can't escape.
– Ulrike Fischer
yesterday
I got it! Solution below :) Finally, puhh! Thanks a lot Ulrike
– Bilal Yilmaz
yesterday
add a comment |
I mean something like this:
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage[nomessages]{fp}% http://ctan.org/pkg/fp -> FPeval
usepackage{fp}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
pgfmathsetmacro{saldoo}{#1}
foreach x in {10,20,30}{%
FPeval{saldo}{ {csname BelegKontozweiSollx endcsname} + saldoo}
FPeval{saldoo}{saldo}
}
textbf{saldoo}
}
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{50000}
end{document}
This works also fine for 50000 but FPeval doesnt take the value
{csname BelegKontozweiSollx endcsname}
Can you please adapt this part of the code? So then i have not to use expl3.
I like FPeval....
I mean something like this:
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage[nomessages]{fp}% http://ctan.org/pkg/fp -> FPeval
usepackage{fp}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
pgfmathsetmacro{saldoo}{#1}
foreach x in {10,20,30}{%
FPeval{saldo}{ {csname BelegKontozweiSollx endcsname} + saldoo}
FPeval{saldoo}{saldo}
}
textbf{saldoo}
}
begin{document}
Beleg{10}{50.60}
Beleg{20}{145.05}
Beleg{30}{603.28}
test{50000}
end{document}
This works also fine for 50000 but FPeval doesnt take the value
{csname BelegKontozweiSollx endcsname}
Can you please adapt this part of the code? So then i have not to use expl3.
I like FPeval....
answered yesterday
Bilal YilmazBilal Yilmaz
232
232
You are forgetting that foreach builds a group, the calculated value can't escape.
– Ulrike Fischer
yesterday
I got it! Solution below :) Finally, puhh! Thanks a lot Ulrike
– Bilal Yilmaz
yesterday
add a comment |
You are forgetting that foreach builds a group, the calculated value can't escape.
– Ulrike Fischer
yesterday
I got it! Solution below :) Finally, puhh! Thanks a lot Ulrike
– Bilal Yilmaz
yesterday
You are forgetting that foreach builds a group, the calculated value can't escape.
– Ulrike Fischer
yesterday
You are forgetting that foreach builds a group, the calculated value can't escape.
– Ulrike Fischer
yesterday
I got it! Solution below :) Finally, puhh! Thanks a lot Ulrike
– Bilal Yilmaz
yesterday
I got it! Solution below :) Finally, puhh! Thanks a lot Ulrike
– Bilal Yilmaz
yesterday
add a comment |
Now i got it :)
- its possible to combine FPeval with csname ... endcsname
- its possible that the calculated value in foreach is global (xdef....)
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage[nomessages]{fp}% http://ctan.org/pkg/fp -> FPeval
usepackage{fp}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
FPeval{saldoo}{#1}
foreach x in {1,...,5}{%
FPeval{saldo}{ csname BelegKontozweiSollx endcsname + saldoo}
FPeval{saldoo}{saldo}
xdefsaldoo{saldo}
}
saldoo
}
begin{document}
Beleg{1}{25}
Beleg{2}{25}
Beleg{3}{25}
Beleg{4}{100}
Beleg{5}{100}
test{50000}
end{document}
Finish :)
You shouldn't assign saldoo both locally and globally, it will use up your stack. (fp does it wrong too in quite some places, and that's why e.g. this exploded: tex.stackexchange.com/questions/459626/…. One reason why I don't use fp).
– Ulrike Fischer
yesterday
ok thanks! i changed it to something else.
– Bilal Yilmaz
yesterday
add a comment |
Now i got it :)
- its possible to combine FPeval with csname ... endcsname
- its possible that the calculated value in foreach is global (xdef....)
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage[nomessages]{fp}% http://ctan.org/pkg/fp -> FPeval
usepackage{fp}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
FPeval{saldoo}{#1}
foreach x in {1,...,5}{%
FPeval{saldo}{ csname BelegKontozweiSollx endcsname + saldoo}
FPeval{saldoo}{saldo}
xdefsaldoo{saldo}
}
saldoo
}
begin{document}
Beleg{1}{25}
Beleg{2}{25}
Beleg{3}{25}
Beleg{4}{100}
Beleg{5}{100}
test{50000}
end{document}
Finish :)
You shouldn't assign saldoo both locally and globally, it will use up your stack. (fp does it wrong too in quite some places, and that's why e.g. this exploded: tex.stackexchange.com/questions/459626/…. One reason why I don't use fp).
– Ulrike Fischer
yesterday
ok thanks! i changed it to something else.
– Bilal Yilmaz
yesterday
add a comment |
Now i got it :)
- its possible to combine FPeval with csname ... endcsname
- its possible that the calculated value in foreach is global (xdef....)
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage[nomessages]{fp}% http://ctan.org/pkg/fp -> FPeval
usepackage{fp}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
FPeval{saldoo}{#1}
foreach x in {1,...,5}{%
FPeval{saldo}{ csname BelegKontozweiSollx endcsname + saldoo}
FPeval{saldoo}{saldo}
xdefsaldoo{saldo}
}
saldoo
}
begin{document}
Beleg{1}{25}
Beleg{2}{25}
Beleg{3}{25}
Beleg{4}{100}
Beleg{5}{100}
test{50000}
end{document}
Finish :)
Now i got it :)
- its possible to combine FPeval with csname ... endcsname
- its possible that the calculated value in foreach is global (xdef....)
documentclass[10pt,german]{article}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[utf8]{inputenc}
usepackage{pgffor} %foreach
usepackage[nomessages]{fp}% http://ctan.org/pkg/fp -> FPeval
usepackage{fp}
newcommand{Beleg}[2]{%
expandafterxdefcsname BelegKontozweiSoll#1endcsname{#2}
}
newcommand{test}[1]{%
FPeval{saldoo}{#1}
foreach x in {1,...,5}{%
FPeval{saldo}{ csname BelegKontozweiSollx endcsname + saldoo}
FPeval{saldoo}{saldo}
xdefsaldoo{saldo}
}
saldoo
}
begin{document}
Beleg{1}{25}
Beleg{2}{25}
Beleg{3}{25}
Beleg{4}{100}
Beleg{5}{100}
test{50000}
end{document}
Finish :)
answered yesterday
Bilal YilmazBilal Yilmaz
232
232
You shouldn't assign saldoo both locally and globally, it will use up your stack. (fp does it wrong too in quite some places, and that's why e.g. this exploded: tex.stackexchange.com/questions/459626/…. One reason why I don't use fp).
– Ulrike Fischer
yesterday
ok thanks! i changed it to something else.
– Bilal Yilmaz
yesterday
add a comment |
You shouldn't assign saldoo both locally and globally, it will use up your stack. (fp does it wrong too in quite some places, and that's why e.g. this exploded: tex.stackexchange.com/questions/459626/…. One reason why I don't use fp).
– Ulrike Fischer
yesterday
ok thanks! i changed it to something else.
– Bilal Yilmaz
yesterday
You shouldn't assign saldoo both locally and globally, it will use up your stack. (fp does it wrong too in quite some places, and that's why e.g. this exploded: tex.stackexchange.com/questions/459626/…. One reason why I don't use fp).
– Ulrike Fischer
yesterday
You shouldn't assign saldoo both locally and globally, it will use up your stack. (fp does it wrong too in quite some places, and that's why e.g. this exploded: tex.stackexchange.com/questions/459626/…. One reason why I don't use fp).
– Ulrike Fischer
yesterday
ok thanks! i changed it to something else.
– Bilal Yilmaz
yesterday
ok thanks! i changed it to something else.
– Bilal Yilmaz
yesterday
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%2f485097%2fdimension-too-large-in-pgfmathsetmacro%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