如何为我的整个文档设置 Arial Narrow 字体(字体大小为 10.5pt)?

如何为我的整个文档设置 Arial Narrow 字体(字体大小为 10.5pt)?
\documentclass[letter,10.5pt]{article}
\usepackage[head=0pt,bottom=0.6in,top=0.8in, left=0.5in,right=0.5in, footskip=1cm]{geometry}

%%%%%%%%%%% pdflatex %%%%%%%%%
\usepackage[T1]{fontenc}
\usepackage{newtxmath,newtxtext}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%% xelatex %%%%%%%%%%%%%%
% \usepackage{fontspec}
% \setmainfont{Times New Roman}
% \setmainfont{TeX Gyre Termes}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%A Few Useful Packages
\usepackage{parskip}
\usepackage{titlesec}   
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{mdframed}
\usepackage{xcolor}

\usepackage{fontspec} 
\setmainfont{Arial}


%\usepackage{arial}                           % load package which provides the font
%\renewcommand{\sfdefault}{ua1}               % set default serif font as Arial
%\renewcommand{\familydefault}{\sfdefault}    % set the default font as serif, i.e., Arial

\definecolor{navyblue}{RGB}{31, 78, 120}
% line spacing
\linespread{1.0}

\titleformat{\section}
  {\normalfont\Large}{}{0pt}{}[{\titlerule[0.8pt]}]
  
\usepackage{eso-pic}

\AddToShipoutPictureBG{\color{navyblue}%
\AtPageUpperLeft{\rule[-20mm]{\paperwidth}{20mm}}%
}

\begin{document}

\section{\color{navyblue} SUMMARY OF QUALIFICATIONS}
Results-driven, customer-focused, and innovative professional with years of work experience in diverse software development roles. Highly skilled in JavaScript, React, Node.js and associated technologies. Hands-on experience in front-end and back-end development of web-based applications and advanced development methodologies, as well as design and development of automation systems. My proven capabilities in self-management, get-up-and-go attitude, and ability to understand complex coding with ease make me an ideal candidate to fit the position of software engineer, and I am confident that I will be a valuable asset to your organisation.

\end{document}

答案1

设置字体

首先,检查您是否安装了 Arial Narrow。 除非为所有用户安装字体,否则 Windows 上的 TeX 无法找到字体。 要测试 XeTeX 如何查找字体,请fc-match "Arial Narrow"从命令行运行。要测试 LuaTeX 如何查找字体,请运行luaotfload-tool --find "Arial Narrow"。如果您以默认方式安装字体,而没有管理员权限,Windows 会将其放在 TeX 引擎不知道的隐藏目录中。如果您不小心这样做了,请复制字体文件,从控制面板中卸载它,然后为所有用户重新安装。

您也可以通过文件名加载字体,这是推荐的方法。如果您有文件C:\Windows\Fonts\ARIALN.TTF,这应该适合您:

\usepackage{fontspec}

\defaultfontfeatures[ARIALN]{
    UprightFont=*,
    BoldFont=*B,
    ItalicFont=*I,
    BoldItalicFont=*BI,
    Extension=.ttf }

\setmainfont{ARIALN}
\setsansfont{ARIALN}

如果你碰巧没有,可以使用 Arial Nova Condensed免费

设置字体大小

TeX 所称的10pt是稍小的欧洲点。Word 和大多数其他软件所称的“点”,TeX 称为bp或“大点”。获取 Microsoft Word 所称的“10.5 点”的一种方法是:

\usepackage[fontsize=10.5bp]{scrextend}

您也可以加载scrartcl类而不是article,以获得 Koma-Script 的额外功能

但是,如果“10.5pt” 确实是10ptTeX 比 Word 更小的一个解决方法,而您真正想要的是 Word 所称的 10 点,那么就说10bp。(同样,如果您想要 2 厘米,您应该说2cm,而不是0.8in)。

文档中的其他错误

您似乎在抄袭别人的序言。更糟糕的是,您似乎在抄袭某个人,而这个人又抄袭了其他人。您最终得到了多个软件包,这些软件包重复了两次,或者彼此不兼容。

您需要进行的一些更改包括:

  • 在 之前加载\usepackage[svgnames]{xcolor}一次fontspec即可得到NavyBlue
  • 不要加载fontencnewtxtext(加载上个世纪的 8 位字体)fontspec
  • 不要newtxmath在这里加载。它会以旧格式加载数学模式(我怀疑以这种方式启动的文档是否需要),还会加载与 Arial Narrow 严重冲突的字体。如果您需要同时使用数学模式fontspec您可以从这里的样本中挑选一个。
  • \addtokomafont如果您使用scrartcl文档类,或者使用其他包,则只需设置一次标题的颜色titlesec。不要\color在每个单独的部分标题中放置命令。
  • 获取信纸尺寸纸张的包装选项是letterpaper,而不是letter
  • 删除任何您实际上未使用的包。

可能的模板

\documentclass[lettepaper,fontsize=10.5bp]{scrartcl}
\usepackage[head=0pt,bottom=0.6in,top=0.8in, left=0.5in,right=0.5in, footskip=1cm]{geometry}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage[svgnames]{xcolor}
\usepackage{fontspec} 

\defaultfontfeatures[ARIALN]{
    UprightFont=*,
    BoldFont=*B,
    ItalicFont=*I,
    BoldItalicFont=*BI,
    Extension=.ttf }

\setmainfont{ARIALN}
\setsansfont{ARIALN}

\addtokomafont{disposition}{\color{NavyBlue}}

\begin{document}

\section{ SUMMARY OF QUALIFICATIONS}
Results-driven, customer-focused, and innovative professional with years of work experience in diverse software development roles. Highly skilled in JavaScript, React, Node.js and associated technologies. Hands-on experience in front-end and back-end development of web-based applications and advanced development methodologies, as well as design and development of automation systems. My proven capabilities in self-management, get-up-and-go attitude, and ability to understand complex coding with ease make me an ideal candidate to fit the position of software engineer, and I am confident that I will be a valuable asset to your organisation.
\end{document}

相关内容