TeX -- 被设计为“WYTIWYG (所想即所得)”的排版工具语言 ::-- ZoomQuiet [2005-12-10 07:09:56]
Contents
1. TeX 和 LaTeX
1.1. 简介
|
TeX 是 LaTeX 的基石,LaTeX 建立在 TeX 之上。如果你想搞清楚他们具体是怎样的关系,可以看看LaTeX+CJK是怎样工作的。 |
- TeX 提供了一套功能强大并且十分灵活的排版语言,它多达 900 多条指令,并且 TeX 有宏功能,用户可以不断地定义自己适用的新命令来扩展 TeX 系统的功能。许多人利用 TeX 提供的宏定义功能对 TeX 进行了二次开发,其中比较著名的有美国数学学会推荐的非常适合于数学家使用的 AMS-TeX 以及适合于一般文章、报告、书籍的 LaTeX 系统。 TeX 系统是公认的数学公式排得最好的系统。美国数学学会(AMS)∞ 鼓励数学家们使用 TeX 系统向它的期刊投稿。世界上许多一流的出版社如 Kluwer、Addison-Wesley、牛津大学出版社等也利用 TeX 系统出版书籍和期刊。
1.2. 官方页面
1.3. 文档
如何制作基于 LaTeX 的中文PDF
::-- ZoomQuiet [2005-03-20 05:31:38]
2. 准备环境
Windows: CTeX http://www.ctex.org 幻灯片: Beamer http://latex-beamer.sourceforge.net/
3. 步骤
3.1. 如何制作幻灯片
- 首先,是tex的头部:
\documentclass[cjk]{beamer} % 使用Beamer包 %\hypersetup{pdfpagemode=FullScreen} \usepackage{CJK} % 中文环境 \usepackage{indentfirst} \usetheme{Madrid} % 采用的主题 \usecolortheme{albatross} % 采用的配色。
- Beamer中的幻灯是以frame为单位组织的,通过frame内容的变化达到类似ppt动态的效果。下面是示例:
\section{Intro} \subsection{First part} \frame{ \frametitle{First Part: Keywords} \begin{itemize} \item<1-> Normal LaTeX class.\pause \\ There are some descriptions more. \item<3-> Easy overlays. \item<4-> No external programs needed. \end{itemize} }
这样可以看到三条item会逐步显示,并且,由于\pause命令,在Normal LaTeX Class显示完成后,会有一停顿,并在下一步,显示“There are some descriptions more”. 这个效果很适合做Define/Example。 还有一种方法:
\begin{itemize} \item<1-> itemtitle1 \only<2>{\\ itemdescription1} \item<3-> itemtitle2 \only<4>{\\ itemdescription2} ... \end{itemize}
这样的description会在显示下一个Item时候消失。
- 编译
在Adobe Reader中,显示在一旁的书签(Bookmark)是Unicode的。这样一来,如果单纯是使用pdflatex生成pdf将会显示乱码。所以,若要生成中文的Bookmark就需要如下:
pdflatex slide.tex pdflatex slide.tex gbk2uni slide.out pdflatex slide.tex
4. 注意
5. 反馈
含有章节索引的中文 文章模板
::-- hoxide [2006-01-29 11:24:56]
6. LaTeX 技巧合集
简述
7. 使用Hyperref制作漂亮的连接
一直不知道怎么在文章中用hyperref, 做漂亮的连接, 其实设置还满麻烦的, google了, 试了几次才知道,要这样:
\usepackage[CJKbookmarks]{hyperref}
才能正确生成CJK的目录. 但是直接用pdflatex目录其实还是乱码, 不过可以用CTeX套装, 里面有个程序自动生成正确的目录.
8. 在document的开始和结束插入命令
可以这样: \AtBeginDocument{\begin{CJK*}{GBK}{song}\CJKtilde} \AtEndDocument{\end{CJK*}}
这样就可以直接用\begin{document}\end{document}的形式,而不用插入CJK的命令了.
9. 更改proof环境
AMS 的thm宏包预先定义了proof环境, 想更改之, 能够根据后面是否带参数, 确定是否加括号标注证明作者之类的信息.
- (\@ifontempyty 是amsthm中预设的宏)
\renewenvironment{proof}[1][\empty]{\par \pushQED{\qed}% \normalfont \topsep6\p@\@plus6\p@\relax \trivlist \item[\hskip\labelsep {\hei Proof} %\@ifnotempty{#1}{({#1})} \ifx#1\empty{}\else{({\itshape #1})}\fi: ] \hspace{0.5em} \ignorespaces }{% \popQED\endtrivlist\@endpefalse }
== 同一个文本既能被其它文档包含, 又能单独生成文档 ===
写了个cipdoc.cls的类定义文件.
整个wavelet.tex 希望能生成一本书, 每个章节又是独立的文件例如fourier.tex讲述Fourier变换.
wavelet.tex包含fourier.tex, 同时还希望fourier.tex可被单独使用.
在fourier.tex中, 头部写成:
\ifx\cipbook\mytoken \documentclass{cipdoc}\else \fi
这样当定义了\cipbook这个符号时将不执行\documentclass命令(\mytoken为未定义符号).
另外将正文用\cipdocbegin 和\cipdocend 包裹, 他们定义在cipdoc.cls中:
\@ifundefined{cipbook}{ \LoadClass[11pt,oneside, a4paper]{article} \newcommand{\cipdocbegin}{\begin{document}} \newcommand{\cipdocend}{\end{document}} }{ \LoadClass[11pt,oneside, a4paper]{book} \newcommand{\cipdocbegin}{} \newcommand{\cipdocend}{} }
其实你完全可以在文档中用\ifx处理, 不过个人觉得定义一个命令更简单写.
wevalet.tex希望包含fourier.tex的, 所以头部这样写:
\def\cipbook{\empty} \documentclass{cipdoc}
大功告成,
10. 起因
- 写小波分析笔记, 用LaTeX, 遂得一些技巧.
11. 讨论
11.1. 例子