字体 T2A/cmss/m/n/220=lass5159 位于 51.59pt 处无法加载:未找到度量 (TFM) 文件

字体 T2A/cmss/m/n/220=lass5159 位于 51.59pt 处无法加载:未找到度量 (TFM) 文件

我在 Windows 上使用 MikTex 2.9。

我想导入一个很酷的模板(http://www.latextemplates.com/template/the-legrand-orange-book) 并按照自己的想法使用它。但是西里尔字体的问题太多了。

因此,首先,如果有人知道如何使用西里尔字体轻松地做到这一点,请告诉我。

但我的问题是关于我在尝试将此模板包含到我的工作中时遇到的错误。

我在日志文件中收到此错误:

LaTeX Font Warning: Font shape `T2A/cmss/m/n' in size <220> not available
(Font) size <51.59> substituted on input line 85.
! Font T2A/cmss/m/n/220=lass5159 at 51.59pt not loadable: Metric (TFM) file not found.

我在互联网上搜索了这个问题,但没有结果,因为我想在 Windows 上运行它。

我已经几乎完全扩展了 Miktex,安装了eccm软件包。

我看到过与我的问题最接近的——字体 U/esint/m/n/12=esint10 位于 12.0pt 无法加载:未找到度量 (TFM) 文件。但我不明白我应该对 cm-folders 做什么才能纠正这个问题。

这是具有此特定问题的 MWE(现在不工作):

\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

% numbered part in the table of contents
\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}}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% unnumbered part in the table of contents
\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}{}%
\newcommand{\partimage}[1]{\renewcommand{\thepartimage}{#1}}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax%
\refstepcounter{part}%
\addcontentsline{toc}{part}{\texorpdfstring{\protect\@mypartnumtocformat{\thepart}{#1}}{\partname~\thepart\ ---\ #1}}
\else%
\addcontentsline{toc}{part}{\texorpdfstring{\protect\@myparttocformat{#1}}{#1}}%
\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}}
\addcontentsline{toc}{part}{\texorpdfstring{%
\setlength\fboxsep{0pt}%
\noindent\protect\colorbox{ocre!40}{\strut\protect\parbox[c][.7cm]{\linewidth}{\Large\sffamily\protect\centering #1\quad\mbox{}}}}{#1}}%
\@endpart}
\def\@endpart{\vfil\newpage
\if@twoside
\if@openright
\null
\thispagestyle{empty}%
\newpage
\fi
\fi
\if@tempswa
\twocolumn
\fi}

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

答案1

字体系列的西里尔字体cmr仅在离散步骤中定义,并且 TFM 文件是根据需要创建的。

您需要 220pt 的字体,但是该字体不可用。

你可以通过改变字体定义文件来得到它(fix-cyr-cm真的需要一个包)。

\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
% numbered part in the table of contents
\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}}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% unnumbered part in the table of contents
\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}{}%
\newcommand{\partimage}[1]{\renewcommand{\thepartimage}{#1}}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax%
\refstepcounter{part}%
\addcontentsline{toc}{part}{\texorpdfstring{\protect\@mypartnumtocformat{\thepart}{#1}}{\partname~\thepart\ ---\ #1}}
\else%
\addcontentsline{toc}{part}{\texorpdfstring{\protect\@myparttocformat{#1}}{#1}}%
\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}}
\addcontentsline{toc}{part}{\texorpdfstring{%
\setlength\fboxsep{0pt}%
\noindent\protect\colorbox{ocre!40}{\strut\protect\parbox[c][.7cm]{\linewidth}{\Large\sffamily\protect\centering #1\quad\mbox{}}}}{#1}}%
\@endpart}
\def\@endpart{\vfil\newpage
\if@twoside
\if@openright
\null
\thispagestyle{empty}%
\newpage
\fi
\fi
\if@tempswa
\twocolumn
\fi}

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

在此处输入图片描述

相关内容