I am using MikTex 2.9 on Windows.

I want to import one cool template (http://www.latextemplates.com/template/the-legrand-orange-book) and use it with my own ideas. But there are too many problems with cyrillic fonts.

So, first of all, if someone knows how to do it with cyrillic fonts easily, then let me know, please.

But my qustion is about the error which I get in my own tryings to include this template into my work.

I get this error in log-file:

LaTeX Font Warning: Font shape T2A/cmss/m/n' in size <220> not available
(Font) size <51.59> substituted on input line 85.


I searched this question in the Internet but no results because I want this running on Windows.

And I have almost full expansion of Miktex, I have ec, cm packages installed.

And I've seen this closest to mine question -- Font U/esint/m/n/12=esint10 at 12.0pt not loadable: Metric (TFM) file not found. But I can't understand analogy what I should do with cm-folders in order to correct this.

Here is MWE(non-working now) with this particular problem:

\documentclass[a5paper,9pt]{extbook}
\usepackage{geometry}

\usepackage{graphicx}
\usepackage{tikz}
\usepackage{cmap}
\usepackage{booktabs}
\usepackage{xcolor}
\definecolor{ocre}{RGB}{243,102,25}

\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[english, russian]{babel}
\usepackage{calc}

\usepackage{titletoc}
\usepackage{hyperref}

\makeatletter

\newcommand{\@mypartnumtocformat}[2]{%
\setlength\fboxsep{0pt}%
\noindent\colorbox{ocre!20}{\strut\parbox[c][.7cm]{\ecart}{\color{ocre!70}\Large\sffamily\bfseries\centering#1}}\hskip\esp\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth-\ecart-\esp}{\Large\sffamily\centering#2}}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\@myparttocformat}[1]{%
\setlength\fboxsep{0pt}%
\noindent\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth}{\Large\sffamily\centering#1}}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newlength\esp
\setlength\esp{4pt}
\newlength\ecart
\setlength\ecart{1.2cm-\esp}
\newcommand{\thepartimage}{}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax%
\refstepcounter{part}%
\else%
\fi%
\startcontents%
\markboth{}{}%
{\thispagestyle{empty}%
\begin{tikzpicture}[remember picture,overlay]%
\node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
\fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
\node[anchor=north] at (4cm,-3.25cm){\color{ocre!40}\fontsize{220}{100}\sffamily\bfseries\@Roman\c@part};
\node[anchor=south east] at (\paperwidth-1cm,-\paperheight+1cm){\parbox[t][][t]{8.5cm}{
\printcontents{l}{0}{\setcounter{tocdepth}{1}}%
}};
\node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#2}};
\end{tikzpicture}};
\end{tikzpicture}}%
\@endpart}
\def\@spart#1{%
\startcontents%
\phantomsection
{\thispagestyle{empty}%
\begin{tikzpicture}[remember picture,overlay]%
\node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
\fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
\node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#1}};
\end{tikzpicture}};
\end{tikzpicture}}
\setlength\fboxsep{0pt}%
\@endpart}
\def\@endpart{\vfil\newpage
\if@twoside
\if@openright
\null
\thispagestyle{empty}%
\newpage
\fi
\fi
\if@tempswa
\twocolumn
\fi}

\begin{document}
\part{Первая глава}
\end{document}

• Did you run updmap --verbose (as administrator) from the command line? Nov 13, 2016 at 14:49
• @Bernard Yes, it did not help
– user98432
Nov 13, 2016 at 14:57

The Cyrillic fonts for the cmr font family are only defined at discrete steps and the TFM files are created on demand.

You want a font at 220pt, which is not available.

You can get it by changing the font definition file (a fix-cyr-cm package should be really needed).

\documentclass[a5paper,9pt]{extbook}
\usepackage{geometry}

\usepackage{graphicx}
\usepackage{tikz}
\usepackage{cmap}
\usepackage{booktabs}
\usepackage{xcolor}
\definecolor{ocre}{RGB}{243,102,25}

\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[english, russian]{babel}
\usepackage{calc}

\usepackage{titletoc}
\usepackage{hyperref}

