我在序言中使用以下代码更改了字体。它运行良好。
\setmainfont[ExternalLocation=../4-Fonts/]{SegoeUI.ttf}[
BoldFont={SegoeUIBold.ttf},
ItalicFont={SegoeUIItalic.ttf},
BoldItalicFont={SegoeUIBoldItalic.ttf}
]
但是 () 和 "" 无法编译。Font 包中有 () 等。
当我从序言中注释掉上述代码并且文本恢复到其标准字体时,所有 () 和“”都会得到正确编译。
\documentclass[11pt,a4paper,twoside]{article}
%Document language
\usepackage[english]{babel}
%Better line spacing
\usepackage{microtype}
%Document margins and size
\usepackage[a4paper,top=2cm,bottom=2cm,left=2.3cm,right=2.3cm,headheight=15pt]{geometry}
%Write in color
\usepackage{xcolor}
%Useful math package
\usepackage{amsmath}
%PDF links and hyperlinks https://www.namsu.de/Extra/pakete/Hyperref.html
\usepackage{hyperref}
%better tables
\usepackage{array}
%citations
\usepackage[style=authortitle]{biblatex}
%better quotes (recommended by bibtex)
\usepackage{csquotes}
%Better Images
\usepackage{tikz}
%better headers https://www.overleaf.com/learn/latex/Headers_and_footers
\usepackage{fancyhdr}
%date and time
\usepackage[useregional]{datetime2}
%reference for lastpage number
\usepackage{lastpage}
%enables font selection and sets main font
\usepackage{fontspec}
%Best loaded last in the preamble (for subfiles)
\usepackage{subfiles}
%defines the path to find images
\graphicspath{{../2-Images}}
%sets main and secondary font
\setmainfont[ExternalLocation=../4-Fonts/]{SegoeUI.ttf}[
BoldFont={SegoeUIBold.ttf},
ItalicFont={SegoeUIItalic.ttf},
BoldItalicFont={SegoeUIBoldItalic.ttf}
]
\begin{document}
\section{intro}
the formatting and (numbering is handled)"" automatically according to the template you've chosen. If you're using Rich Text mode, you can also create new section and subsections via the buttons in the editor toolbar.
\end{document}
编辑 2:日志文件中显示我的 ttf 文件没有符号。虽然它没有抛出错误或警告。这可能与 overleaf 有关吗?
它们应该在那里,因为上面的图片显示括号,所以它一定在 ttf 文件中。