Laurenso
In this code, ten vertices labels $A_1$, $A_{10}$. How can I label all vertices with order Alphabet? like this `A, B, ..., `
```
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{70} \pgfmathsetmacro\n{10}
\begin{tikzpicture}[tdplot_main_coords,line cap=butt,line join=round,
declare function={r=3;}]
\foreach\i in {1,...,\n}
{
\coordinate (A\i) at (360*\i/\n:r);
}
\foreach\i in {1,...,\n}
\node[red,below] at (A\i) {$A_{\i}$};
\end{tikzpicture}
\end{document}
```
![image.png](/image?hash=f8d69b7329b5f9a795235f3bb8bd0c927a194551737ba4791e67b875a249b6c9)
Top Answer
Skillmon
You can use the `expl3` function `\int_to_Alph:n` (that is fully expandable, so you can also use it to assign your coordinates):
```
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\ExplSyntaxOn
\cs_new_eq:NN \mytoAlph \int_to_Alph:n
\ExplSyntaxOff
\begin{document}
\tdplotsetmaincoords{70}{70} \pgfmathsetmacro\n{10}
\begin{tikzpicture}[tdplot_main_coords,line cap=butt,line join=round,
declare function={r=3;}]
\foreach\i in {1,...,\n}
{
\coordinate (\mytoAlph{\i}) at (360*\i/\n:r);
}
\foreach\i in {1,...,\n}
\node[red,below] at (\mytoAlph{\i}) {$\mytoAlph{\i}$};
\draw[blue] (C) circle[radius=5mm];
\end{tikzpicture}
\end{document}
```
![alphlabels-1.png](/image?hash=e2ba54d5c7c1fde449246623b004385be78f795aca738b482a0fd62e05c86505)
Answer #2
samcarter
Quick hack by using a counter (make sure to not exceed the alphabet):
```
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\newcounter{foo}
\begin{document}
\tdplotsetmaincoords{70}{70} \pgfmathsetmacro\n{10}
\begin{tikzpicture}[tdplot_main_coords,line cap=butt,line join=round,
declare function={r=3;}]
\foreach\i in {1,...,\n}
{
\coordinate (A\i) at (360*\i/\n:r);
}
\foreach\i in {1,...,\n}
\node[red,below] at (A\i) {\setcounter{foo}{\i}\Alph{foo}};
\end{tikzpicture}
\end{document}
```
Or you could use the `alphalph` package:
```
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\usepackage{alphalph}
\begin{document}
\tdplotsetmaincoords{70}{70} \pgfmathsetmacro\n{10}
\begin{tikzpicture}[tdplot_main_coords,line cap=butt,line join=round,
declare function={r=3;}]
\foreach\i in {1,...,\n}
{
\coordinate (A\i) at (360*\i/\n:r);
}
\foreach\i in {1,...,\n}
\node[red,below] at (A\i) {\AlphAlph{\i}};
\end{tikzpicture}
\end{document}
```
----
Different approach:
Instead of looping over numbers, you could directly loop over the alphabetic letters
```
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\usepackage{alphalph}
\begin{document}
\tdplotsetmaincoords{70}{70} \pgfmathsetmacro\n{10}
\begin{tikzpicture}[tdplot_main_coords,line cap=butt,line join=round, declare function={r=3;}]
\foreach \a [count=\i] in {A,...,J}{
\node (\a) at (360*\i/\n:r) {\a};
}
\draw (A) -- (B);
\end{tikzpicture}
\end{document}
```