![无法使用 XeLaTeX 进行编译](https://linux22.com/image/323305/%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%20XeLaTeX%20%E8%BF%9B%E8%A1%8C%E7%BC%96%E8%AF%91.png)
我使用 XeLaTeX 编译我的所有文档。但是,昨天我将笔记本电脑格式化为 Windows 10,并再次安装了 TexLive。但是,现在当我尝试编译我现有的文档(以前可以编译)时,我就是无法编译。
我得到了如下所示的错误。此外,它不再识别 Computer Modern 字体。它不是默认的 Latex 字体吗?请注意,我使用的是 TexMaker。
编辑:
这也是我的完整.tex 文件。
%!TEX TS-program = xelatex
\documentclass[a4paper, 11pt]{report}
% Language
\usepackage{polyglossia}
\setmainlanguage{english}
% Context sensitive quotation
\usepackage{csquotes}
% Citations
\usepackage[style=alphabetic, backend=biber]{biblatex}
\addbibresource{References.bib}
% Custom enumerations
\usepackage{enumerate}
% Extend options for positioning floats
\usepackage{float}
% Support highlighting of certain parts of the text
\usepackage{framed}
% Definitions for mathematical type setting
\usepackage{mathtools}
% Headers & Footers
\usepackage[automark, nouppercase]{scrpage2}
% To change the format of titles
\usepackage{titlesec}
% Support for unicode math fonts
\usepackage{unicode-math}
% Extended color support
\usepackage{xcolor}
% Extras for XƎTEX
\usepackage{xltxtra}
% Hyperlinks and pdf properties
\usepackage{hyperref}
% TikZ
\usepackage{tikz}
\usetikzlibrary{arrows,hobby,backgrounds,calc,trees, fit, shapes.geometric}
\newcommand{\Title}{}
\newcommand{\TitleDescription}{}
\newcommand{\Version}{1}
\newcommand{\Subject}{}
\newcommand{\KeyWords}{}
\newcommand{\LeftFooter}{}
\newcommand{\AuthorOne}{}
\newcommand{\MailOne}{\href{mailto:}{}}
% Highlight and tab some text
\newcommand{\highlight}[1]{\textcolor{red}{#1}}
\newcommand{\tab}[1]{\hspace{.1\textwidth}\rlap{#1}}
% Syntax highlighting definitions
\newcommand{\hlstd}[1]{\textcolor[rgb]{0,0,0}{#1}}
\newcommand{\hlnum}[1]{\textcolor[rgb]{0.69,0.49,0}{#1}}
\newcommand{\hlesc}[1]{\textcolor[rgb]{1,0,1}{#1}}
\newcommand{\hlstr}[1]{\textcolor[rgb]{0.75,0.01,0.01}{#1}}
\newcommand{\hlpps}[1]{\textcolor[rgb]{0.51,0.51,0}{#1}}
\newcommand{\hlslc}[1]{\textcolor[rgb]{0.51,0.51,0.51}{\it{#1}}}
\newcommand{\hlcom}[1]{\textcolor[rgb]{0.51,0.51,0.51}{\it{#1}}}
\newcommand{\hlppc}[1]{\textcolor[rgb]{0,0.51,0}{#1}}
\newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}
\newcommand{\hllin}[1]{\textcolor[rgb]{0.33,0.33,0.33}{#1}}
\newcommand{\hlkwa}[1]{\textcolor[rgb]{0,0,0}{\bf{#1}}}
\newcommand{\hlkwb}[1]{\textcolor[rgb]{0,0.34,0.68}{#1}}
\newcommand{\hlkwc}[1]{\textcolor[rgb]{0,0,0}{\bf{#1}}}
\newcommand{\hlkwd}[1]{\textcolor[rgb]{0,0,0.51}{#1}}
% Background color for syntax highlighting
\definecolor{bgcolor}{rgb} {1, 1, 1}
% Custom color definitions
\definecolor{aqua}{rgb} {0, 0.56, 1}
\definecolor{bluegray}{rgb} {0.22, 0.46, 0.84}
\definecolor{grape}{rgb} {0.56, 0, 1}
\definecolor{orchid}{rgb} {0.41, 0.13, 0.55}
\definecolor{orange}{rgb} {1, 0.54, 0}
\definecolor{silver}{rgb} {0.57, 0.57, 0.57}
\definecolor{turquoise}{rgb} {0, 0.86, 0.84}
% No indendation after paragraph
\setlength\parindent{0cm}
% Hyperref properties
\hypersetup
{
pdftitle = {\Title},
pdfsubject = {\Subject},
pdfauthor = {\AuthorOne},
pdfkeywords = {\KeyWords},
colorlinks = true,
linkcolor = black,
anchorcolor = black,
citecolor = silver,
urlcolor = black
}
% Use same size for numbers and other text
\defaultfontfeatures{Numbers=Lining}
% Define font styles
\newfontfamily\Zapfino{Computer Modern}
% Use normal font instead of italic font for head
\renewcommand{\headfont}{\normalfont}
% Set headers and footers
\ihead{\headmark}
\ohead{}
\ifoot{\LeftFooter}
\ofoot{\thepage}
% Set height of head
\setlength{\headheight}{1.8\baselineskip}
% Set thickness of separation line in header, footer
\setheadsepline{0.5pt}
\setfootsepline{0.5pt}
\begin{document}
\begin{titlepage}
\begin{center}
% Title and title-description
{\Huge\Zapfino \Title}
\vskip 0.5cm
{\Large\textit\TitleDescription}
\vskip 1cm
\hrule
\vskip 0.5cm
% Information about author
\begin{tabular}{p{8cm}l}
\AuthorOne & \MailOne\\
\end{tabular}
\vskip 0.5cm
\hrule
\vskip 13.5cm
\end{center}
% Date and version number
\begin{leftbar}
\begin{tabular}{ll}
\textbf{Version} & \Version\\
\textbf{Date} & \today
\end{tabular}
\end{leftbar}
\end{titlepage}
% Modify space before and after a chapter
\titlespacing*{\chapter}{0pt}{-30pt}{10pt}
% Set chapter format for table of contents
\titleformat{\chapter}{\sffamily\bfseries\large}{}{0pt}{}[{\color{aqua}\hrule}]
% Set separation of dots between name of section and page number to such a high
% value that there will be no points in the table of contents
\makeatletter \renewcommand{\@dotsep}{10000} \makeatother
% Use blank header and footer
\pagestyle{empty}
% Suppress page number
\pagenumbering{gobble}
% Start on new page
\newpage
% The table of contents starts at the second page
\setcounter{page}{2}
% Set table of contents
%\tableofcontents
% Suppress page number
\thispagestyle{empty}
\titleformat{\chapter}
{\Large\sffamily\bfseries} % Bold, large, sans serif font for section
{} % No format applied to whole title
{0pt} % No separation between label and title
{\thechapter ~•~ } % Start with chapter number
% Underline with blue ruler, Use default style for headers, footers
[{\color{aqua}\hrule}\thispagestyle{scrheadings}]
% Set format for other sections and paragraphs
% Color = orchid, Font = bold, sans serif
\titleformat*{\section}{\color{black}\sffamily\bfseries}
\titleformat*{\subsection}{\color{black}\sffamily\bfseries}
\titleformat*{\subsubsection}{\color{black}\sffamily\bfseries}
\titleformat*{\paragraph}{\color{black}\sffamily\bfseries}
\titleformat*{\subparagraph}{\color{black}\sffamily\bfseries}
% Start with text on a new page
\newpage
% Display headers and footers
\pagestyle{scrheadings}
% Restore arabic page numbering
\pagenumbering{arabic}
\newpage\chapter{2}
\section{ML2}
\paragraph{Solution:}
\begin{enumerate}
\item $\Box (A \supset A)$.
\end{enumerate}
\newpage
% Suppress page number
\pagenumbering{gobble}
% Set section format for bibliography
\titleformat{\chapter}{\sffamily\bfseries}{}{0pt}{}[{\color{aqua}\hrule}]
% Display bibliography
\printbibliography
\end{document}
您知道问题可能是什么吗?如何解决?
答案1
存在两个问题:
\Box
在基本 latex 中未定义。您必须加载latexsym
(unicode-math
似乎与 兼容)。
另一个问题是hobby
库包的最新版本。您可以不加载它,也可以使用可以从以下网址下载的修复程序github。
对于最后一个解决方案,描述为“很可能不是一个好的修复”,您必须 pdflatex hobby.dtx,并将结果hobby.code.tex, pgflibraryhobby.code.tex, tikzlibraryhobby.code.tex
和安装pml3array.sty
在 中…\latex\hobby\
,无论是在 中texmf-local
还是您的个人 texmf 目录中。当官方修复可用时,您将删除它。