With tikz, we can write
\documentclass{article}
\usepackage{tikz}
\tikzstyle{mystyle} = [rectangle, text centered]
\begin{document}
\begin{tikzpicture}
\node [mystyle] at (0, 0) (mylabel) {mytext};
\end{tikzpicture}
\end{document}
How to define a command that can work like \node?
As a subquestion of that, what are the terminologies to talk about commands like \node in the aspect of language? A parallel example in Python is that when we define a function, we have positional arguments, keyword arguments, decorators .etc as follows:
@decorator
def function(pos_only_arg1, pos_only_arg2, /, arg1, arg2, *, kw_only_arg1, kw_only_arg2):
...
Is there similarly straight forward illustration for defining commands in latex? In the case of \node, I am particularly interested in the syntax at (0, 0) and [mystyle], which it seems impossible to implement with just \newcommand.
\pgfutil@ifnextchar(see lines starting with\def\tikz@fig odeand\def\tikz@@scan@figintikz.code.tex), which is similar to\@ifnextchar. – muzimuzhi Z May 20 '22 at 10:01