由于章节标题中的文本以数学模式编码,导致编译代码时出错

由于章节标题中的文本以数学模式编码,导致编译代码时出错

在下面的代码中,我有一个主文件和一个章节。章节的标题是

The Tale of Rabbit Reproduction: $a_{n} = a_{n-1} + a_{n-2}$

我将其编码为

The Tale of Rabbit Reproduction: \texorpdfstring{$a_{n} = a_{n-1} + a_{n-2}$}{a[n] = a[n-1] + a[n-2]}

我收到以下错误信息。

! Font U/bbold/m/n/24.88=bbold25 at 24.88pt not loadable: Metric (TFM) file not found.

代码中是否存在缺陷?

\documentclass[10pt, oneside]{book}

% packages
\usepackage{amssymb, amsmath, amsthm}
%This package allows Chapter titles to be single spaced.
\usepackage{titlesec}
\titleformat{\chapter}[display]
    {\setstretch{0.25}\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titleformat{\section}
    {\setstretch{0.25}\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
    {\singlespacing\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
    {\singlespacing\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}

% these make top, right, bottom margins confirming to the requirements

\usepackage[a4paper,bindingoffset=0.0in,%
left=1.5in,right=1in,top=1in,bottom=1in,%
footskip=.25in]{geometry}

\usepackage{setspace}
\usepackage{blindtext}

% small stuff
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{mathbbol}
\usepackage{hyperref}
\urlstyle{same}

\usepackage{footnote}

\hypersetup{colorlinks,linkcolor={black},citecolor={black},urlcolor={black}}

\usepackage{microtype}
% \usepackage{showkeys}
% uncomment this when editing cross-references
\numberwithin{equation}{section}




%------------------------------------------------




% doesn't count introduction when numbering theorems, etc.
\setcounter{chapter}{0}

% makes page numbers appear
\pagestyle{plain}


\usepackage{showframe}
\renewcommand*\ShowFrameLinethickness{0.2pt}
\renewcommand*\ShowFrameColor{\color{blue}}



\begin{document}

% makes the page numbers roman numerals, doesn't count
% these pages in the table of contents
\frontmatter

\thispagestyle{empty}

\vbox to 1truein{}

\centerline{Fairy Tales throughout History}



\vskip 200pt

\centerline{BY}
\vskip 10pt

\centerline{A Storyteller}
\vskip 10pt

\centerline{BA, Bard College}
\centerline{MA, Columbia University}

\vskip 215pt

\centerline{DISSERTATION}
\vskip 10pt

\centerline{Submitted in partial fulfillment of the requirements for}
\centerline{the degree of Doctor of Philosophy in English}
\centerline{in the Graduate School of}
\centerline{Columbia University}


\newpage


\thispagestyle{empty}

\vbox to 8.5truein{}

\centerline{\copyright\ Copyright by A Storyteller 2023}

\

\centerline{All Rights Reserved}

\newpage



\chapter*{Abstract}
\begin{doublespace}
Fairy tales' rich, imaginative stories for children~---~involving fantastical creatures and exotic places~---~offer far more than entertainment and happily-ever-after endings. They furnish children with a landscape for critical thinking skills and a context in which children can evaluate their own emotions and decision making.
\end{doublespace}


\newpage

\chapter*{Dedication}
\bigskip

\centerline{Dedicated to the Grimm Brothers and Hans Christian Anderson}

\newpage

\chapter*{Acknowledgements}
I wish to thank Walt Disney for animating various fairy tales in full color.


\newpage

\tableofcontents

% Changes page numbers to regular numbers, resets the counter
\mainmatter

%This gives 10pt font with 20pt spacing, text from here should be double spaced
\fontsize{10}{20pt} \selectfont

% \include puts in the .tex file with the given name
% make sure that these files don't have any preamble material

\begin{doublespacing}

\include{March_30-Introduction}

%\include{March_30-Chapter_1}

%\include{March_29-Chapter_2}

\end{doublespacing}

% add a new chapter without a chapter # for the references
\addcontentsline{toc}{chapter}{Bibliography}

\begin{thebibliography}{9}

\bibitem[Southey 1837]{Southey}Robert Southey, \emph{The Doctor},  Longman, Rees, Orme, Brown, Green and Longman, London, England, 1837, pages 318-326

\end{thebibliography}



\end{document}

这是文件中的唯一章节。

%
%
%
% Introduction
%
%

% make introduction a chapter without a #
\chapter*{Introduction (In case I decide to have a more descriptive name for the introduction, I want it to be single spaced or maybe half-line spaced)}

% and include it on the table of contents
\addcontentsline{toc}{chapter}{Introduction}


We will look at various fairy tales and myths in civilizations throughout history!

\newcommand\mymath{\(\sin(x) + 2ab - \frac{e^{2x}+1}{e^{2x}-1}\)}
\chapter{The Tale of Rabbit Reproduction: \texorpdfstring{$a_{n} = a_{n-1} + a_{n-2}$}{a[n] = a[n-1] + a[n-2]}}

答案1

来自福尔摩斯级别的调查遥远的路看起来好像过去ubbold.fd.../texmf-dist/tex/latex/jknapltx/我使用某种 TeXLive 基础 TeX 安装的地方有一个有问题的文件。根据我在那里解读的内容,这可能解释了bbold25错误消息中显示的内容。

在我的 TeXLive 2023 上,这个目录中没有。我Ubbold.fd在 中有一个texmf-dist/tex/latex/bbold。这个应该不会造成问题。该bbold包提供了一个\mathbb 命令。

我建议您\listfiles在序言中添加并报告日志中显示的内容*File List*。(主要是为了了解您正在使用哪种分布,它是最新的吗?)

也许你有一些这样的旧的ubbold.fd在某个texmf-local?或在texmf你的$HOME

可能是添加一个名为ubbold.fd的文件

\DeclareFontFamily{U}{bbold}{}
\DeclareFontShape{U}{bbold}{m}{n}
   {  <5> <6> <7> <8> <9> gen * bbold
      <10> <10.95> bbold10
      <12> <14.4> bbold12
      <17.28> <20.74> <24.88> bbold17
   }{}
\endinput

在项目目录中可以解决这个问题。也许。也许为了确保万无一失,也可以将其另存为Ubbold.fd。我在 Mac 上,它不区分大小写。也许 LaTeX NFSS 无论如何都会通过将内容变为小写来规范化,但我没有检查过。

答案2

您收到的错误消息与您使用的软件包有关mathbbol,该软件包为额外的数学符号提供了字体。看来软件包所需的字体文件缺失或未正确安装。

确保 TeX Live 或 MiKTeX 是最新的。或者,您可以尝试使用包bbm

相关内容