Iteration with foreach brings error in the moment I use a list with two variables as you can see in the mwe. Is there a solution possible? As the output PDF shows the error occurs when trying to use a list. Howto integrate the mwe?
\documentclass[a4paper,10pt]{article}
\usepackage[utf8x]{inputenc}
\usepackage{tikz}
\begin{document}
%two variables
\foreach \x in {1.00,1.033,...,2.000,2.033,2.083,...,3.000,3.050,3.15,...,4.000}
{
x \x ;
}
% output 3 series of variables(x and y). 1. between 1 and 2 thirty steps, 2. betw. 2 a. 3 twenty steps, 3. betw. 3 a. 4 ten steps. thats the aim. here shortened to the end of three(3.000)
\foreach \x / \y in
%{1.00/1.033,1.033/1.066}% 0 errors, pdf ok
{1.00/1.033,1.033/1.066,...,2.000/2.033} % 63 errors, pdf output gen erated! shows wrong variable contents
% third version 88 errors, but pdf generated! shows wrong variable values
%{1.00/1.033,1.033/1.066,...,2.000/2.033,2.033/2.066,2.116/2.166,...,3.000/3.050}
{
x1: \x, y1: \y \\
}
\end{document}
\foreach \x [evaluate=\x as \y using \x+0.033] in {1.0,1.033,...,2.0} { x1: \x, y1: \y \\}– Ignasi Jan 11 '16 at 09:440.033addition not a constant? – Alenanno Jan 11 '16 at 10:22foreach. Why do you want only one? – Ignasi Jan 11 '16 at 10:26pgfplotstablewhich is part ofpgfplots. – Ignasi Jan 11 '16 at 10:28\foreach \y [remember=\y as \x (initially 1.00)] in {1.033,1.066,...,2.033} {x1: \x, y1: \y\par}. – cfr Jan 12 '16 at 03:43multido. – Werner Jan 12 '16 at 16:22\documentclass[a4paper,10pt]{article} \usepackage{tikz} \begin{document} \foreach \x / \y in {0/0,10/20,...,90/180,100/200}{ x1: \x, y1: \y \\} \end{document}Mwe shows: – gizeh Jan 26 '16 at 13:55