字体字号
包含字体族、字体系列、字体形状、中文字号等设置
% 导言区
\documentclass[10pt]{article} % book,report,letter
\usepackage{ctex}
\newcommand\degree{^\circ}
\newcommand{\myfont}{\textbf{\textsf{Fancy Text}}}
\title{\heiti My First Document 测试}
\author{\kaishu Name名词}
\date{\today}
% 正文区(文稿区)
\begin{document}
\maketitle
Hello World!
可以用符号表述为:设直角三角形 $ABC$, 其中 $\angle C=90\degree$, 则有
Let $f(x)$ be defined by the formula
$$f(x)=3x^2+x-1$$ which is a polynomial of degree 2.
% 字体族设置(罗马字体、无衬线字体、打字机字体)
\textrm{Roman Family} \textsf{Sans Serif Family} \texttt{Typewriter Family}
{\rmfamily Roman Family} {\sffamily Sans 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 黑体} \quad {\fangsong 仿宋} \quad {\kaishu 楷书}
% 粗体 黑体实现 斜体 楷书实现
中文字体的\textbf{粗体}与\textit{斜体}
% 字体大小
{\tiny Hello}\\
{\scriptsize Hello}\\
{\footnotesize Hello}\\
{\small Hello}\\
{\normalsize Hello}\\
{\large Hello}\\
{\Large Hello}\\
{\LARGE Hello}\\
{\huge Hello}\\
{\Huge Hello}\\
% 中文字号设置命令
\zihao{-0} 测试!
\myfont
\end{document}
文档基本结构
% 导言区
\documentclass{article}
\usepackage{ctex}
% 正文区(文稿区)
\begin{document}
\tableofcontents % 生成目录
\section{引言}
\section{实验方法}
\section{实验方法}
\section{实验结果}
\subsection{数据}
\subsection{图标}
\subsubsection{实验条件}
\subsubsection{实验过程}
\subsection{实验分析}
\section{结论}
\section{致谢}
\end{document}
特殊字符
% 导言区
\documentclass{article}
\usepackage{ctex} % 中文处理宏包
\usepackage{xltxtra} % 提供了针对XeTeX的改进并且加入了XeTeX的LOGO
\usepackage{texnames} % 一些logo
\usepackage{mflogo}
% 正文区(文稿区)
\begin{document}
\section{空白符号}
% 空行分段,多个空行等于一个
% 自动缩进,绝对不能使用空格代替
% 英文中多个字符处理为1个空格,中文中空格将被忽略
% 汉字与其他字符的间距会自动由XeLaTeX处理
% 禁止使用中文全角空格
% 1em(当前字体中M的宽度)
a\quad b
% 2em
a\qquad b
% 约有1/6个em
a\,b a\thinspace b
% 0.5em
a\enspace b
% 空格
a\ b
% 硬空格
a~b
% 1pc=12pt=4.128mm
a\kern 1pc b
a\kern -1em b
a\hskip 1em b
a\hspace{35pt} b
% 占位宽度
a\hphantom{xyz}b
% 弹性长度
a\hfill b
\section{\LaTeX 控制符}
\# \$ \{ \} \~{} \_{} \^{} \textbackslash \&
\section{排版符号}
\S \P \dag \ddag \copyright \pounds
\section{\LaTeX 标志符号}
\TeX{} \LaTeX{} \LaTeXe{}
\XeLaTeX
% texnames宏包提供
\AmSTeX{} \AmS-\LaTeX{}
\BibTeX{} \LuaLaTeX{}
% mflogo宏包提供
\METAFONT{} \MF{} \MP{}
\section{引号}
` ' `` '' ``测试''
\section{连字符}
- -- ---
\section{非英文字符}
\oe \OE \ae \AE \aa \AA \o \O \l \L \ss \SS !` ?`
\section{重音符号(以o为例)}
\`o \`O \^o \``o \~o \.o \u{o} \v{o} \H{o} \r{o} \t{o} \b{o} \c{o} \d{o}
\end{document}
Latex常用字母及符号表