文章目录
- 字体
- 使用宏包
- 设置命令
- 声明命令
- 字号
- 例子
- 设置特定字号
- 设置行间距
- 用\setlength{\baselineskip}{24pt}设置
- \renewcommand{\baselinestretch}{2} \selectfont
- 中文行距({ctex})
- 补充:
字体
使用宏包
\usepackage{ctex}
设置命令
只对确定字有作用,对其他文字无作用。
{\kaishu 放假啊深度可达}
声明命令
后面所以内容都是这个字体。
\heiti
这里就是中文了。\\
\documentclass{article}
\usepackage{ctex}
%\title{字体字形字号}
\begin{document}
\heiti
这里就是中文了。\\
{\kaishu 放假啊深度可达}\\
撒大苏打撒旦
\end{document}
效果图:
字号
\documentclass [10pt]{article}
系统默认为10磅。
\usepackage{ctex}
\usepackage[zihao=5]{ctex}
ctex默认为5号字体。
例子
\documentclass{article}
\usepackage{ctex}
%\title{字体字形字号}
\begin{document}
\heiti
\normalsize
这里就是中文了。\\
{\large 放假啊深度可达}\\
\fontsize{14pt}{15pt} \selectfont
撒大苏打撒旦,啊实打实大苏打实打实的
{\small 速度速度速度速度}
\end{document}
\large小四,\normalsize五号,\small小五。
\normalsize为声明命令,\large和\small为设置命令。
设置特定字号
\fontsize{11.5pt}{13pt} \selectfont
11.5为字号,13为行距。
有selectfont字体才有效果。(间距还未设定无效果)
\documentclass{article}
\usepackage{ctex}
%\title{字体字形字号}
\begin{document}
\heiti
\small
撒大苏打撒旦,啊实打实大苏打实打实的\\
{\fontsize{12pt}{15pt} \selectfont
撒大苏打撒旦,啊实打实大苏打实打实的}\\
{\fontsize{14pt}{15pt} \selectfont
撒大苏打撒旦,啊实打实大苏打实打实的}
\end{document}
设置行间距
\the\baselineskip
显示行间距
用\setlength{\baselineskip}{24pt}设置
\documentclass{article}
\usepackage{ctex}
%\title{字体字形字号}
\begin{document}
this is a long long long long sentence.
this is a long long longlong sentence,
this is a long long longlong sentence,
this is a long long longlong sentence.
\the\baselineskip
{\setlength{\baselineskip}{24pt}
his is a long long long long sentence.
this is a long long longlong sentence,
this is a long long longlong sentence,
this is a long long longlong sentence.
\the\baselineskip}
his is a long long long long sentence.
this is a long long longlong sentence,
this is a long long longlong sentence,
this is a long long longlong sentence.
\the\baselineskip
\end{document}
\renewcommand{\baselinestretch}{2} \selectfont
拉伸为字号间距的两倍。
针对字号的拉伸。
\documentclass{article}
% \usepackage{ctex}
%\title{字体字形字号}
\begin{document}
\large
\setlength{\baselineskip}{24pt}
this is a long long long long sentence.
this is a long long longlong sentence,
this is a long long longlong sentence,
this is a long long longlong sentence.
\the\baselineskip
% \renewcommand{\baselinestretch}{2} \selectfont
\linespread{2} \selectfont
this is a long long long long sentence.
this is a long long longlong sentence,
this is a long long longlong sentence,
this is a long long longlong sentence.
\the\baselineskip
\setlength{\baselineskip}{24pt}
this is a long long long long sentence.
this is a long long longlong sentence,
this is a long long longlong sentence,
this is a long long longlong sentence.
\the\baselineskip
\end{document}
字号为14拉伸为28.
\linespread{2} \selectfont
完全等价于
\renewcommand{\baselinestretch}{2} \selectfont
中文行距({ctex})
\linespread{1.3}为单倍,\linespread{2.6}为双倍。
\documentclass{article}
\usepackage{ctex}
%\title{字体字形字号}
\begin{document}
this is a long long long long sentence.
this is a long long longlong sentence,
this is a long long longlong sentence,
this is a long long longlong sentence.
\the\baselineskip
\linespread{2.6} \selectfont
this is a long long long long sentence.
this is a long long longlong sentence,
this is a long long longlong sentence,
this is a long long longlong sentence.
\the\baselineskip
\linespread{1.3} \selectfont
this is a long long long long sentence.
this is a long long longlong sentence,
this is a long long longlong sentence,
this is a long long longlong sentence.
\the\baselineskip
\end{document}
补充:
ctex宏包手册:
终端输入texdoc ctex