\newcommand{\cyrfamily}[5]{%
\DeclareFontShape{#1}{#2}{#3}{#4}{
<-6>    #50500
<6-7>   #50600
<7-8>   #50700
<8-9>   #50800
<9-10>  #50900
<10-12> #51000
<12-17> #51200
<17-20> #51728
<20-23> #52074
<23-28> #52488
<28-34> #52986
<35->   #53583
}{}%
}
\DeclareFontFamily{T2A}{cmss}{}
\cyrfamily{T2A}{cmss}{m}{n}{lass}
\cyrfamily{T2A}{cmss}{m}{sl}{lasi}
\cyrfamily{T2A}{cmss}{m}{it}{lasi}
\cyrfamily{T2A}{cmss}{bx}{n}{lasx}
\cyrfamily{T2A}{cmss}{bx}{it}{laso}
\cyrfamily{T2A}{cmss}{bx}{sl}{laso}
\DeclareFontShape{T2A}{cmss}{m}{sc}{<->sub*cmr/m/sc}{}
\DeclareFontShape{T2A}{cmss}{sbc}{n}{<->lassdc10}{}

\makeatletter
\newcommand{\@mypartnumtocformat}[2]{%
\setlength\fboxsep{0pt}%
\noindent\colorbox{ocre!20}{\strut\parbox[c][.7cm]{\ecart}{\color{ocre!70}\Large\sffamily\bfseries\centering#1}}\hskip\esp\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth-\ecart-\esp}{\Large\sffamily\centering#2}}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\@myparttocformat}[1]{%
\setlength\fboxsep{0pt}%
\noindent\colorbox{ocre!40}{\strut\parbox[c][.7cm]{\linewidth}{\Large\sffamily\centering#1}}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newlength\esp
\setlength\esp{4pt}
\newlength\ecart
\setlength\ecart{1.2cm-\esp}
\newcommand{\thepartimage}{}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax%
\refstepcounter{part}%
\else%
\fi%
\startcontents%
\markboth{}{}%
{\thispagestyle{empty}%
\begin{tikzpicture}[remember picture,overlay]%
\node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
\fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
\node[anchor=north] at (4cm,-3.25cm){\color{ocre!40}\fontsize{220}{100}\sffamily\bfseries\@Roman\c@part};
\node[anchor=south east] at (\paperwidth-1cm,-\paperheight+1cm){\parbox[t][][t]{8.5cm}{
\printcontents{l}{0}{\setcounter{tocdepth}{1}}%
}};
\node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#2}};
\end{tikzpicture}};
\end{tikzpicture}}%
\@endpart}
\def\@spart#1{%
\startcontents%
\phantomsection
{\thispagestyle{empty}%
\begin{tikzpicture}[remember picture,overlay]%
\node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
\fill[ocre!20](0cm,0cm) rectangle (\paperwidth,-\paperheight);
\node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{15cm}{\strut\raggedleft\color{white}\fontsize{30}{30}\sffamily\bfseries#1}};
\end{tikzpicture}};
\end{tikzpicture}}
\setlength\fboxsep{0pt}%
\@endpart}
\def\@endpart{\vfil\newpage
\if@twoside
\if@openright
\null
\thispagestyle{empty}%
\newpage
\fi
\fi
\if@tempswa
\twocolumn
\fi}

\begin{document}
\part{Первая глава}
\end{document}


• But in my project (non in this particular MWE) new error is comming. '! Font T2A/pag/m/n/220=larm5159 at 51.59pt not loadable' Should I do the same with pag? Or there are another actions?
– user98432
Nov 13, 2016 at 16:35
• Yeah, that worked but I am not TeXpert to state that with pag I should not make another actions.
– user98432
Nov 13, 2016 at 16:38
• @Dida There is no Cyrillic pag font family, so the default substitution with cmss is made, which brings you back to step 1. Nov 13, 2016 at 16:52
• What do you mean by 'step 1'? And I've noticed that all curved and bold text have dissappered. What should I do?
– user98432
Nov 13, 2016 at 17:21
• I made this in addition to your code to make it work. But there is no bold and curved text now \DeclareFontFamily{T2A}{pag}{} \cyrfamily{T2A}{pag}{m}{n}{lass} \cyrfamily{T2A}{pag}{m}{sl}{lasi} \cyrfamily{T2A}{pag}{m}{it}{lasi} \cyrfamily{T2A}{pag}{bx}{n}{lasx} \cyrfamily{T2A}{pag}{bx}{it}{laso} \cyrfamily{T2A}{pag}{bx}{sl}{laso} \DeclareFontShape{T2A}{pag}{m}{sc}{<->sub*cmr/m/sc}{} \DeclareFontShape{T2A}{pag}{sbc}{n}{<->lassdc10}{}`
– user98432
Nov 13, 2016 at 17:25