2

I am using the IEEE ACCESS template and in my paper, I am using the following equation code where I want to show the alphabet on the circle. How can I use it? The equation code is working but gives me a warning

Command \textcircled invalid in math mode on input line 189.

How can I remove this warning?

\newcommand*\tcircle[1]{\textcircled{\raisebox{-0.5pt}{\fontsize{7pt}{0}\fontfamily{phv}\selectfont{#1}}}}

\begin{equation} \begin{split} \tilde \uptau &=T_{\tcircle{A},i}-T_1 \end{split} \label{eq9} \end{equation}

gernot
  • 49,614
  • 1
    Hi and welcome to TeX.SX. It would be much easier for us to help you with the problem if you give us a Minimal Working Example from \documentclass{ieeeaccess} and ending with \end{document} that recreates the problem – Elad Den Oct 07 '20 at 10:16
  • Also, you should consider this answer: https://tex.stackexchange.com/a/123926/90297 – Elad Den Oct 07 '20 at 10:19

2 Answers2

6

Move \textcircled inside the \raisebox command. As the error message says, \textcircled has to be used in text mode, not math mode.

\documentclass{article}
\newcommand*\tcircle[1]{%
  \raisebox{-0.5pt}{%
    \textcircled{\fontsize{7pt}{0}\fontfamily{phv}\selectfont #1}%
  }%
}
\begin{document}
\[T_{\tcircle{A},i}-T_1\]
\end{document}

enter image description here

gernot
  • 49,614
0

Using a mix of packages including harmony and scalerel to decrease or increase the text-circle "symbol" to have a good subscript, with this new macro, different from the original of the OP,

\newcommand{\lcirc}[1]{\scaleobj{.6}{\mbox{\Kr{#1}}}}

you can obtain this MWE:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{harmony}
\usepackage{scalerel}
\newcommand{\lcirc}[1]{\scaleobj{.6}{\mbox{\Kr{#1}}}}
\begin{document}

[T_{\lcirc{A},i}-T_1] [T_{\lcirc{a},i}-T_1] [T_{\lcirc{B},i}-T_1] [T_{\lcirc{W},i}-T_1] \end{document}

... with this output that have the same font into the circle:

enter image description here

Sebastiano
  • 54,118