1

First, a minimal working sample is as follows.

\documentclass{article}
\usepackage{tikz}

\makeatletter \newcommand*\newcirc{\mathrel{% \tikz{% \draw (0em,0em) circle [radius=0.2em];% }}} \makeatother

\begin{document}

[ \phi\newcirc\psi ]

\end{document}

As you see, I defined a math symbol of \newcirc by TikZ. It seems to work well. While when I put it in the script without brackets, for example, $\phi_\newcirc$, it doesn't work. So is there any way to fix the problem by revising the codes? (I don't like to add brackets every time when I use it singly in the script, for example, $\phi_{\newcirc}$)

projetmbc
  • 13,315
M. Logic
  • 4,214

1 Answers1

0

I don't like to add brackets every time when I use it singly in the script, for example, $\phi_{\newcirc}$

You may define a command which frees you from typing _{ }:

\newcommand{\phiI}[1]{\phi_{#1}}
\phiI\newcirc

which works as long as you your intention i to put just one token after \phiI.

(It is good idea to combine that with scaled definition of \newcirc as Rmano suggests.)


You could define _ to make it behave the same as \ind I define bellow, but I do not think redefining _ is a good idea.


There are more ways how to save some typing:

\newcommand\phicirc{\phi_{\newcirc}}
\[ \phicirc \]

\newcommand\gr[1]{{#1}} [ \phi_\gr\newcirc ]

\newcommand\grcirc{{\newcirc}} [ \phi_\grcirc ]

\newcommand\ind[1]{_{#1}} [ \phi\ind\newcirc ]

\newcommand\indcirc{_{\newcirc}} [ \phi\indcirc ] [ \psi\indcirc - \mu\indcirc]

\newcommand\withcirc[1]{#1_{\newcirc}} [ \withcirc\psi + \withcirc\mu + \withcirc\phi ]


Sometimes I use optional arguments, e.g.,

\renewcommand\phicirc[1][]{\phi_{\newcirc#1}}
\[ \phicirc  \qquad   \phicirc[_3]   \]
minorChaos
  • 260
  • 6