# Double equal sign - Problem with \usepackage[T1]{fontenc}

I have made a macro to type a double equal sign but the signs are thinner when I use \usepackage[T1]{fontenc} (see the picture and the code below). How can I fix this?

\documentclass[12pt,a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} % <--- This is the guilty package
\usepackage{ucs}

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{calc}

\newcommand\shorteq{\resizebox{.5em}{\heightof{=}}{=}}

\newcommand\eqtest{\mathop{\shorteq\mkern1mu\shorteq}}

\begin{document}

$A \eqtest B$

$A = B$

\end{document}


You're using the text mode = instead of the math mode one.

Here's a different implementation that also scales automatically in subscripts and superscripts. You don't need calc, because in the context of \resizebox you can use \width and \height to refer to the dimensions of the box being resized.

\documentclass[12pt,a4paper]{article}

\usepackage[T1]{fontenc}

\usepackage{amsmath}
\usepackage{graphicx}

\makeatletter
\newcommand\shorteq{\mathrel{\mathpalette\shorteq@{.75}}}
\newcommand{\shorteq@}[2]{%
\resizebox{#2\width}{\height}{$\m@th#1=$}%
}
\makeatother

\begin{document}

$A \shorteq B$

$A = B$

$X_{a\shorteq b}$

$X_{a=b}$

\end{document}


Notes.

1. ucs is obsolete and does nothing useful

2. inputenc is not necessary if utf8 input is used.

3. A relative width has been used (adjust it to suit) rather than 0.5em that makes little sense.

• Thanks for the code and the comments. What is the 1st argument of \shorteq@? – projetmbc Feb 28 at 10:59
• @projetmbc It is the current math style, provided by \mathpalette. See tex.stackexchange.com/q/34393/4427 – egreg Feb 28 at 11:07
• Thanks a lot for the link! – projetmbc Feb 28 at 11:09