LaTeX学习摘记(二):字体与段落

来源:互联网 发布:群晖域名服务器dns 编辑:程序博客网 时间:2024/06/05 19:17

增加空白的命令:

\vspace{长度}:精确增加垂直距离

\addvspace{长度}:The\addvspace command normally adds a vertical space of height length. However, ifvertical space has already been added to the same point in the output by aprevious \addvspace command, then this command will not add more space thanneeded to make the natural length of the total vertical space equal to length.

\hspace与\addvspace与此相同

段落间距

\parskip = 长度

段前段后都增加

\bigskip;\medskip  或\smallskip

 

行结束标志

最后加上\hfill xxx

强调(默认正体和斜体互换)

latex强调文本不是用\emph{}命令吗,默认是斜体,

具体使用什么字体,可以用类似

\DeclareTextFontCommand{\emph}{\heiti}

 

来源:http://xfyxiao.ycool.com/post.2983543.html

要给文字加下划线,用 \underline{ This is an underlinetext } 就可以.
跟 \emph{} 命令不同 \emph 是会让文字变跟现在文字不同. 如正体变斜体, 或者斜体变正体.

如果想要用文字高亮显示就要用到一个叫soul 的包,
这个包一共有伍个命令:
\so{letterspacing} l e t t e r s p a c i n g
\caps{CAPITALS, Small Capitals} CAPITALS, Small Capitals
\ul{underlining} underlining
\st{overstriking} overstriking
\hl{highlighting} highlighting5

如果没有加color包,那么 hl 命令就跟下划线命令一样. 通常hl是预设黄色的
可以用以下命令改变颜色
\setulcolor{bule} 设置下划线的颜色为蓝(下划线)
\setstcolor{yellow} 设置overstriking颜色为黄(删除线)
\sethlcolor{green} 设置高亮显示为绿(高亮)
更详细的命令请查阅soul的文档


下面是一个演示文档:
\documentclass{article}
\usepackage{color, soul} %用color, 和 soul 包
\begin{document}
\setulcolor{red} set underlining color
\setstcolor{green} set overstriking color
\sethlcolor{blue} set highlighting color
\so{letterspacing} \
\caps{CAPITALS, Small Capitals}\
\ul{underlining}\
\st{overstriking} \
\hl{highlighting}
\end{document}

 

对齐

 

设置断词

\hyphenation{ab-c  bbb} 表示abc可在b后断词,bbb不能断词

特殊字符

双引号:

\textquotedblleft

\textquotedblright

 

单引号:

\textquoteleft

\textquoteright

 

如果需要借助于内部有\@字符的命令,如\@addtoreset,就需要借助于另两个命令

\makeatletter, \makeatother。

 

%

\%

\

\textbackslash or \backslash

$

\$

#

\#

{

\{

}

\}

^

\^{}

_

\_

~

\~{}

&

\&

|

\textbar $|$

\textgreater

\textless

连数符

--

破折号

---

 

支持中文

\usepackage[nocap,noindent]{ctex}

\usepackage{CJK}

\begin{CJK}{GBK}{song} ç宋体

试试aa

\end{CJK}

 

设置字体

依次为 编码,字族,序列,形状ß 任选组合

\fontencoding{} \fontfamily{} \fontseries{}\fontshape{} \fontsize{尺寸}{行距(通常要比尺寸大20%)}

\newcommand{\myfont}[1]{{\fontencoding{U}\fontfamily{fplmbb}\fontseries{m}\fontshape{n}\selectfont#1}},形状后面可加大小\fontsize{}{}

\newcommand{\myfont}[1]{{\usefont{U}{fplmbb}{m}{n}\selectfont#1}}

 

数学字体选择

公式图标 à math

或TeX à CTeX tools à TeXFriend …

(OB$\mathfrak{AO}$DD)OB$\mathds{AO}$DD

 

条件判断

包ifthen

\ifthenelse{条件判断}{肯定语句}{否定语句}

条件判断的类型

数值1 关系符(< = >) 数值2

\lengthtest{长度1 关系符 长度2}

\isodd{数值}

\equal{字符串}{字符串}

\boolean{布尔寄存器名};新定义布尔寄存器\newboolean{名称};赋值\setboolean{名称}{false/true}

\isundefined{命令}

多重条件 \and \or\not \( \)

条件循环:\whiledo{条件判断}{肯定语句}