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.)

percusse
  • 157,807
schremmer
  • 2,107
  • 1
    While [tag: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
  • 1
    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 http://detexify.kirelabs.org/classify.html? Again, no guarantees anything will work with MathJax. – Sean Allred Jun 10 '15 at 14:44
  • Sorry about misleading everybody with MathJax. The code I gave works fine in my LaTeX document but is quite clunky. So, my question was about a better code to achieve the same result in regular LaTeX, namely \leqq inside a circle. – schremmer Jun 10 '15 at 14:47
  • If you really don't care if it works with MathJax, let me know and I'll retract the close vote as off-topic (but it could still be closed as a dupe of How to look up a symbol or identify a math symbol or character?. Do any of the answers there help you? – Sean Allred Jun 10 '15 at 14:48
  • Vote retracted. :) – Sean Allred Jun 10 '15 at 14:48
  • Can you provide a minimal working example (MWE)? I'm not sure where \mathlarger, etc. are coming from. Otherwise, this looks like a job for stackengine :) – Sean Allred Jun 10 '15 at 14:50
  • The question implies that there's something wrong or suboptimal about the way you're doing it now, but you're not saying what it is, and I can't see it from just seeing a line of code. Could you clarify? – Sverre Jun 10 '15 at 16:18
  • (1) @Allred I absolutely and totally do not care about MathJax. (2) There does not seem to be any existing font for "less than or equal to" inside a circle so it is not really a matter of font. (3) \mathlarger is in the relsize package (4) The code I gave works (5) The code I gave is clunky (6) Probably inasmuch as it uses \hspace, the less than or equal to symbol moves a bit inside the big circle symbol. – schremmer Jun 10 '15 at 16:40
  • @Allred. Is it possible to remove the tag MathJax which is certainly even more misleading? – schremmer Jun 10 '15 at 17:13
  • @schremmer -- the reason i pointed to stmaryrd was that i was reading the code, not the question itself. the code you show doesn't have any equal component. might be more helpful to future readers if you made the two pieces agree. a side issue (for me, working with unicode), how would \oleq or \oleqq be used? do you have a published reference that i could present to the unicode committee in a request? – barbara beeton Jun 10 '15 at 17:26
  • @schremmer sure -- just edit your question and remove the tag :) and by the way, @Allred won't ping me, but @Sean (or @SeanAllred) will. – Sean Allred Jun 10 '15 at 17:31
  • @barbarabeeton Touché and I apologize! I am not sure I understand what you mean by "how would \oleq or \oleqq be used?" The reason I am using "o symbols" is to remind "develomental" students that they are now dealing with signed numbers and the reason I am using \oleqq rather than \oleq is because these students see it better. – schremmer Jun 10 '15 at 22:50
  • @schremmer -- thanks for clarification. by "how it's used" i meant, in the context of a "mainstream" mathematical publication, what would it be defined to mean, and how would it appear in, say, an equation. if a previously unencoded symbol can be shown to be "mainstream", i can present it to the unicode committee for adding it to unicode. your use, while it makes excellent sense, doesn't qualify under the present unicode rules, but if it's adopted by others, it may, in the future. – barbara beeton Jun 11 '15 at 12:03

3 Answers3

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
  • @egreg The customer is always right. I started with \le and the OP (as you see in the comment) wanted it with a full equal underneath. – Steven B. Segletes Jun 10 '15 at 20:14
  • 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

Heiko Oberdiek
  • 271,626
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