⇤ ← Revision 1 as of 2006-01-29 11:24:56
Size: 2711
Comment:
|
← Revision 2 as of 2009-12-25 07:12:52 ⇥
Size: 2711
Comment: converted to 1.6 markup
|
Deletions are marked like this. | Additions are marked like this. |
Line 8: | Line 8: |
::-- hoxide [[[DateTime(2006-01-29T11:24:56Z)]]] [[TableOfContents]] |
::-- hoxide [<<DateTime(2006-01-29T11:24:56Z)>>] <<TableOfContents>> |
Line 97: | Line 97: |
[[Include(/Discuss)]] | <<Include(/Discuss)>> |
含有章节索引的中文 文章模板
::-- hoxide [2006-01-29 11:24:56]
1. LaTeX 技巧合集
简述
1.1. 使用Hyperref制作漂亮的连接
一直不知道怎么在文章中用hyperref, 做漂亮的连接, 其实设置还满麻烦的, google了, 试了几次才知道,要这样:
\usepackage[CJKbookmarks]{hyperref}
才能正确生成CJK的目录. 但是直接用pdflatex目录其实还是乱码, 不过可以用CTeX套装, 里面有个程序自动生成正确的目录.
1.2. 在document的开始和结束插入命令
可以这样: \AtBeginDocument{\begin{CJK*}{GBK}{song}\CJKtilde} \AtEndDocument{\end{CJK*}}
这样就可以直接用\begin{document}\end{document}的形式,而不用插入CJK的命令了.
1.3. 更改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}
大功告成,
1.4. 起因
- 写小波分析笔记, 用LaTeX, 遂得一些技巧.