1

I'm curious how I can make a custom character, more specificlly I want to inscribe equal sign into different shapes like circle, trianle and whatever I want. Is it possible to do that without tikz package? enter image description here

Here is an example of what I want (I made it using image editor just to show).

4
  • You will have to be able to create the appropriately sized outer figure (without tikz you say). Then, you could use stackengine as \stackinset{c}{}{c}{<v-shift>}{$=$}{$<my outer shape>$} Apr 20, 2020 at 13:29
  • Have a look at the circledsteps package. It gives you the circled text right away, and shows you what you can do for the other shapes. tcolorbox also can give you these but probably it does not count as "no TikZ".
    – user194703
    Apr 20, 2020 at 13:30
  • Example: \documentclass{article} \usepackage{stackengine,amssymb,graphicx} \begin{document} \stackinset{c}{}{c}{-.2ex}{$=$}{$\bigcirc$} \stackinset{c}{.03ex}{c}{-.15ex}{$=$}{\scalebox{1.25}{$\square$}} \stackinset{c}{.03ex}{c}{-.15ex}{$=$}{\rotatebox[origin=c]{45}% {\scalebox{1.25}{$\square$}}} \end{document} Apr 20, 2020 at 13:31
  • You can also overlap characters using \rlap, \llap and \makebox[0pt]. Apr 20, 2020 at 14:56

1 Answer 1

2

Here's a solution, or at least a partial one. It defines an \inscribedeq command, which takes as a mandatory argument the symbol in which the equal sign should be inscribed. It also takes two optional arguments which allow to fine-tune the look of the result:

  • The first optional argument is a length by which the symbol is raised;
  • The second one is a factor by which the symbol is scaled.

Here are a few examples with symbols from MnSymbol.

\documentclass{article}
\usepackage{amsmath}
\usepackage{MnSymbol}
\usepackage{graphicx}
\usepackage{xparse}

\newlength{\eqwidth}
\newlength{\symbwidth}
\newlength{\maxwidth}
\settowidth{\eqwidth}{\(=\)}
\NewDocumentCommand{\inscribedeq}{O{0pt} O{1} m}{%
    \settowidth{\symbwidth}{\scalebox{#2}{\(#3\)}}
    \ifdim \eqwidth > \symbwidth
        \let\maxwidth\eqwidth
    \else
        \let\maxwidth\symbwidth
    \fi%
    \mathrel{%
        \raisebox{#1}{\makebox[0pt][l]{\scalebox{#2}{\(#3\)}}}%
        \makebox[\maxwidth]{\(=\)}%
    }%
}
\begin{document}
\begin{tabular}{ll}
\( x \inscribedeq{} y \)                & \( x \inscribedeq{\largecircle} y \)                  \\
\( x \inscribedeq{\largesquare} y \)    & \( x \inscribedeq[.1pt][1.1]{\largetriangleup} y \)   \\
\( x \inscribedeq{\largediamond} y \)   & \( x \inscribedeq{\circlearrowleft} y \)              \\
\( x \inscribedeq{\bigcup} y \)         & \( x \inscribedeq[-1pt][1.5]{\largestar} y \)
\end{tabular}
\end{document}

You must log in to answer this question.

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