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}

suarez
  • 182

2 Answers2

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.

Zarko
  • 296,517
  • I want to re-encode the element symbol. I wrote some of the code but I couldn't create the middle line. – suarez Oct 03 '21 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