Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to change the font in the document to Arial. I am using the following code.

\documentclass{article}

\usepackage[margin=1in,headheight=5\baselineskip,headsep=1\baselineskip,includehead]{geometry}


\usepackage[scaled]{uarial} 
\renewcommand*\familydefault{\sfdefault} 
\usepackage[T1]{fontenc}

\usepackage{sectsty} 
\sectionfont{\sc\sectionrule{0pt}{0pt}{-5pt}{0.5pt}}

\usepackage{lipsum}

\begin{document}


\section*{My Section Heading}
\lipsum


\end{document}

Unfortunately, the sections heading are not in small caps. When I comment out the following line it works but the font is the LaTeX normal font. Could someone help me on this?

\renewcommand*\familydefault{\sfdefault}

Here is the results with and without \renewcommand*\familydefault{\sfdefault}.

enter image description here

share|improve this question
2  
1. \sc (and \bf and \it) are deprecated. Use \scshape instead. 2. It doesn't look like uarial includes a small caps font. (LaTeX Font Warning: Font shape 'T1/ua1/bx/sc' undefined, using 'T1/ua1/bx/n' instead on input line 18. ) –  Paul Gessler Aug 13 at 0:41
    
uarial does not have a small caps, as @PaulGessler says. The font definition file does not define a substitute either, which is why you get the warning. Note that true small-caps (non-faked) are the exception rather than the rule, and that small-caps is rarer in sans serif fonts. –  cfr Aug 13 at 0:43
    
The reason is most probably that URW Arial doesn't have small caps. You might consider using Cabin which is a free sansserif font with support in LaTeX, has small caps in all 4 variants, and has a condensed version. –  Bernard Aug 13 at 0:49
    
Thank you guys. Is this the property of all Sans Serif fonts that does not come with small caps? –  A2009 Aug 13 at 1:20

1 Answer 1

up vote 5 down vote accepted

Here is a method for determining whether a particular shape (or weight) is available in a LaTeX font. This method applies only to fonts installed for use with LaTeX. It does not apply to system fonts used with XeTeX or LuaTeX.

Identify the relevant font definition file. If you are loading a package, as in this case, look through the package for \renewcommand{\sfdefault}{} or \renewcommand{\rmdefault}{} or \renewcommand{\ttdefault}{}. In this case we find the following line in uarial.sty:

\renewcommand{\sfdefault}{ua1}

This tells us that the family name is ua1. The name of the font definition file depends on the encoding you are using as well as the family name. By default, it would start ot1 for the OT1 encoding. However, uarial doesn't support OT1 so I assume you are using T1 which means t1ua1.fd is the font definition file.

The contents of this file is as follows:

\ProvidesFile{t1ua1.fd}
   [2006/03/21 Fontinst v1.928 font definitions for T1/ua1.]

Standard set up specifying file name and version information.

\expandafter\ifx\csname ua1@Scale\endcsname\relax
 \let\uaI@@Scale\@empty
\else
 \edef\uaI@@Scale{s*[\csname ua1@Scale\endcsname]}%
\fi

Support for scaling.

\DeclareFontFamily{T1}{ua1}{}

Defines ua1 as a font family in the T1 encoding.

\DeclareFontShape{T1}{ua1}{m}{n}{ <-> \uaI@@Scale ua1r8t}{}

\DeclareFontShape{T1}{ua1}{m}{it}{ <-> \uaI@@Scale ua1ri8t}{}

\DeclareFontShape{T1}{ua1}{b}{n}{ <-> \uaI@@Scale ua1b8t}{}

\DeclareFontShape{T1}{ua1}{b}{it}{ <-> \uaI@@Scale ua1bi8t
}{}

These are the font definition commands proper. Each has the form:

\DeclareFontShape{encoding}{family}{series}{shape}{definition}{size}

We can see that this font family contains 2 different shapes in each of 2 series, and that the same fonts are used at all point sizes (because the last argument is empty). The two series are m (medium) and b (bold). The two shapes are n (upright) and it (italic).

\DeclareFontShape{T1}{ua1}{m}{sl}{<->ssub * ua1/m/it}{}
\DeclareFontShape{T1}{ua1}{bx}{n}{<->ssub * ua1/b/n}{}
\DeclareFontShape{T1}{ua1}{bx}{it}{<->ssub * ua1/b/it}{}
\DeclareFontShape{T1}{ua1}{b}{sl}{<->ssub * ua1/b/it}{}
\DeclareFontShape{T1}{ua1}{bx}{sl}{<->ssub * ua1/b/sl}{}

These commands tell LaTeX to 'silently substitute one font for another. For example, the sl shape will be silently replaced with the it shape in the appropriate weight. Similarly, b (bold) will be silently substituted for bx (bold extended). These substitutions are silent in the sense that LaTeX will not issue warnings about missing fonts.

\endinput

Since there is no mention of the sc shape, we know that this font family does not include small-caps and that calling small-caps while this family is active will result in a warning due to the missing shape i.e. the substitution will be noisy, rather than silent, in this case.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.