I know the font has support for the greek language. Are those characters accessible in pdfLateX?


α a $\alpha$

gives me the following error (caused by the greek option for babel):

miktex-makemf: The grtm source file could not be found.

Running hbf2gf.exe...

hbf2gf (CJK ver. 4.8.3)

Couldn't find `grtm.cfg'

miktex-maketfm: No creation rule for font grtm10.

! Font LGR/ptm/m/n/10=grtm10 at 10.0pt not loadable: Metric (TFM) file not foun
<to be read again> 
l.2 \select@language{greek}


Errata corrige: the following code does not print any letter in Source Sans.
I've mistaken upright greek CM for Source Sans...

Note that

\usepackage[LGR]{fontenc}% changed the encoding
α a $\alpha$

prints the greek letters (the first two in Source Sans, the third one in CM), but the "a" is now an alpha, too.

  • Is this a free font? If not, you will have to use Xe- or LuaLaTeX. If yes, we (or you) will have to check, if there is some package containing it. What characters do you need? Just a couple or do you want to change the whole font? Please give an MWE showing what you are about to do and where you got stuck. – LaRiFaRi Jun 9 '15 at 15:02
  • 1
    There's support for Greek with the font only under XeLaTeX or LuaLaTeX and fontspec, as far as I know. Generating the font metric files for Greek, together with the .fd files for Greek support is not conceptually difficult, but requires time and expertise in usage of otftotfm. – egreg Jun 9 '15 at 15:08
  • Yep it's free. I've added a MWE. I just want to be able to write those characters. For math mode then I'll try using sansmath. I've been able to write them by using \usepackage[LGR]{fontenc}, but this causes the "a" to be read as an alpha. – Arch Stanton Jun 9 '15 at 15:09

The problem

Currently, Source Sans Pro does not come with the LGR encoding. This means that when you run your second MWE, the following errors are shown:

LaTeX Font Warning: Font shape `LGR/SourceSansPro-LF/m/n' undefined
(Font)              using `LGR/cmr/m/n' instead on input line 6.

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

Solution: LGR for Source Sans Pro

I've built the font with the LGR encoding. Your MWE now results in the following:

three alphas

What you see here is the correct behaviour: the LGR encoding only includes Greek symbols.

This really needs more testing, for which I have created a branch. From there you can also download Source Sans Pro with LGR support.

Finally, to get the result you want, you need to switch font encoding halfway:

\usepackage[OT1,LGR]{fontenc}% changed the encoding
α {\fontencoding{OT1}\selectfont a} $\alpha$

alpha a alpha

Alternate solution: XeLaTeX

Running this with XeLaTeX does result in the expected behaviour:

α a $\alpha$

alpha a alpha

You can also change the Math font with mathspec:

    { Ligatures      = TeX ,
      Numbers        = Proportional ,
      Extension      = .otf ,
      UprightFont    = *-Regular ,
      ItalicFont     = *-RegularIt ,
      BoldFont       = *-Bold , 
      BoldItalicFont = *-BoldIt }
\setmathfont(Greek)[Lowercase = Regular]{SourceSansPro}
α a $\alpha$

Greek has been set to regular (ie: not italic) because Source Sans Pro lacks Greek italics.

alpa a better alpha

  • I'm very sorry! The naming of the files brought me to think they were Bob's. – egreg Jun 10 '15 at 11:38
  • egreg: Don't worry about it! Bob's packages are quite similar to mine (or the other way round) and he has a lot of font packages. – Silke Jun 10 '15 at 11:51

Short answer

There's currently no support for Greek letters from SourceSans Pro in pdflatex.

Longer answer

If I compile your example (the one in the errata-corrige section), I get the warning

LaTeX Font Warning: Font shape `LGR/SourceSansPro-LF/m/n' undefined
(Font)              using `LGR/cmr/m/n' instead on input line 5.

which means that the LGR+cmr family fonts are used, and not the unavailable LGR+SourceSansPro-LF family.

SourceSans Pro is released as an OpenType font family (twelve font files); Silke, also the maintainer of other font packages for pdflatex, has prepared font metric and PFB files for use with pdflatex, but only provides the fonts for the OT1, T1, TS1 and LY1 encodings. The LGR encoding necessary for Greek is not provided.

It's not conceptually difficult to prepare the required files (TFM, VF and PFB) also for the LGR encoding, but it requires expertise in usage of otftotfm and time.

As far as I know, Silke is very keen on feature requests and bug reports; however releasing LGR support for his font families might reveal too burdensome.

At the moment, only XeLaTeX can provide support for what you're asking, via mathspec and hard work.

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.