14

I want to create a stylized version of the i where the dot has been replaced by a $\star$.

Startittle

I know how to stackrel, but that's about the only thing I know about stacking things on top of eachother.

2 Answers 2

14

Some low level TeX is the easiest way:

\documentclass{article}

\makeatletter
\newcommand{\generic}{\textsf{Gener\istar c}}
\newcommand{\istar}{%
  \leavevmode
  \vbox{%
    \offinterlineskip
    \ialign{\hfil##\hfil\cr\hidewidth$\scriptstyle\star$\hidewidth\cr\i\cr}%
  }%
}
\makeatother

\begin{document}

\Large \generic

\normalsize \generic

\footnotesize \generic

\end{document}

enter image description here

With the help of the accsupp package you can make the text searchable and copyable as “Generic”. Unfortunately, not all PDF viewers support the feature.

\documentclass{article}

\usepackage{accsupp}

\makeatletter
\DeclareRobustCommand{\generic}{%
  \BeginAccSupp{ActualText=Generic}\textsf{Gener\istar c}\EndAccSupp{}}
\newcommand{\istar}{%
  \leavevmode
  \vbox{%
    \offinterlineskip
    \ialign{\hfil##\hfil\cr\hidewidth$\scriptstyle\star$\hidewidth\cr\i\cr}%
  }%
}
\makeatother

\begin{document}

\Large \generic

\normalsize \generic

\footnotesize \generic

\end{document}
2
  • 2
    Do you know also if it is possible for the text to "behave" like "Generic" does? By behave I mean copying/highlighting and searching. That the textual representation is "Generic". Commented Sep 29, 2015 at 10:08
  • 3
    @PålGD That can be done with the accsupp package, but copying will only work with some PDF readers. If the PDF reader doesn't support the feature, there's nothing to do, as far as I know. I added the code.
    – egreg
    Commented Sep 29, 2015 at 10:29
5

Here it is with a stackengine approach. EDITED to use \i instead of i.

The vertical position of the star may be adjusted with the .02\baselineskip optional argument, and the horizontal position of the star may be adjusted with the \mkern-.2mu adjustment.

\documentclass{article}
\usepackage{stackengine}
\newcommand\istar{\def\useanchorwidth{T}%
  \stackon[.02\baselineskip]{\i}{$\mkern-.2mu\scriptstyle\star$}}
\newcommand\generic{Gener\istar c}
\begin{document}
\generic\ \textsf{\generic}\par
\Huge\generic\ \textsf{\generic}\par
\footnotesize\generic\ \textsf{\generic}\par
\scriptsize\generic\ \textsf{\generic}\par
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .