How to create a dashed equality symbol as follows?
Also, make sure that, it
- be effected by
\not
the same as=
, - and act the same as = in other ways.
By the way, it's not necessary that there must be three gaps in =
.
relation-symbolssymbols
How to create a dashed equality symbol as follows?
Also, make sure that, it
\not
the same as =
,By the way, it's not necessary that there must be three gaps in =
.
Here is a pure LaTeX solution that uses \dashedleftarrow
from MnSymbol
, and makes it extendable with (shortened) minus signs, as usual for extendable accents. The new command to use is \odla{...}
, short for \overdashedleftarrow
.
\documentclass{article}
\usepackage{graphicx}
\usepackage{MnSymbol}
\makeatletter
\newcommand{\odla}[1]{%
\vbox {\m@th\ialign{##\crcr
\odlafill \crcr
\noalign{\kern-\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}
%% fill with (short) minus signs
\def\odlafill{%
$\m@th\dashedleftarrowtip\mkern-5mu\cleaders\hbox{$\mkern4mu\shortbar\mkern-3mu$}\hfill\mkern-0.5mu$}
%% put 2pt space above and below the tip
\def\dashedleftarrowtip{%
\raisebox{\z@}[2pt][2pt]{$\mathord{\dashedleftarrow}$}}
%% make the minus shorter to fit \dashedleftarrow
\def\shortbar{%
\smash{\scalebox{0.4}[1.0]{$-$}}}
\makeatother
\begin{document}
\begin{equation*}
\odla{x} \quad \odla{ab} \quad \odla{abc} \quad \odla{abcd} \quad \odla{abcde} \quad \odla{a}^{\:\odla{b}} \quad \odla{abcdefghijklmnop}
\end{equation*}
\end{document}
In the likely case you don't want to use MnSymbol
as your math font just to have the \dashedleftarrow
we use as a the arrow tip here, we can use this symbol like this:
\documentclass{article}
\usepackage{graphicx}
\DeclareFontFamily{U}{MnSymbolA}{}
\DeclareSymbolFont{MnSyA}{U}{MnSymbolA}{m}{n}
\DeclareFontShape{U}{MnSymbolA}{m}{n}{
<-6> MnSymbolA5
<6-7> MnSymbolA6
<7-8> MnSymbolA7
<8-9> MnSymbolA8
<9-10> MnSymbolA9
<10-12> MnSymbolA10
<12-> MnSymbolA12}{}
\DeclareMathSymbol{\dashedleftarrow}{\mathrel}{MnSyA}{98}
\makeatletter
\newcommand{\odla}[1]{%
\vbox {\m@th\ialign{##\crcr
\odlafill \crcr
\noalign{\kern-\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}
%% fill with (short) minus signs
\def\odlafill{%
$\m@th\dashedleftarrowtip\mkern-5mu\cleaders\hbox{$\mkern4mu\shortbar\mkern-3mu$}\hfill\mkern-0.5mu$}
%% put 2pt space above and below the tip
\def\dashedleftarrowtip{%
\raisebox{\z@}[2pt][2pt]{$\mathord{\dashedleftarrow}$}}
%% make the minus shorter to fit \dashedleftarrow
\def\shortbar{%
\smash{\scalebox{0.4}[1.0]{$-$}}}
\makeatother
\begin{document}
\begin{equation}
\odla{x} \quad \odla{ab} \quad \odla{abc} \quad \odla{abcd} \quad \odla{abcde} \quad \odla{a}^{\:\odla{b}} \quad \odla{abcdefghijklmnop}
\end{equation}
\end{document}
OK, this is far from being perfect, but in some sense there is no perfectness on the route my answer you linked to. The problem is this: when we use the dashed arrow from MnSymbol
as the arrow tip of an extensible dashed arrow, this symbol defines the length of the dash as well as the gap between dashes. If you also want the extensible dashed arrow to have exactly the same length as one of the standard extensible arrows like \overrightarrow
, we have to compromise somewhere as not always an integral multiple of the (fixed) dashed pattern will match. So we will have uneven spaces somewhere.
\documentclass{article}
\usepackage{graphicx}
\DeclareFontFamily{U}{MnSymbolA}{}
\DeclareSymbolFont{MnSyA}{U}{MnSymbolA}{m}{n}
\DeclareFontShape{U}{MnSymbolA}{m}{n}{
<-6> MnSymbolA5
<6-7> MnSymbolA6
<7-8> MnSymbolA7
<8-9> MnSymbolA8
<9-10> MnSymbolA9
<10-12> MnSymbolA10
<12-> MnSymbolA12}{}
\DeclareMathSymbol{\dashedleftarrow}{\mathrel}{MnSyA}{98}
\DeclareMathSymbol{\dashedrightarrow}{\mathrel}{MnSyA}{96}
\def\Gg{{\mathbf{G}}}
\def\gc{{\mathbf{g}}}
\newcommand{\toright}[1]{\overrightarrow{#1}}
\newcommand{\toleft}[1]{\overleftarrow{#1}}
\newcommand{\torightleft}[1]{\toleft{\toright{#1}}}
\newcommand{\toprerightleft}[1]{\toleft{\topreright{#1}}}
\newcommand{\torightpreleft}[1]{\topreleft{\toright{#1}}}
\newcommand{\toprerightpreleft}[1]{\topreleft{\topreright{#1}}}
\newcommand{\toleftright}[1]{\toright{\toleft{#1}}}
\newcommand{\topreleftright}[1]{\toright{\topreleft{#1}}}
\newcommand{\toleftpreright}[1]{\topreright{\toleft{#1}}}
\newcommand{\topreleftpreright}[1]{\topreright{\topreleft{#1}}}
\makeatletter
\newcommand{\topreleft}[1]{%
\vbox {\m@th\ialign{##\crcr
\topreleftfill \crcr
\noalign{\kern-\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}
\newcommand{\topreright}[1]{%
\vbox {\m@th\ialign{##\crcr
\toprerightfill \crcr
\noalign{\kern-\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}
%% fill with (short) minus signs
\def\topreleftfill{%
$\m@th%
\dashedleftarrowtip%
\mkern-1mu%
\xleaders\hbox{$\mkern2mu\shortbar\mkern-1mu$}\hfill%
\mkern1mu%
\shortbar%
\mkern0.5mu%
$}
\def\toprerightfill{%
$\m@th%
\mkern.5mu%
\shortbar%
\mkern-1mu%
\xleaders\hbox{$\mkern2mu\shortbar\mkern-1mu$}\hfill%
\mkern1mu%
\dashedrightarrowtip%
$}
%% put 4.0pt space above and 0.0pt below the tip
\def\dashedleftarrowtip{%
\raisebox{\z@}[4.0pt][0.0pt]{$\mathord{\dashedleftarrow}$}}
\def\dashedrightarrowtip{%
\raisebox{\z@}[4.0pt][0.0pt]{$\mathord{\dashedrightarrow}$}}
%% make the minus shorter to fit \dashedleftarrow
\def\shortbar{%
\smash{\scalebox{0.4}[1.0]{$-$}}}
\makeatother
\begin{document}
Arrow over G should fit nicely into the brackets:
\[%
\left[\toleft{\Gg}\right] = \left[ \topreleft{\Gg} \right]
= \left[\toright{\Gg}\right] = \left[ \topreright{\Gg} \right].
\]
Dashed right arrow and left arrow should be of the same length and align:
\[%
\toprerightleft{\gc} = \topreleftright{\gc} = \torightpreleft{\gc} = \toleftpreright{\gc} = \toprerightpreleft{\gc} = \topreleftpreright{\gc} = \torightleft{\gc} = \torightleft{[\gc]}
\]
Left and right arrow should align and have the same length:
\[%
\toprerightpreleft{\gc} = \toprerightpreleft{\Gg}
\]
\bigskip
\[%
\topreright{\topreleft{x}} \quad \topreright{\topreleft{ab}} \quad \topreright{\topreleft{abc}} \quad \topreright{\topreleft{abcd}} \quad \topreright{\topreleft{abcde}}
\]
\[%
\topreleft{\topreright{x}} \quad \topreleft{\topreright{ab}} \quad \topreleft{\topreright{abc}} \quad \topreleft{\topreright{abcd}} \quad \topreleft{\topreright{abcde}}
\]
\end{document}
So there is still some perfectness to be desired. Since you wanted to know how to tweak the parameters, here is how it works. The vertical layout is determined by the arrow tips. The definition
\def\dashedleftarrowtip{%
\raisebox{\z@}[4.0pt][0.0pt]{$\mathord{\dashedleftarrow}$}}
says that thre is no space (0.0pt) below the arrow tip, and 4.0pt above. That way you can position the arrows and determine their distance when they are stacked. This also influences the size of the \left[...\right]
braces, as those encompass also the white space above the arrow.
The horizontal pattern is determined by
\def\topreleftfill{%
$\m@th%
\dashedleftarrowtip%
\mkern-1mu%
\xleaders\hbox{$\mkern2mu\shortbar\mkern-1mu$}\hfill%
\mkern1mu%
\shortbar%
\mkern0.5mu%
$}
Here, \mkern1mu
is a horizontal kerning space of length 1mu
=1/18\quad
. The \xleaders
command fills as much space as possible (\hfill
) with the pattern \hbox{$\mkern2mu\shortbar\mkern-1mu$}
, where the remaining space that can not be filled with another box is evenly distributed before, after and in between the repeated boxes.
Best Answer
Here is a different solution using the
trimclip
package. This works with all sizes (large, Huge, etc.) as well asscriptstyle
andscriptscriptstyle
.Instead of overlaying white onto an
=
sign, we clip portions of the=
sign and replace with whitespace. I selected the left, middle and right 1/4 of the=
sign indicated in the code as.25\weq
(left quarter) followed by an eighth space (.125\weq
) followed by the middle quarter (.375\weq
to.625\weq
), etc. You can adjust the spacing however you wish, or subdivide the=
even more.Update
Here are two additional versions where the clipping only affects one of the lines. Instead of inserting space between the segments, a clipped
=
symbol is inserted. When the bottom portion is clipped (\eqeqeqb
) the baseline changes so a\raisebox
command is used.