I am looking for a large equals sign and a small equal sign.
If we use \textdblhyphen
we get a small equals signs, but how can I simply "shrink" the usual = in LaTeX and "extend" the usual = just like the picture below?
Thanks!
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityYou can use leaders, with some care when the required length is small.
\documentclass{article}
\usepackage{graphicx}
\makeatletter
\newcommand{\shorteq}{\mathrel{\mkern0.2mu\mathpalette\shorteq@\relax\mkern0.2mu}}
\newcommand{\shorteq@}[2]{\scalebox{0.5}[1]{$\m@th#1=$}}
\newcommand{\longeq}[1]{\mathrel{\mathpalette\longeq@{#1}}}
\newcommand{\longeq@}[2]{%
\begingroup
\sbox\z@{$\m@th#1=$}%
\ifdim#2<\wd\z@
\resizebox{#2}{\height}{\box\z@}%
\else
\ifdim#2<3\wd\z@
\hbox to #2{$\m@th#1=\hss=\hss=\hss=$}%
\else
\hbox to #2{$\m@th#1=\cleaders\hbox to 0.2\wd\z@{\hss$#1=$\hss}\hfil=$}%
\fi
\fi
\endgroup
}
\makeatother
\begin{document}
$A\shorteq B$ $\scriptstyle A\shorteq B$
$A\longeq{2em}B$ $\scriptstyle A\longeq{1.6em}B$
\sbox0{$\longeq{12pt}$}\the\wd0
$A\longeq{2pt}B$\par
$A\longeq{4pt}B$\par
$A\longeq{6pt}B$\par
$A\longeq{8pt}B$\par
$A\longeq{10pt}B$\par
$A\longeq{12pt}B$\par
$A\longeq{14pt}B$\par
$A\longeq{16pt}B$\par
$A\longeq{18pt}B$\par
$A\longeq{20pt}B$\par
$A\longeq{22pt}B$\par
$A\longeq{24pt}B$\par
$A\longeq{26pt}B$\par
$A\longeq{28pt}B$\par
$A\longeq{30pt}B$\par
$A\longeq{32pt}B$\par
$A\longeq{34pt}B$\par
$A\longeq{36pt}B$\par
$A\longeq{38pt}B$\par
$A\longeq{40pt}B$\par
\end{document}
In case of length reduction, the ends are less curved, with Computer Modern fonts that have rounded caps.
\shorteq
reduces the width by half; \longeq
requires a length.
You can try merging two equal signs:
$A=\joinrel=B$
Or you can use leaders to extend this:
\def\varequals#1{\mathrel{\leaders\hbox to3pt{$=$\hss}\hskip#1=}}
$A\varequals{10pt}B$
The use of this macro is \varequals{dimen}
where dimen
corresponds roughly to how much extra width you'd like your equal sign to have.
But neither of these allow you to shorten the equals sign. One solution to this that I can think of uses my package pdfMsym. This solution also doesn't have the drawback of the \leaders
solution where the center may be more bold than the edges of the long equals sign.
% In your preamble
\input pdfmsym
\pdfmsymsetscalefactor{10} % Change 10 to be the font size you're using
\makeatletter
\def\varequals#1{\@Arrow@type\@Linecap\@Linecap{#1}{1}}
\makeatother
$A\varequals{10pt}B$
$A\varequals{3pt}B$
\@Arrow@type
creates a double stroked arrow and its parameters are, in order: its left and right lineheads, its length (this is relative to the current math style), and the height difference between the strokes. \@Linecap
is simply a double stroked rounded line cap, whose height difference is 1.
The \@Arrow@type
macro is not documented (but it should be).