我已经从 getnonfreefonts 下载并安装了适用于 TexShop 的 Arial 字体。第一次使用时它就起作用了,但在我排版之后,它又恢复为默认字体。我怎样才能将它恢复为 Arial?
\documentclass[12pt,a4paper,oneside]{book}
\usepackage[bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm]{geometry}
\usepackage{url}
\usepackage{lmodern}
\usepackage{titling}
\usepackage{setspace}\doublespacing
\usepackage{float}
\usepackage[labelfont=bf]{caption}
\usepackage{notoccite}
\usepackage [english]{babel}
\usepackage{multirow}
\usepackage [autostyle, english = british]{csquotes}
\MakeOuterQuote{"}
\usepackage{filecontents}
\usepackage{longtable}
\usepackage{booktabs}
\renewcommand{\arraystretch}{1.2}
\usepackage[version=3]{mhchem}
\usepackage{indentfirst}
\usepackage{xpatch}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{bm}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage[scaled]{uarial}
\usepackage[T1]{fontenc}
\renewcommand*\familydefault{\sfdefault}
\usepackage[section]{placeins}
\usepackage[utf8]{inputenc}
\setlength{\arrayrulewidth}{1mm}
\setlength{\tabcolsep}{18pt}
\renewcommand{\arraystretch}{1.5}
\usepackage{dcolumn}
\usepackage{mathtools}
\usepackage[toc,page]{appendix}
\usepackage{array}
\usepackage{listings}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{authblk}
\usepackage{relsize}
\usepackage{hyperref}
\usepackage{color}
\usepackage[dvipsnames]{xcolor}
\usepackage{fancyhdr}
\usepackage{titlesec}
\titleformat{\chapter}[block]
{\normalfont\huge\bfseries}{\thechapter.}{1em}{\Huge}
\titlespacing*{\chapter}{0pt}{-19pt}{0pt}
\usepackage[square, sort, numbers]{natbib}
\usepackage[nottoc,numbib]{tocbibind}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\usepackage{tikz}
\usepackage{newtxtext,newtxmath}
\usepackage{calc}
\makeatletter
\newcommand{\tocfill}{\cleaders\hbox{$\m@th \mkern\@dotsep mu . \mkern\@dotsep mu$}\hfill}
\makeatother
\newcommand{\abbrlabel}[1]{\makebox[3cm][l]{\textbf{#1}\ \tocfill}}
\newenvironment{abbreviations}{\begin{list}{}{\renewcommand{\makelabel}{\abbrlabel}%
\setlength{\labelwidth}{3cm}\setlength{\leftmargin}{\labelwidth+\labelsep}%
\setlength{\itemsep}{0pt}}}{\end{list}}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\slshape \rightmark}
\fancyfoot[C]{\thepage}
\setcounter{secnumdepth}{4}
\renewcommand{\bibname}{References}
\begin{document}
\end{document}
答案1
您的文档已加载四字体包:lmodern
、、uarial
和。该包正在覆盖您的设置。因此您需要删除不需要的包。如果您希望整个文档(不包括数学)都采用 Arial 字体,请执行以下操作newtxtext
:newtxmath
newtxtext
uarial
\usepackage{uarial}
\renewcommand{\familydefault}{\sfdefault}
如果您也想要无衬线数学支持,则需要做一些不同的事情。请参阅: