
%导言区
\documentclass[12pt]{article} %book, report, letter
%通过文档类来改变文档结构类型
\usepackage{ctex} %使用中文注意:ctex宏包、UTF-8、xelatex
\newcommand{\myfont}{\textbf{\textsf{Fancy Text}}}
%正文区(文稿区)
\begin{document} %正文区有且仅有一个document
%字体族设置(罗马字体、无衬线字体、打字机字体)
\textrm{Roman Family} %使用字体设置命令
\textsf{San Serif Family}
\texttt{Typewriter Family}
{\rmfamily Roman Family} %使用字体声明
{\sffamily San Serif Family} %大括号限定字体声明的作用范围
{\ttfamily Typewriter Family}
%字体系列设置(粗细、宽度)
\textmd{Medium Series}
\textbf{Boldface Series}
{\mdseries Medium Series}
{\bfseries Boldface Series}
%字体形状(直立、斜体、伪斜体、小型大写)
\textup{Upright Shape}
\textit{Italic Shape}
\textsl{Slanted Shape}
\textsc{Small Caps Shape}
{\upshape Upright Shape}
{\itshape Italic Shape}
{\slshape Slanted Shape}
{\scshape Small Caps Shape}
%中文字体
{\songti 宋体} \quad {\heiti 黑体}
{\fangsong 仿宋} \quad {\kaishu 楷书}
中文字体的\textbf{粗体}与\textit{斜体}
%字体大小
%通过一系列声明实现,字体大小是相对于normalsize的
%而normalsize的大小由文档类型的参数决定
{\tiny Hello}\\
{\scriptsize Hello}\\
{\footnotesize Hello}\\
{\small Hello}\\
{\normalsize Hello}\\
{\large Hello}\\
{\Large Hello}\\
{\LARGE Hello}\\
{\huge hello}\\
{\Huge Hello}\\
%中文字号设置命令
\zihao{5} 你好!
%Latex中格式与内容分离的思想:自定义命令
\myfont
\end{document}
效果图如下:


1、空格的表示及其大小
\quad、1em、em、m代表当前字体下接近字符‘M’的宽度。
2、使用 \\
表示换行
3、具体设置的细节:
打开cmd,输入 texdoc ctex
命令,可以打开ctex宏包手册。