LaTeX学习---字体设置

最近开始用LaTeX来做格式,感觉到方便的地方十分感人,但细节多到让人崩溃,因此准备起一个系类来做记录。

最长用的字体设置,本来是用LaTeX系统自带的字体,感觉良好。但在做格式的时候发现,其跟WORD打出来的字有点不一样,宽度总是怪怪的,特别是加粗了之后更加明显,这个虽然不见得一定要改,然而如果想做一个可以替代掉WORD的东西,起码起初还是要跟它比较像的好,因此本人又研究了一个下午,把最终的字体设置,加粗设置和字号设置直接以代码的形式放出来供大家参考。

%-*-coding:UTF-8-*-
\documentclass[UTF8]{article}
\usepackage{fontspec,xunicode,xltxtra} %字体包

%字体设置
\newfontfamily\youyuan{YouYuan}
\newfontfamily\hwcaiyun{STCaiyun}
\newfontfamily\hwhupo{STHupo}
\newfontfamily\yaoti{FZYaoTi}
\newfontfamily\kaiti{KaiTi}
\newfontfamily\xsong{NSimSun}
\newfontfamily\hwsong{STSong}
\newfontfamily\yahei{Microsoft YaHei}
\newfontfamily\fangsong{FangSong}
\newfontfamily\song{SimSun}
\newfontfamily\hwfangsong{STFangsong}
\newfontfamily\weiti{STXinwei}
\newfontfamily\heiti{SimHei}
\newfontfamily\hwxingkai{STXingkai}
\newfontfamily\hwlishu{STLiti}
\newfontfamily\zhongsong{STZhongsong}
\newfontfamily\shuti{FZShuTi}
\newfontfamily\hwhei{STXihei}
\newfontfamily\lishu{LiSu}
\newfontfamily\hwkai{STKaiti}

%加粗设置
\newfontfamily\bsong[FakeBold = 5]{SimSun} %加粗的宋体,其中FakeBold为字体的粗细

%字号设置
\newcommand{\chuhao}{\fontsize{42pt}{\baselineskip}}
\newcommand{\xiaochuhao}{\fontsize{36pt}{\baselineskip}}
\newcommand{\yihao}{\fontsize{28pt}{\baselineskip}}
\newcommand{\erhao}{\fontsize{21pt}{\baselineskip}}
\newcommand{\xiaoerhao}{\fontsize{18pt}{\baselineskip}}
\newcommand{\sanhao}{\fontsize{15.75pt}{\baselineskip}}
\newcommand{\sihao}{\fontsize{14pt}{\baselineskip}}
\newcommand{\xiaosihao}{\fontsize{12pt}{\baselineskip}}
\newcommand{\wuhao}{\fontsize{10.5pt}{\baselineskip}}
\newcommand{\xiaowuhao}{\fontsize{9pt}{\baselineskip}}
\newcommand{\liuhao}{\fontsize{7.875pt}{\baselineskip}}
\newcommand{\qihao}{\fontsize{5.25pt}{\baselineskip}}

\begin{document}
\sihao\heiti 黑体\\
\erhao\song 宋abc体\\
\chuhao\song The \xiaoerhao\bsong smart home system base on Android\\
\end{document}

这里写图片描述

猜你喜欢

转载自blog.csdn.net/oHanTanYanYing/article/details/80573009