0

I want to add the following symbols to show the connection between some data-models in .tex document, I was wondering to know whether we have any predefined code (latex of Unicode) for them, or I have to use pictures.

enter image description here

3
  • 1
    See arws.meta library in TIkZ package, – Zarko Oct 3 '20 at 20:00
  • 1
    Should the symbols be that long? – egreg Oct 3 '20 at 20:01
  • @egreg , not actually, I just need the right sides – Mironline Oct 3 '20 at 20:10
3

Here's a proposal:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\ljoinrel}[1]{\mathrel{\mspace{-#1mu}}}
\newcommand{\negljoinrel}[1]{\mathrel{\mspace{#1mu}}}

\newcommand{\One}{%
  \relbar\ljoinrel{4}\relbar\ljoinrel{4}\relbar
  \ljoinrel{14}\mapstochar\negljoinrel{14}%
}
\newcommand{\Many}{%
  \relbar\ljoinrel{4}\relbar\ljoinrel{4}\relbar
  \ljoinrel{14}<%
}
\newcommand{\Oone}{%
  \relbar\ljoinrel{7}\relbar\ljoinrel{7}\relbar\ljoinrel{6}\relbar
  \ljoinrel{14}\mapstochar\negljoinrel{6}\mapstochar\negljoinrel{6}%
}
\newcommand{\Onemany}{%
  \relbar\ljoinrel{4}\relbar\ljoinrel{4}\relbar
  \ljoinrel{14}\mapstochar<%
}
\newcommand{\Zeroone}{%
  \relbar\ljoinrel{11}\relbar\joinrel
  \mathrel{\circ}\joinrel
  \relbar\ljoinrel{8}\mapstochar\negljoinrel{8}%
}
\newcommand{\Zeromany}{%
  \relbar\ljoinrel{11}\relbar\joinrel
  \mathrel{\circ}\joinrel
  \relbar\ljoinrel{14}<%
}

\begin{document}

\sbox0{$\One$}\showthe\wd0
\sbox0{$\Many$}\showthe\wd0
\sbox0{$\Oone$}\showthe\wd0
\sbox0{$\Onemany$}\showthe\wd0
\sbox0{$\Zeroone$}\showthe\wd0
\sbox0{$\Zeromany$}\showthe\wd0

$A \One B$

$A \Many B$

$A \Oone B$

$A \Onemany B$

$A \Zeroone B$

$A \Zeromany B$

\end{document}

enter image description here

1
  • you are awesome – Mironline Oct 3 '20 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.