LaTeX学习笔记(一)
安装
参考:http://www.nsknet.or.jp/~tony/TeX/install/win/tex.htm
最简单的例子
\documentclass[11pt]{jarticle}
\textwidth=50mm
\begin{document}
あああああああああああああ
\end{document}
如何将tex文件转化为pdf文档(日语):
platex xyz.tex
dvipdfmx xyz.dvi
如何将dvi文件转化为gif/png:
dvipng --gif -T tight -D 200 xyz.dvi
dvipng -T tight -D 200 xyz.dvi
省略 --gif
参数则输出为png格式。-D
为放大百分比。
\documentclass
: 文档类型[11pt]
:文档类型参数{jarticle}
:文档类型的值。两列分栏显示,则指定文档类型参数为[twocolumn,11pt]
。
页面布局
页面基准点:从纸的左上角算起,向右向下各移动 1inch(2.54cm) 处的点。通过该点的水平线称为上基准线,垂直线称为左基准线。
各种布局参数
\topmargin | 页眉上端到上基准线的距离。 |
\headheight | 页眉高度。 |
\headsep | 页眉下端到正文上端的距离。 |
\topskip | 正文上端到正文第一行的距离。 |
\textheight | 正文的高度。 |
\textwidth | 正文的宽度。 |
\evensidemargin | 偶数页(左页)中,正文的左端到左基准线的距离。 |
\oddsidemargin | 奇数页(右页)中,正文的左端到左基准线的距离。 |
\footskip | 正文下端到页脚下端的距离。 |
\marginparwidth | 页面右侧脚注的宽度。 |
\marginparpush | 页面右侧脚注之间的距离。 |
\marginparsep | 页面右侧脚注到正文的距离。 |
\columnsep | 二分栏时左右栏之间的距离。 |
\columnseprule | 二分栏时左右栏之间分隔线的宽度。 |
页码
页码格式
通过 \pagestyle{格式}
来指定页码格式。格式有以下几种:
empty | 空白页眉、页脚 |
plain | 空白页眉,但是在页脚的中央输出页码 |
headings | 空白页脚,但是在页眉输出页码、章节编号以及标题 |
myheadings | 自定义 |
通过 \renewcommand{\thepage}{\roman{page}}
命令可以改变页码的格式。其中\roman部分为定义格式的命令,包括如下几种:
\arabic | 阿拉伯数字 | 1, 2, 3, ... |
\roman | 罗马数字(小写) | i, ii, iii, ... |
\Roman | 罗马数字(大写) | I, II, III, ... |
\alph | 英文字母(小写) | a, b, c, ... |
\Alph | 英文字母(大写) | A, B, C, ... |
通过 \setcounter{page}{10}
可以将页码设置为10。
多个文档的结合
通过 \input{文档名}
命令可以结合多个文档。文档名不用带扩展名.tex。