我想知道将所有文本字体定义为特定大小的正确方法是什么。我使用\documentclass[20pt]{article}
但它不会改变 xelatex 中的字体大小。而且这些符号("
和'
)不是 Times 字体,现在无论我如何更改字体,它们看起来都一样。这是最小工作代码。我想知道在 xelatex 中解决字体选择的正确方法是什么。我可以得到这样的结果吗?
而不是这样?
%!TEX TS-program = xelatex
\documentclass[20pt]{article}
\usepackage{geometry}
\usepackage{mathspec}
\usepackage{lipsum}
\setmainfont{Times}
\setmathsfont(Digits,Latin,Greek){Times}
\usepackage{titling}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[colorlinks,urlcolor=black]{hyperref}
\doublespacing
\titleformat{\section}{\singlespacing\fontsize{20}{24}\bfseries\rmfamily\uppercase} {\thesection.}{0.5em}{}
\begin{document}
\section{"check"}
"just checking" this is a "check" and 'check'.
\end{document}
答案1
如果您被绑定到article
文档类,那么有两个选项:
选项1
您可以使用scrextend
包,将`KOMA-script 类的功能(如字体大小)扩展到其他类:
%!TEX TS-program = xelatex
\documentclass{article}
\usepackage{scrextend} %%% this line
\changefontsizes[24pt]{20pt} %%% and this line
\usepackage{geometry}
\usepackage{mathspec}
\usepackage{lipsum}
\setmainfont[Ligatures=TeX]{Times New Roman}
\setmathsfont(Digits,Latin,Greek){Times New Roman}
\usepackage{titling}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[colorlinks,urlcolor=black]{hyperref}
\doublespacing
\titleformat{\section}{\singlespacing\fontsize{20}{24}\bfseries\rmfamily\uppercase} {\thesection.}{0.5em}{}
\begin{document}
\section{``check''}
``just checking'' this is a ``check'' and `check'.
\end{document}
选项-2
您可以使用包,这是Karl Koeller 在他的回答中提到的extsizes
包版本。extarticle
%!TEX TS-program = xelatex
\documentclass{article}
%\usepackage{scrextend}
%\changefontsizes[24pt]{20pt}
\usepackage[20pt]{extsizes} %%% this line
\usepackage{geometry}
\usepackage{mathspec}
\usepackage{lipsum}
\setmainfont[Ligatures=TeX]{Times New Roman}
\setmathsfont(Digits,Latin,Greek){Times New Roman}
\usepackage{titling}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[colorlinks,urlcolor=black]{hyperref}
\doublespacing
\titleformat{\section}{\singlespacing\fontsize{20}{24}\bfseries\rmfamily\uppercase} {\thesection.}{0.5em}{}
\begin{document}
\section{``check''}
``just checking'' this is a ``check'' and `check'.
\end{document}
答案2
该类article
仅支持10pt
、11pt
和12pt
。
您可以使用支持的extarticle
(扩展)类。article
20pt
在下面的 MWE 中,我将“Times”更改为“Times New Roman”,并且使用Ligatures=TeX
选项获得了正确的引号,但您必须使用标准 LaTeX 方式来使用双引号。
%!TEX TS-program = xelatex
\documentclass[20pt]{extarticle}
\usepackage{geometry}
\usepackage{mathspec}
\usepackage{lipsum}
\setmainfont[Ligatures=TeX]{Times New Roman}
\setmathsfont(Digits,Latin,Greek){Times New Roman}
\usepackage{titling}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[colorlinks,urlcolor=black]{hyperref}
\doublespacing
\titleformat{\section}{\singlespacing\fontsize{20}{24}\bfseries\rmfamily\uppercase} {\thesection.}{0.5em}{}
\begin{document}
\section{``check''}
``just checking'' this is a ``check'' and `check'.
\end{document}
输出
如果您想"..."
这样做,您可以在序言中添加以下两行:
\usepackage{csquotes}
\MakeOuterQuote{"}
答案3
使用
\documentclass[fontsize=20pt]{scrartcl}