5

Is there a better way than:

\mathlarger{\bigcirc}\hspace{-3mm}\mathsmaller{<}

which, though, mathjax does not seem to like

(Ignore the last line which caused confusion. Also, instead of < I meant, by the title, \oleqq. This also caused confusion.)

  • 1
    While mathjax uses LaTeX syntax, it uses Javascript and HTML's DOM model rather than TeX technology, making it mostly off topic for this site. You might try instead searching among the questions tagged with mathjax on Stack Overflow, or in the official mathjax-users Google group. – Sean Allred Jun 10 '15 at 14:40
  • I do not care about MathJax but I mentioned it because I had wanted to show here what I wanted. In my code, it works fine---but does not look too good. – schremmer Jun 10 '15 at 14:41
  • this symbol is in the st. mary road font: \olessthan. check the documentation (texdoc stmaryrd) not sure whether this will work with marhjax. – barbara beeton Jun 10 '15 at 14:42
  • I know but what I want is o less than OR EQUAL TO – schremmer Jun 10 '15 at 14:43
  • Have you tried detexify.kirelabs.org/classify.html? Again, no guarantees anything will work with MathJax. – Sean Allred Jun 10 '15 at 14:44
13

A little late to the party, but she makes up for it in compactness. Not being a mathjax user, I don't know if it carries over to it or not.

\documentclass{article}
\usepackage{stackengine,scalerel,amssymb}
\def\dclesize{\ThisStyle{\raisebox{-.7pt}{\scalebox{1.45}{$\SavedStyle\bigcirc$}}}}
\def\dcle{\ensurestackMath{\stackon[0pt]{\leqq}{\dclesize}}}
\def\cle{\def\stacktype{L}\mathbin{\scalerel*{\dcle}{\dclesize}}}
\begin{document}
$A \cle B _ {A \cle B _ {A \cle B}}$
\end{document}

enter image description here

  • That's nice ... but: I really want the full equal symbol under the less than symbol and I don't see how to replace \leq by \leqq in your code. – schremmer Jun 10 '15 at 17:17
  • @schremmer Please see revision. – Steven B. Segletes Jun 10 '15 at 17:54
  • Took me a while to re-figure out how to install a package by hand and to remember that it was \le rather than \leq etc but now it sure works and, the price codewise being just right, that's what I am now using. Grateful regards – schremmer Jun 10 '15 at 18:15
  • A possibly less ugly version could be with \leq or \leqslant (from amssymb). Yes, I find this utterly ugly. ;-) Of course, this doesn't influence the quality of the answer (+1). – egreg Jun 10 '15 at 20:10
  • 1
    @egreg As Segletes wrote "The customer is always right" and, in the instance, the customers are "developmental" students for whom \oleqq is more immediately seen as "less than or equal to". And the o, for oriented, is to remind them they are dealing with signed numbers. Ugly? Yes. Useful? Yes. – schremmer Jun 10 '15 at 23:04
9

A solution with TikZ:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}

\makeatletter
\newcommand*{\circledleqq}{%
  \mathrel{%
    \mathpalette\@mathcircledtikz{\leqq}%
  }%
}
\newcommand*{\@mathcircledtikz}[2]{%
  % #1: math style
  % #2: math symbol
  \tikz[
    baseline=(X.base),
    inner sep=.5\pgflinewidth,
    line width={%
      .4pt%
      \ifx#1\scriptstyle -.1pt\fi
      \ifx#1\scriptscriptstyle -.2pt\fi
    },%
  ]
  \node[circle,draw] (X) {$#1#2\m@th$};%
}
\makeatother

\begin{document}
\[
  A \circledleqq B_{A \circledleqq B_{A \circledleqq B}}
\]
\end{document}

Result

Remarks:

  • The symbol adjusts its size according to the current math style.
  • Also the line width decreases with the smaller math styles.
  • The vertical position of \leqq is not changed.

The circle could be a little higher, thus the next example adds some fine tuning:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}

