0

I'm looking for the text mode version of $\leq$

Every time I search on Google/DuckDuckGo/etc. I only get results for the math-mode version of ≤ which is $\leq$

I'm writing in a non-standard font, so to a sharp eye, there is a font switch that is visible. I don't like this.

How can I write ≤ in text mode?

con
  • 351
  • 1
  • 3
  • 15

1 Answers1

1

in lualatex or xelatex just write ≤ and (if the font has the character) that is all you need. In classic pdftex font encodings that character is not available in the text fonts, so with pdflatex it is not possible in general.

An example for egreg:

enter image description here

\documentclass{article}

\usepackage{fontspec} \setmainfont{Comic Sans MS}

\begin{document} one ≤ two \end{document}

David Carlisle
  • 757,742
  • both xelatex and lualatex leave "≤" as blank :( – con Aug 09 '21 at 13:19
  • @con no I was just writing an example. Check the log file you probably got a message saying the font that you are using does not have ≤. Clearly latex can only set the character if you use a font that has it. – David Carlisle Aug 09 '21 at 13:21
  • Indeed, the log file shows Missing character: There is no ≤ in font [lmroman10-regular]:mapping=tex-text;! also\renewcommand{\familydefault}{\sfdefault} doesn't show it. I'll try other fonts – con Aug 09 '21 at 13:25
  • 1
    but if you are using latin modern then why not use the latin modern math font??? The fact that that is technically a different file is just an implementation detail and has no visible effect. (If you asked the font maintainers to add the ≤ to latin modern they would just copy the glyph from the math font if they did anything so the visual end result would be identical. @con – David Carlisle Aug 09 '21 at 13:27
  • @con you posted no example in the question (all questions are improved if they have a test document) but you said you are using a non standard font, but lmroman is the default latex font for luatex or xetex. – David Carlisle Aug 09 '21 at 13:31
  • the minimal working example that you gave fails on my system with both xelatex and lualatex:! Package fontspec Error: The font "Comic Sans MS" cannot be found. – con Aug 09 '21 at 13:32
  • 4
    @con comic sans is a standard windows font: you can try any font that is on your system or a tex live font such as \setmainfont{TeX Gyre Termes} also works. I just used Comic Sans to annoy egreg. – David Carlisle Aug 09 '21 at 13:35