5

I want to design a new element symbol. How can I add the red line and blue line (different codes \myin \mynotin ) to my code?

enter image description here enter image description here

\documentclass[a5paper]{article}
\usepackage[margin=1.5cm]{geometry}
\usepackage{tikz}
\def\h {1.3ex} % cup and cap height
\def\w {1.2ex} % cup and cap width
\def\lw{0.12ex} % cup and cap line width
\def\spp{0.7269ex} % space before and after

\newcommand{\myinn}[1]
{
  \hspace{\spp}
  \tikz[line width=\lw,line cap=round,rotate=#1,baseline=-0.4ex]
  {\draw (-0.5*\w,0.5*\h) -- (-0.5*\w,0.5*\w-0.5*\h)
  arc (-180:0:0.5*\w) -- (0.5*\w,0.5*\h);}
  \hspace{\spp}
}
\newcommand{\myin}{\myinn{270}}
\begin{document}
\[\myin\]
\end{document}
9
  • hm, $\in$, $\notin$? or should be symbol elements colored as shown on image?
    – Zarko
    Oct 3, 2021 at 15:26
  • No. color is not a problem @zarko
    – suarez
    Oct 3, 2021 at 15:28
  • why you like to draw this symbols if they already exist? I do not understand your intention :-(
    – Zarko
    Oct 3, 2021 at 15:31
  • I use in different fonts @Zarko
    – suarez
    Oct 3, 2021 at 15:32
  • Which fonts you use (that not support basic math symbols)?
    – Zarko
    Oct 3, 2021 at 15:35

2 Answers 2

2

It is not entirely clear, what is your problem. Exercise with drawing symbols as pictures (not recommended for use in documents) or to have symbols appropriate size.

Anyway, the standard use of your symbols:

\documentclass{standalone}

\begin{document}
text $\in$, $\notin$
\end{document}

gives good match sizes of symbols and text:

enter image description here

If this is not your problem/concern, please edit your question and clarify, what you like to have.

1
  • I want to re-encode the element symbol. I wrote some of the code but I couldn't create the middle line.
    – suarez
    Oct 3, 2021 at 16:20
1

This produces your desired effect:

\usepackage{xcolor}
\usepackage{calc}

\newlength{\len}
\settowidth{\len}{$\notin$}
\newcommand{\mynotin}{\mbox{
{\color{blue}$\notin$}%
$\hspace{-\len}${\color{red}$\in$}%
$\hspace{-\len}${\color{black}$\subset$}%
}}
$a \mynotin\ S$ 

enter image description here

You must log in to answer this question.

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