5

I just figured out, that the greater equal symbol, \geq, don't look as I want it to look when I print my document. Because I used it very often, I want to redefine the \geq command resulting in another version.

Firstly it is to big. I found the package scalerel and managed to scale it and redefine it:

\let\oldgeq\geq
\renewcommand{\geq}{\scaleobj{0.8}{\oldgeq}}

That works fine, the spaces are too small, but that's not the point here.

Secondly, the bottom line of the symbol is not aligned with the rest of the text. It' a bit below the rest if you look closely. So I tried to align it or set it a little over the textline, but it didn't work. I found a work-around with tikz, but then it only fits in the right place in normalfont. I want it to align with the text in every fontsize, so this isn't a good solution.

Maybe someone can help me with my second problem or have an even better solution for the whole problem?

Here is a MWE:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{scalerel}

\let\oldgeq\geq
\renewcommand{\geq}{\scaleobj{0.8}{\oldgeq}}

\begin{document}
$5\oldgeq8$ $5\geq8$
\end{document}

Thanks in advance.

  • 1
    To fix the spacing, \renewcommand{\geq}{\mathrel{\scaleobj{0.8}{\oldgeq}}}. That is, make the renew'ed macro of class \mathrel (math relation). – Steven B. Segletes Aug 24 '17 at 10:02
6

I'm not sure what you dislike about the standard symbol. Anyway, you can and should use \mathpalette.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\let\oldgeq\geq
\let\oldleq\leq
\renewcommand{\geq}{\mathrel{\mathpalette\bueckirel\oldgeq}}
\renewcommand{\leq}{\mathrel{\mathpalette\bueckirel\oldleq}}
\newcommand{\bueckirel}[2]{%
  \raisebox{\depth}{\scalebox{0.8}{$#1#2$}}%
}

\begin{document}

$5\oldgeq8$ $5\geq8_{a\geq b}$

$5\oldleq8$ $5\leq8_{a\leq b}$

\end{document}

enter image description here

  • Just to clarify, I am perfectly fine with the standard symbol, but the supervisor of my project was very unhappy with it, so I just had to find a solution. However, it seems to work, thanks. So just to learn something new: the \mathpalette is there to choose the font size? – buecki Aug 24 '17 at 12:38
  • @buecki Look for it on the site, you'll find several examples – egreg Aug 24 '17 at 12:51
  • sorry, but the position in the subscript looks just terrible. – barbara beeton Aug 24 '17 at 12:57
  • @barbarabeeton Tell it to the OP's supervisor – egreg Aug 24 '17 at 13:01
3

This sets the base of the revised \geq to the same depth as the original, and also fixes the horizontal spacing. EDITED to handle smaller math styles.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{scalerel,stackengine}

\let\oldgeq\geq
\newcommand{\geqaux}{\mathrel{\scaleobj{0.8}{\oldgeq}}}
\renewcommand\geq{\mathrel{\ThisStyle{%
  \setbox0=\hbox{$\SavedStyle\geqaux$}
  \edef\dpgeq{\the\dp0}
  \abovebaseline[-\dpgeq]{$\SavedStyle\geqaux$}
}}}
%\renewcommand\geq{\mathrel{\ThisStyle{\abovebaseline[0pt]{$\SavedStyle\geqaux$}}}}

\begin{document}
$5\oldgeq8\quad 5\geq8$

$\scriptstyle 5\oldgeq8\quad 5\geq8$
\end{document}

enter image description here

If one actually wanted the horizontal slash of the symbol to be on the number baseline itself, then use the commented version of the \geq redefinition, resulting in

enter image description here

  • Thank a lot, this works very well. I just check it with the different font style I use in my project. – buecki Aug 24 '17 at 12:38
  • the traditional design of relational and binary operators has them vertically centered on the math axis (the vertical position of a minus sign, the cross of a plus, or the position of a fraction line). by moving one such symbol off this axis, there is a danger that it will look out of position in relation to others that are close by. – barbara beeton Aug 24 '17 at 12:56
  • @barbarabeeton I understand. However, i was just responding to the OP's complaint that "the bottom line of the symbol is not aligned with the rest of the text" – Steven B. Segletes Aug 24 '17 at 12:58
  • good enough for grade school math. not good enough for postgraduate level. – barbara beeton Aug 24 '17 at 13:02
  • @barbarabeeton Ouch! That left a mark. – Steven B. Segletes Aug 24 '17 at 13:04

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.