\makeatletter
\newcommand*{\circledleqq}{%
  \mathrel{%
    \mathpalette{\@mathcircledtikz{1.05\height}{.9\depth}}{\leqq}%
  }%
}
\newcommand*{\@mathcircledtikz}[4]{%
  % #1: height fine tuning
  % #2: depth fine tuning
  % #3: math style
  % #4: math symbol
  \tikz[
    baseline=(X.base),
    inner sep=.5\pgflinewidth,
    line width={%
      .4pt%
      \ifx#3\scriptstyle -.1pt\fi
      \ifx#3\scriptscriptstyle -.2pt\fi
    },%
  ]
  \node[circle, draw] (X) {%
    \raisebox{0pt}[{#1}][{#2}]{%
      $#3#4\m@th$%
    }%
  };%
}
\makeatother

\begin{document}
\[
  A \circledleqq B_{A \circledleqq B_{A \circledleqq B}}
\]
\end{document}

Result fine tuning

The size of \leqq can also be decreased. The next example uses \textsmaller of package relsize. An alternative is scaling, but this also decreases the line width of the symbol.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage{relsize}

\makeatletter
\newcommand*{\circledleqq}{%
  \mathrel{%
    \mathpalette{\@mathcircledtikz{1.05\height}{.9\depth}}{\leqq}%
  }%
}
\newcommand*{\@mathcircledtikz}[4]{%
  % #1: height fine tuning
  % #2: depth fine tuning
  % #3: math style
  % #4: math symbol
  \tikz[
    baseline=(X.base),
    inner sep=.5\pgflinewidth,
    line width={%
      .4pt%
      \ifx#3\scriptstyle -.1pt\fi
      \ifx#3\scriptscriptstyle -.2pt\fi
    },%
  ]
  \node[circle, draw] (X) {%
    \raisebox{0pt}[{#1}][{#2}]{%
      \textsmaller{$#3#4\m@th$}%
    }%
  };%
}
\makeatother

\begin{document}
\[
  A \circledleqq B_{A \circledleqq B_{A \circledleqq B}}
\]
\end{document}

Result smaller \leqq

  • This is beautiful-if a bit pricey codewise. But it is beautiful. Grateful regards. – schremmer Jun 10 '15 at 16:45
5

Just for fun, here's a Plain TeX (or any format should be fine) version (I don't think there is a \leqq equivalent in plain...):

\def\circleit#1{{\setbox0=\hbox{$\bigcirc$}\setbox1=\hbox{#1}% 
    \dimen10=\wd0 \advance\dimen10 by \wd1\divide\dimen10 by 2      
    \dimen12=\ht0 \advance\dimen12 by \dp0 
    \advance\dimen12 by-\ht1 \advance\dimen12 by-\dp1
    \divide\dimen12 by 2 \advance\dimen12 by-\dp0 \advance\dimen12 by \dp1
    \hbox to \wd0{\lower\dimen12\copy0\kern-\dimen10\copy1\hss}}}



$\circleit{$\scriptstyle\leq$}$

a\circleit bc

$a\circleit{$\scriptscriptstyle\leq$}b$

 $a \circleit{$\scriptstyle\leq$}b$

$a^\circleit{$b$}$

\bye

The argument is centered in the circle. It's put in an hbox, hence should be in dollar signs if you want math fonts or math symbols.

enter image description here

  • Why \dimen10 and \dimen12 and not \dimen0 and \dimen2 as usual? Also \box1 should be used globally, better \box2. – egreg Jun 10 '15 at 22:59
  • @egreg I wrote this some time ago and never got around to cleaning it up. It was part of some other macros that used box registers. Would you explain why \box1 should be be global, please? – David Mitra Jun 10 '15 at 23:34
  • The TeXbook, page 346: 2. Allocations of registers. […] (3) All assignments to the scratch registers whose numbers are 1, 3, 5, 7, and 9 should be \global; all assignments to the other scratch registers (0, 2, 4, 6, 8, 255) should be non-\global. (This prevents the phenomenon of “save stack buildup” discussed in Chapter 27.) – egreg Jun 10 '15 at 23:41

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.