The basic idea is from How can I create new commands in TikZ?
\documentclass[10pt]{article}
\usepackage[a4paper,top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc,arrows.meta,bending,decorations.text,positioning}
\def\centerarct[#1](#2)(#3:#4:#5)% Syntax: [draw options] (center) (start angle:end angle:radius)
{ \path[#1] ($(#2)+({#5*cos(-#3+90)},{#5*sin(-#3+90)})$) arc [start angle={-#3+90}, end angle={-#4+90}, radius=#5)]; }
\pgfkeys{
myvector/.is family,
myvector,
radius/.initial=4.5cm,
line width/.initial =5mm,
color/.initial=orange,
text align/.initial=center,
text/.initial=Label,
raise/.initial=0mm
}
\newcommand\myvectorset[1]{\pgfkeys{myvector,#1}}
\def\myvector[#1](#2){
\myvectorset{#1,
radius/.get=\mbfradius,
line width/.get=\mbflinewidth,
color/.get=\mbfcolor,
text align/.get=\mbftextalign,
text/.get=\mbftext,
raise/.get=\mbfraise
}
\centerarct[{Triangle[width=9mm,length=5mm]}-,draw=\mbfcolor,line width=\mbflinewidth,postaction={decorate,decoration={text along path,text align=\mbftextalign,text=\mbftext,raise=\mbfraise}}](#2)(180:1:\mbfradius);
}
\begin{document}
\begin{tikzpicture}
\myvector[text align=right,raise=-1.25mm](0,0);
\end{tikzpicture}
\end{document}
It works. But unfortunately if I use
\myvector[text align={right,right indent=1cm},raise=-1.25mm](0,0);
the result is
! Package pgfkeys Error: I do not know the key '/pgf/decoration/text align/righ t,right indent=1cm' and I am going to ignore it. Perhaps you misspelled it.
I read about key handlers but I didn't found a way out.
\myvector[{text align={right,right indent=1cm}},raise=-1.25mm](0,0);? – cfr Jul 04 '17 at 12:16text align=\mbftextalignwill treat\mbftextalignas a key instead of list of keys. I think it is better to use/.styleto store list of keys. – Symbol 1 Jul 04 '17 at 12:33text align, aren't they? – cfr Jul 04 '17 at 12:58