Fonts & Character SetsWarning while changing the font

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
BaCaRoZzo
Posts: 10
Joined: Sun Dec 18, 2011 7:53 pm

Warning while changing the font

Post by BaCaRoZzo »

Hi all,

first of all, my deepest apologies for my bad English.
I hope that this is the right place to post and, most of all, the right way of posting!

I have an annoying warning while using the command to change the default font.
Basically I have defined the following command:

Code: Select all

\newcommand{\command}{{\fontfamily{iwona}\fontshape{sc}\selectfont *my text*}}
Whichever is the font that I use I have ALWAYS the following warning:

Code: Select all

Font shape "T1/*PutYourPreferredFontHere*/bx/SC" undefined using "T1/cmr/m/n" instead on [...]
I have noticed two things:
  • If I change the font to the substitued one (cmr) with the same series/shape I have again the same warning; like the compiler is substituting the font with the exact same font! :o
  • In any case the font is correctly set (if the series/shape is available). For instance, in the case of "iwona" font the text is correctly set, when this command is called. The point is, I want to eradicate the warning!
My font/input encoding is the following:

Code: Select all

\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc} 
and I have also imported the following font packages:

Code: Select all

\usepackage{eucal}               
\usepackage{mathptmx} 
\usepackage[scaled=0.92]{helvet}
\usepackage{courier}
Any clue or idea is highly appreciated (hoping I did not do a HUGE mistake somewhere!).

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Warning while changing the font

Post by Stefan Kottwitz »

Hi,

welcome to the board!

It seems that you use a font with small caps shape (sc), but try using it in a bold version (bx) which is not available. LaTeX would warn and replace it.

Stefan
LaTeX.org admin
BaCaRoZzo
Posts: 10
Joined: Sun Dec 18, 2011 7:53 pm

Warning while changing the font

Post by BaCaRoZzo »

Hi Stefan,
thanks for the kind reply!

You're right about the warning given to me. Anyway, I have the same warning even if I set the font/series/shape used as substitution font, i.e.

Code: Select all

\newcommand{\command}{{\fontfamily{cmr}\fontseries{m}\fontshape{n}\selectfont *text*}}
gives me the warning:

Code: Select all

Font shape "T1/CMR/M/N" undefined using "T1/cmr/m/n" instead on [...]
Which is the point of this warning? :cry: Substituting the font with the same encoding/family/series/shape font? I really can't understand it.

Cheers,
F.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Warning while changing the font

Post by Stefan Kottwitz »

I don't get a warning with this line. Tested with:

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\newcommand{\command}{{\fontfamily{cmr}\fontseries{m}\fontshape{n}\selectfont *text*}}
\begin{document}
\command
\end{document}
Note the capitalization in the warning you got. It can be produced by

Code: Select all

\newcommand{\command}{{\fontfamily{CMR}\fontseries{M}\fontshape{N}\selectfont *text*}}
Perhaps post a small compilable example where you get that warning.

Stefan
LaTeX.org admin
BaCaRoZzo
Posts: 10
Joined: Sun Dec 18, 2011 7:53 pm

Re: Warning while changing the font

Post by BaCaRoZzo »

Indeed, it also work for me. :?
Probably the warning is caused by something else. I'll try to slice my code, section by section. If I would find something, I'll share it.

Thanks for your time!
F.
BaCaRoZzo
Posts: 10
Joined: Sun Dec 18, 2011 7:53 pm

Warning while changing the font

Post by BaCaRoZzo »

It cost me sweat and toil but I think I've found the minimal example. Indeed, it is quite interesting (for my knowledge of LaTeX, at least!).

Basically it seems that there's some kind of clashing between the headings (also the basic ones not the fancy stuff), the footnotes and my stupid command. I don't know if it is either a problem of my distribution (miktex 2.9 64-bit) or a common behaviour.

Here's the code:

Code: Select all

\documentclass[twoside, 12pt]{book}
\usepackage[english]{babel} 
\usepackage[T1]{fontenc}
\newcommand{\command}{{\fontfamily{cmr}\fontseries{m}\fontshape{n}\selectfont Command}} 
\begin{document}
\chapter{Simulation: \command\ }
\footnote{My footnote!}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}
If the footnote is removed the problem is solved. :|
I have no clue.

Again, thanks for your time and your patience with my English!
Cheers,
F.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Warning while changing the font

Post by Stefan Kottwitz »

Your font change in the argument to chapter is also used for the table of contents entry and for the headings. The problem occurs, because headings are automatically capitalized, and this capitalization also effects your cmr, m and n, making it CMR, M and N.

Before fixing this, I recommend considering to change the page headings style. In my opinion writing all in capital letters looks bad. I don't see a reason to emphasize headings by all caps "style". And if you like to change that too, the warning would go away.

Stefan
LaTeX.org admin
BaCaRoZzo
Posts: 10
Joined: Sun Dec 18, 2011 7:53 pm

Re: Warning while changing the font

Post by BaCaRoZzo »

Thanks for the super-fast answer!

So the point is all in the headings. I do not need to worry about the footnotes. That's good. :)

As I said, I've used fancy header in the real file...and I have to check for the options I've chosen. Probably capitalized text anyway, since the warning is the same as the one generated from the code above.

I'll play a bit with the toy example and once I've got the point, I'll switch back to my real code.

Hope to not bother you any more. All that said, thanks a lot! You made my day :)
Cheeers,
F.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Warning while changing the font

Post by Stefan Kottwitz »

fancyhdr provides a \nouppercase command, perhaps use that in the headers.

Stefan
LaTeX.org admin
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Warning while changing the font

Post by Stefan Kottwitz »

BaCaRoZzo wrote:So the point is all in the headings. I do not need to worry about the footnotes.
Yes - though you noticed, that the warning disappeared when you removed the footnote, the true reason is that you've got more space on the page without the footnote and there's no second page then, so no capitalized header.

Stefan
LaTeX.org admin
Post Reply