I want to partition a line segment into 5 segments of equal length and put tick marks at the new partition points. I want the tick marks to appear in black. Next I want to partition each new segment into 5 segments of equal length and want to color only the new tick marks in blue.
To achieve this task, I used TikZ and following is the code.
\documentclass[11pt]{amsart}
\usepackage{pgf,tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,10)-- (15,10);
\foreach \x in {0,...,5}
\draw (3*\x,10)--(3*\x,9.8);
\foreach \x in {1,...,4,6,...,9,11,...,14,16,...,19,21,...,24}
\draw[draw=blue] (3*\x/5,10)--(3*\x/5,9.8);
\end{tikzpicture}
\end{document}
However, the outcome is not the desired outcome.
So I read the manual and it suggests that I should include at least two starting numbers. I edited the code accordingly, and obtained the desired outcome. The new code is given below.
\documentclass[11pt]{amsart}
\usepackage{pgf,tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,10)-- (15,10);
\foreach \x in {0,...,5}
\draw (3*\x,10)--(3*\x,9.8);
\foreach \x in {1,...,4, 6,7,...,9, 11,12,...,14,16,17,...,19, 21,22,...,24}
\draw[draw=blue] (3*\x/5,10)--(3*\x/5,9.8);
\end{tikzpicture}
\end{document}
Here is my puzzle. If you give the starting number and the ending number to a counter that knows the increment is by 1(by default) then you do not have to give two starting numbers.
This seems to be the case, as the following works.
\foreach \x in {0,...,5}
\draw (3*\x,10)--(3*\x,9.8);
But, the counter seems to loose this capability the second time around as I have to give two numbers to remind the counter that the increment is by 1. (This is my hypothesis.)
What is the reason behind this?
4,6,…,9
, how do you determine that the step size is one? From the4,6
it appears that the step size might be 2. But once you add the second value,4,6,7,…9
then from7...9
the step size is determined to be one from the6,7
.