# How to locate the source for font warnings?

I am preparing my dissertation nowadays, and I wrote a command to generate the title page automatically.

On the title page the fonts used are \mdseries, \bfseries and \scshape. When I use the TeX Gyre Pagella font, it throws a warning:

LaTeX Font Warning: Font shape T1/qpl/m/sl' in size <12> not available


But when I use something else, e.g. New TX, no warning is thrown.

I understand the warning, but its placement is odd, since no fonts are slanted (or italics) anywhere in the code or the output.

Here is a somewhat minimal example.

\documentclass[12pt,a4paper,openany]{memoir}
\usepackage{tgpagella}
\usepackage[T1]{fontenc}

\newcommand{\submissiondate}{}

\newcommand{\titlepage}{%
\scshape
\vspace{4em}

\begin{center}
\Huge\textbf{\thetitle}
\vspace{3em}

\normalsize
Doctoral dissertation

\small By

\normalsize\normalfont\bfseries\scshape\theauthor\scshape\mdseries
\vspace{30em}

Submitted\\
\submissiondate
\end{center}
}
\begin{document}
\frontmatter
\pagenumbering{gobble}
\title{How to not suck at things}
\author{Ink Blot}
\submitted{Decembuary 2017}
\titlepage
\end{document}

• I'm not sure at all about the tags. So if someone could help me retag this properly, I'd be grateful. – Ink blot Jan 9 '17 at 12:15
• Slanted fonts are sometimes used at the running head. And you can minimize a copy of your document to find out the place of the font usage. Just comment out parts of the document and do another LaTeX run. – Schweinebacke Jan 9 '17 at 12:33
• No, the page style is plain, no page numbers appear (obviously). Not to mention that I don't use any slanted fonts in the headers either (custom header/footer with fancyhdr). – Ink blot Jan 9 '17 at 12:38
• My psychic power level is to low to find an anwer without any information. Please show a MWE. – Schweinebacke Jan 9 '17 at 12:41
• Slanted type is used by default for headers; the message points to \end{document}: apparently memoir is trying to typeset the header and issues the message because it is doing \slshape. It's this command that triggers the warning, not actually typesetting text. – egreg Jan 9 '17 at 13:27

It is the page number. An gobbled page number is still printed (without output), so the font change for the page number is still done. Use \thispagestyle{empty} and it will not be printed and therefore the font will not be changed:

\documentclass[12pt,a4paper,openany]{memoir}
\usepackage{tgpagella}
\usepackage[T1]{fontenc}

\newcommand{\submissiondate}{}

\newcommand{\titlepage}{%
\scshape
\vspace{4em}

\begin{center}
\Huge\textbf{\thetitle}
\vspace{3em}

\normalsize
Doctoral dissertation

\small By

\normalsize\normalfont\bfseries\scshape\theauthor\scshape\mdseries
\vspace{30em}

Submitted\\
\submissiondate
\end{center}
}
\begin{document}
\frontmatter
\thispagestyle{empty}% <-- Changed!
\title{How to not suck at things}
\author{Ink Blot}
\submitted{Decembuary 2017}
`