2

I need to fix this warnings with saving of Times New Roman and sizes of it.

Warnings:

LaTeX Font Warning: Font shape `TU/ftm/m/n' undefined
(Font)              using `TU/lmr/m/n' instead on input line 49.

LaTeX Font Warning: Font shape `PD1/ftm/m/n' undefined
(Font)              using `PD1/pdf/m/n' instead on input line 51.

LaTeX Font Info:   Try loading font information for PU+ftm on input line 51.
LaTeX Font Info:   No file PUftm.fd. on input line 51.

LaTeX Font Warning: Font shape `PU/ftm/m/n' undefined
(Font)              using `PU/pdf/m/n' instead on input line 51.
LaTeX Font Info: Try loading font information for T1+TimesNewRoman(1) 
                 on input line 54.
LaTeX Font Info: No file T1TimesNewRoman(1).fd. on input line 54.

LaTeX Font Warning: Font shape `T1/TimesNewRoman(1)/m/n' undefined
(Font)              using `T1/cmr/m/n' instead on input line 54.

Test code:

\documentclass[a4paper,14pt,russian,oneside,final]{extreport}

\usepackage{xltxtra}
\usepackage{courier}
\usepackage{lmodern}
\usepackage{tempora}
\usepackage{newtxmath}

\usepackage[T1,T2A]{fontenc}
\usepackage{polyglossia}

\defaultfontfeatures{Ligatures = TeX, Mapping = tex-text}

\setmainlanguage[babelshorthands = true]{russian}
\setotherlanguage{english}

\setmainfont{Arial}
\setmonofont{Courier New}
\setromanfont{Times New Roman}
\setsansfont{Arial}

\newfontfamily\cyrillicfont{Times New Roman}
\newfontfamily\cyrillicfontrm{Times New Roman}
\newfontfamily\cyrillicfontsf{Arial}
\newfontfamily\cyrillicfonttt{Courier New}

\newfontfamily\englishfont{Times New Roman}
\newfontfamily\englishfontrm{Times New Roman}
\newfontfamily\englishfontsf{Arial}
\newfontfamily\englishfonttt{Courier New}

\usepackage{mathtext}

\usepackage{extsizes}

\renewcommand{\rmdefault}{ftm}

\usepackage[final,hidelinks]{hyperref}
\renewcommand{\UrlFont}{\small\rmfamily\tt}

\usepackage[final]{listings}
\lstdefinestyle{C}{
   xleftmargin = 1.25cm,
   basicstyle  = \fontencoding{T1}\small\ttfamily,
   breaklines  = true,
   columns     = fullflexible
 }

 \begin{document}
   \section{Test section}
     \url{http://stackoverflow.com/}

     \begin{center}
       \begin{lstlisting}[style=C]
         #include <stdio.h>
         int main()
         {
             printf("Hello, World!");
             return 0;
         }
       \end{lstlisting}
     \end{center}

 \end{document}
  • I’d also suggest removing newtxmath. Replace it with \usepackage{unicode-math} and \setmathfont{TeX Gyre Termes Math}. – Davislor Jul 1 at 3:46
  • @Davislor, test code in my question is a part of big latex project, where newtxmath fix a lot of warnings: LaTeX Font Warning: Font shape OML/ftm/m/n' undefined LaTeX Font Warning: Font shape OMS/ftm/m/n' undefined LaTeX Font Warning: Font shape OML/ftm/m/n' in size <29.86> not available LaTeX Font Warning: Font shape OML/ftm/m/n' in size <14.93> not available LaTeX Font Warning: Font shape OMS/ftm/m/n' in size <29.86> not available LaTeX Font Warning: Font shape OMS/ftm/m/n' in size <14.93> not available – Armoken Jul 1 at 13:21
  • Adding the other commands I recommended should, if everything else is working, remove those warnings. – Davislor Jul 1 at 13:53
  • You’re including a lot of of different font commands that conflict with each other. I’m guessing that you copied these from different documents. In particular, you copied some document that sets the math alphabets to some non-standard font family named ftm that you don’t have. This is breaking, so you’re working around it by loading a different font package over it. You should delete all the font commands you don’t actually need. – Davislor Jul 1 at 14:30
  • @Davislor, I remove using of mathtext, because it was really useless, and remove \renewcommand{\rmdefault}{ftm} because it has no effect. Now I have only Warning: Font shape T1/TimesNewRoman(1)/m/n' undefined` due lstlisting style, where used \small size of font – Armoken Jul 4 at 6:01
1

With the help of @Davislor and @egreg I fix my code. The correct version of code:

\documentclass[a4paper,14pt,russian,oneside,final]{extreport}

\usepackage{newtxmath}
\usepackage{polyglossia}

\defaultfontfeatures{Ligatures = TeX, Mapping = tex-text}

\setmainlanguage[babelshorthands = true]{russian}
\setotherlanguage{english}

\setmainfont{Times New Roman}
\setmonofont{Courier New}
\setsansfont{Arial}

\newfontfamily\cyrillicfont{Times New Roman}
\newfontfamily\cyrillicfontsf{Arial}
\newfontfamily\cyrillicfonttt{Courier New}

\newfontfamily\englishfont{Times New Roman}
\newfontfamily\englishfontsf{Arial}
\newfontfamily\englishfonttt{Courier New}

\usepackage[final,hidelinks]{hyperref}
\renewcommand{\UrlFont}{\small\rmfamily\tt}

\usepackage[final]{listings}
\lstdefinestyle{C}{
   xleftmargin = 1.25cm,
   basicstyle  = \small\ttfamily,
   breaklines  = true,
   columns     = fullflexible,
   texcl       = true
}

\begin{document}
\section{Test section}
  \en{\url{http://stackoverflow.com/}}

  \begin{center}
    \begin{lstlisting}[style=C]
      #include <stdio.h>
      int main()
      {
        printf("Hello, World!");
        return 0;
      }
    \end{lstlisting}
  \end{center}

\end{document}

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.