LaTeX 中插入中英双语目录
来源:互联网 发布:电子请帖制作软件 编辑:程序博客网 时间:2024/04/29 18:27
学校的硕士论文要求中英双语目录,即一份中文目录,再有一份独立的英文目录。李树钧的主页有一个解法( http://www.hooklee.com/tex.html ),手法略有些hacking:改造 /@chapter 和 /@sect 等宏 (/chapter 和 /section /subsection 会用到这两个宏)。我用的 ctex 宏包已经重新定义过这两个宏了,因此不能直接用他提供的文件。
阅读他的代码之后,我找到一个简单的解决办法:定义几个新的命令,/echapter /esection /esubsection 等,与原有的 /chapter /section /subsection 等命令配合使用,然后用 /tableofengcontents 生成英文目录。用法:
/chapter{导论}
/echapter{Introduction}
/chapter{服务定义语言}
/echapter{Service Definition Language}
/section{语言映射}
/esection{Language Mapping}
以下内容放在 /begin{document} 之后:
/makeatletter
/newcommand/engcontentsname{Contents}
/newcommand/tableofengcontents{%
/if@twocolumn
/@restonecoltrue/onecolumn
/else
/@restonecolfalse
/fi
/chapter*{/engcontentsname
/@mkboth{%
/MakeUppercase/engcontentsname}{/MakeUppercase/engcontentsname}}%
/@starttoc{toe}% !!!!Define a new contents!!!!
/if@restonecol/twocolumn/fi
}
/newcommand/addengcontents[2]{%
/addcontentsline{toe}{#1}{/protect/numberline{/csname the#1/endcsname}#2}}
/makeatother
/newcommand/echapter[1]{/addengcontents{chapter}{#1}}
/newcommand/esection[1]{/addengcontents{section}{#1}}
/newcommand/esubsection[1]{/addengcontents{subsection}{#1}}
/tableofcontents % 中文目录
/tableofengcontents % 英文目录
关键技术是,/echapter /esection 等调用 /addcontentsline 将英文目录的条目写入 .toe 文件(原来的中文目录是 .toc 文件),然后用 /@starttoc{toe} 把 .toe 文件的内容按目录方式排出。
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- LaTeX 中插入中英双语目录
- Latex 中插入图片
- latex中插入图片
- Asp.net 2.0 自定义控件开发专题讲解[为用户控件增加DataSource属性, 能够自动识别不同数据源](示例代码下载)
- Designing and Implement ButtonEdit Control for Windows Forms
- Windows API一日一练(63)RegOpenKeyEx和RegCreateKeyEx函数
- 为perforce添加nothave命令,查找尚未添加到depot中的文件(in Ruby)
- 2007.5.13 祝天下所有的母亲: 节日快乐!
- LaTeX 中插入中英双语目录
- Windows API一日一练(61)GetDriveType函数
- 从“在快餐店吃饭”到Command模式(一)
- nmake 的 batch mode (批模式) 推理规则可以用一次命令行调用编译多个文件
- 如果你是程序员你或许不须以撰写组件维生,但我确信你必定得依赖组件维生!
- Ruby的Source Repository终于也换成Subversion了
- Windows API一日一练(60)CreateIoCompletionPort和GetQueuedCompletionStatus函数
- 面试题2:10个靶打中90环的情况有多少种?
- 像Component的Control