# Typesetting <= and < symbols using the default document font

I am writing a document where I need to describe the behaviour of a given system when a parameter is in a given range (e.g. 1 <= x < 100). The document does not otherwise contain equations or any math stuff. I am using the Source Sans Pro font from Adobe and I am having trouble with the <= and < symbols.

• If I use $\leq$ for the <= symbol, it looks different than the rest of the text, but more specifically, quite different than the < symbol
• If I use $\leq$ and $<$, then they look 'similar' but the baselines don't seem to be aligned (and anyway they look different from the rest of the text)

Here's an image showing both options:

Is there a way to typeset the <= symbol using the same font as the rest of the document? Failing that, is there a way to have the baselines of the <= and < symbols aligned?

Update: I am using pdflatex. Here's a MWE:

\documentclass{book}

\usepackage[default]{sourcesanspro}

\begin{document}

1 $\leq$ abs(x) < 100

1 $\leq$ abs(x) $<$ 100

\end{document}

• Show a complete example so that we don't have to guess your engine and the font you use. Feb 2, 2017 at 14:29
• in traditional mathematical composition, signs of operation and relation are aligned on a "math axis", which runs along their centerline. "baseline" alignment is not traditional. Feb 2, 2017 at 14:38
• @UlrikeFischer You are right, I did not specify the engine. As for the font, it is clearly stated in the question: Source Sans Pro from Adobe. Feb 2, 2017 at 14:39
• @barbarabeeton I know, but that does not solve my problem. This doc hardly contains any math and the standard "math axis" alignment looks weird here. Feb 2, 2017 at 14:43
• If you want to avoid maths, why don't you just write it in words: when the absolute value of $x$ is 1 or more, but less than 100. Feb 2, 2017 at 14:52

With lualatex/xelatex using the glyph from SourceSansPro is easy:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{SourceSansPro}
\DeclareTextSymbol{\textlessthanequal}       \UnicodeEncodingName{"2264}
\begin{document}
1 ^^^^2264 x < 2

1 ≤  x < 2

1 \textlessthanequal{} x < 2
\end{document}


With pdflatex it is more difficult. This here is a hack to avoid to have to do much work. It assumes that less equal as the same width as less.

1. Find SourceSansPro-Regular-lf-t1--base.tfm (in fonts/tfm)
2. Copy it e.g. to your current folder.
3. Rename the copy to XSourceSansPro-Regular-lf-t1--base.tfm
4. Find a_ggs4wk.enc (in fonts/enc)
5. Copy it.
6. Rename the copy to Xa_ggs4wk.enc
7. Open Xa_ggs4wk.enc
8. Change the line /AutoEnc_ggs4wkuzes44fkerkgtyzffacb [ to /XAutoEnc_ggs4wkuzes44fkerkgtyzffacb [
9. Find in the file /less and change it to /lessequal
10. Save the file.
11. Test if it works with this document:

 \documentclass{book}

\usepackage[default]{sourcesanspro}

\pdfmapline{=XSourceSansPro-Regular-lf-t1--base XSourceSansPro-Regular "XAutoEnc_ggs4wkuzes44fkerkgtyzffacb ReEncodeFont" <[Xa_ggs4wk.enc <SourceSansPro-Regular.pfb}

\makeatletter
\DeclareFontEncoding{U}{}{}
\DeclareFontFamily{U}{xsourcesans}{}
\DeclareFontShape{U}{xsourcesans}{m}{n}
{ <->  XSourceSansPro-Regular-lf-t1--base
}{}
\newcommand\textlessequal{{\fontencoding{U}\fontfamily{xsourcesans}\selectfont <}}
\begin{document}

1 \textlessequal{} abs(x) < 100

\end{document}


In both cases the less sign is not aligned along the baseline of the less equal sign. You can do it with your raisebox command, but imho it will look odd.

• I guess luatex / xelatex are worth having a look. I will need to try and see how difficult it is to migrate from pdflatex to one of these.. Feb 2, 2017 at 15:39
• \textlessequal and \textgreaterequal should have found their place in TS1. Feb 2, 2017 at 15:57

Or you could load MnSymbol option with mathspec. It does not give you the same symbol, but it looks better.

## MWE

% !TeX program = xelatex

\documentclass{article}
\usepackage[MnSymbol]{mathspec}
\usepackage[default]{sourcesanspro}
\defaultfontfeatures
{ Ligatures      = TeX ,
Numbers        = Proportional ,
Extension      = .otf ,
UprightFont    = *-Regular ,
ItalicFont     = *-RegularIt ,
BoldFont       = *-Bold ,
BoldItalicFont = *-BoldIt }
\setmathfont(Digits,Latin){SourceSansPro}

\begin{document}

1 $\leq$ abs(x) < 100

1 $\leq$ abs(x) $<$ 100

$x=12$

\end{document}

• The question specifically says I am using pdflatex Feb 4, 2017 at 11:32

This fixes the baseline as I needed:

1 $\leq$ abs(x) \raisebox{1pt}{$<$} 100


Result:

• Did you try \textless instead of $<$?
– Mico
Feb 2, 2017 at 15:50
• Yes, but \textless gives the same result than just < Feb 2, 2017 at 16:56