# Losing small caps for serif font when merging mathpazo and sourcesanspro

I use mathpazo font package to write my document. I use small caps for some text.

When I add sourcesanspro font package small caps don't work any more for normal serif font.

Here it is my MWE:

\documentclass[11pt]{book}

\usepackage{lipsum} % nopar
\usepackage[a4paper,showframe]{geometry}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{mathpazo}
% COMMENT THIS LINE, COMPILE AGAIN AND SEE THE CHANGES :
\usepackage[light]{sourcesanspro}

\usepackage[spanish,es-lcroman]{babel}
\usepackage[pdftex,hyperfootnotes=false,
pdfpagelabels]{hyperref}
\pdfcompresslevel=9

\begin{document}

\lipsum[1-2]
\textsc{\lipsum[3-4]}

\end{document}


When I comment sourcesanspro and compile the document, small caps are shown. When including sourcesanspro, small caps disappear. Why?? Have any of you already dealt with something similar?

My intention is to use mathpazo for mostly all the text in the document (serif), but replacing default sans-serif font by sourcesanspro. I don't know if I am doing something wrong, or if there is a better way to do that.

When compiling without sourcesanspro I get 0 errors and 0 warning messages.

When compiling with sourcesanspro, I get 4 warning messages, and here they are:

LaTeX Font Warning: Font shape T1/ppl/l/n' undefined
(Font)              using T1/ppl/m/n' instead on input line 19.

LaTeX Font Warning: Font shape T1/ppl/l/sc' undefined
(Font)              using T1/ppl/l/n' instead on input line 22.

LaTeX Font Warning: Font shape T1/ppl/l/sl' undefined
(Font)              using T1/ppl/l/n' instead on input line 24.

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


So, I think that the problem is that the option light that I use when calling sourcesanspro is affecting somehow also to the serif font.

Actually, if light option is removed, everything goes well, except for that the default sans-serif font won't be Source Sans Pro Light, of course.

POSSIBLE SOLUTION, if nothing better found:

One workaround that works for me is this:

• Removing the option light when including sourcesanspro.

• Adding this when the light version of that (sans serif) font is needed:

\usefont{T1}{SourceSansPro-LF}{l}{n}


I learned about (or discovered) SourceSansPro-LF and things like that by reading into sourcesanspro-type1.sty. I think more documentation for sourcesanspro should be provided by the authors.

I leave this question opened (I mean, unanswered) because I would like to know if there is a way of avoiding typing \usefont{T1}{SourceSansPro-LF}{l}{n} every time I want to use the light sans-serif font provided by sourcesanspro.

-
I suggest a new tag for this post: sourcesanspro. I am not still allowed to create new tags. –  Vicent Dec 8 '12 at 19:35
@Vincent: Sorry you found the documentation lacking. I've been working on an updated version of the package with updated and more complete documentation. Let me know if you're missing something. I've also created a new tag as per your suggestion. –  Silex Dec 9 '12 at 14:05
@Silex, thank you!! It really helps. :) –  Vicent Dec 9 '12 at 15:31

The problem is in the fact that the light option changes globally the meaning of \mddefault to l instead of the default m and so, when LaTeX wants to typeset in the Roman (Palatino) font, it has to perform some substitutions.

The substitution mechanism first tries to modify the shape, so the specification

ppl/l/sc


(Palatino Light Small Caps) turns into a request for

ppl/l/n


(Palatino Light Roman), which doesn't exist either, so the default substitution (l to m) is performed, resulting in Palatino Roman. You can solve the problem by defining new substitution rules:

\usepackage[sc]{mathpazo}
\normalfont % necessary to make LaTeX aware of our choice of the base font

\DeclareFontShape{T1}{pplx}{l}{n} {<-> ssub * pplx/m/n}{}
\DeclareFontShape{T1}{pplx}{l}{sc}{<-> ssub * pplx/m/sc}{}
\DeclareFontShape{T1}{pplx}{l}{it}{<-> ssub * pplx/m/it}{}
\DeclareFontShape{T1}{pplx}{l}{sl}{<-> ssub * pplx/m/it}{}

\usepackage[light]{sourcesanspro}


Theoretically, the declaration could be delayed to \AtBeginDocument, but the package sourcesanspro loads also fontaxes that complicates the matter.

Note that I used the sc option to mathpazo so that a real small caps font is used instead of a fake one; this explains the usage of pplx instead of ppl as family name.

-
Thank you!! This solution is nicer than mine. And thank you also for the comment about sc option, that I forgot to use! –  Vicent Dec 9 '12 at 9:33