在 Debian GNU/Linux 中安装 TeXLive

lj605 [at] bbs.ctex.org
Source:http://bbs.ctex.org/forum.php?mod=viewthread&tid=57755
本作品采用署名-相同方式共享 2.5 协议发布

视频教程 http://v.youku.com/v_show/id_XMTc0NjIxNDk2.htm

  Debian GNU/Linux 中 TeXLive 的中文支持 (见2楼)

视频教程 http://v.youku.com/v_show/id_XMTc1MDc3MTI4.html


环境介绍

  • 系统: Debian GNU/Linux sid
  • 版本: TeXLive 2009
  • 字体: 文泉驿正黑


什么是 TeX, LaTeX?

http://zh.wikipedia.org/zh-cn/TeX

http://zh.wikipedia.org/zh-cn/LaTeX

TeX 被普遍认为是一个很好的排版工具, 非常适用于生成高印刷质量的科技和数学类文档

安装 TeXLive
安装步骤:

  • 准备. 安装 perl-tk.
    1. $sudo aptitude install perl-tk
    复制代码
  • 下载安装程序
    1. $wget http://mirrors.xmu.edu.cn/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz
    复制代码
  • 安装
    1. $tar -zxvf install-tl-unx.tar.gz
    复制代码
  1. $cd install-tl*
复制代码
  1. $sudo ./install-tl --gui -location http://mirrors.xmu.edu.cn/CTAN/systems/texlive/tlnet/
复制代码
  • 安装 TeXworks.
  1. $sudo aptitude install texworks  --without-recommends
复制代码

测试
例子: helloword.tex,  使用 XeLaTeX 编译

源文件:

\documentclass[UTF8,nofonts]{ctexart}
\setCJKmainfont{WenQuanYi Zen Hei}
\begin{document}
Hello world! I am using \TeX.

大家好! 我在使用 \TeX.
\end{document}



提示: 使用 \$fc-list :lang=zh-cn 查看系统安装的中文字体.

例子: mathexample.tex,  使用 LaTeX 编译

源文件:

\documentclass{article}
\begin{document}
Let $H$ be a Hilbert space, $C$ a closed bounded
conver subset of $H$, $T$ is nonexpansive self map
of $C$. Suppose that as $n\to\infty$, $a_{n,k}\to0$
for each $k$, and $\gamma_n=
\sum_{k=0}^\infty(a_{n,k+1}-a_{n,k})^+\to0$.
Then for each $x$ in $C$, $A_nx=\sum_{k=0}^\infty
a_{n,k}T^kx$ converges weakly to a fixed point of $T$.

$$\lim_{n\to\infty}x_n\  {\rm\exists}\iff
\limsup_{n\to\infty}x_n=\liminf_{n\to\infty}x_n.$$
\end{document}



管理宏包

  1. $sudo tlmgr --gui
复制代码

The Comprehensive TeX Archive Network (CTAN) 镜像



进一步学习:


常用网站:


两个 TeX 宏例子
第一个例子是重复某句话, 第二个例子是输入前20个素数.
http://latex.yo2.cn/articles/tex-macro-examples.html

管理:

  1. $sudo tlmgr --gui
复制代码

确保已经安装: collection-langcjk, collection-xetex, ctex, xecjk

LaTeX 的中文支持

  • CCT, 天元TeX
  • CJK
  • XeTeX XeLaTeX
  • ctex, xeCJK 宏包



例子: helloword.tex, 使用 XeLaTeX 编译.

\documentclass{article}
\usepackage{fontspec}
\XeTeXlinebreaklocale "zh" % 针对中文进行断行
\setmainfont{WenQuanYi Zen Hei}
\begin{document}
Hello world! I am using \TeX.

大家好! 我在使用 \TeX.
\end{document}



提示: 使用

  1. $fc-list :lang=zh-cn
复制代码

查看系统安装的中文字体.

http://wiki.ubuntu.org.cn/免费中文字体

例子: ctex.tex 使用 XeLaTeX 编译.

\documentclass[UTF8,nofonts]{ctexart}
\setCJKmainfont{WenQuanYi Zen Hei}
\begin{document}
Hello world! I am using \TeX.

大家好! 我在使用 \TeX.

\zihao{1} 一号字体: \TeX 是一种排版工具

\end{document}



更多的配置请见 ctex.pdf 和 xeCJK.pdf

Adobe 字体

AdobeSongStd-Light.otf
AdobeFangsongStd-Regular.otf
AdobeHeitiStd-Regular.otf
AdobeKaitiStd-Regular.otf

下载: Adobe Reader 9.1 Font Packs - Chinese Simplified
里面有宋体和黑体.

  1. $sudo mkdir /usr/share/fonts/adobe
复制代码

把otf字体文件复制到 /usr/share/fonts/adobe

  1. $sudo cp Adobe*.otf /usr/share/fonts/adobe/
复制代码
  1. $sudo fc-cache -fsv
复制代码
  1. $ fc-list | grep Adobe
复制代码

例子: adobefont.tex, 使用 XeLaTeX 编译.

\documentclass[UTF8,adobefonts]{ctexart}
\begin{document}
默认字体 default fonts \TeX 是一种排版工具 \\
{\bfseries 粗体 bold  \TeX 是一种排版工具}\\
{\songti 宋体  songti \TeX 是一种排版工具}\\
{\heiti 黑体  heiti \TeX 是一种排版工具}\\
{\kaishu 楷书  kaishu \TeX 是一种排版工具}\\
{\fangsong 仿宋  fangsong \TeX 是一种排版工具}\\
\end{document}



安装 CJK 字体 uming ukai

  1. $wget ftp://cle.linux.org.tw/pub2/tex/cjk/fonts/nsungt1/nsungt1-1.4.2.tar.gz
  2. $wget ftp://cle.linux.org.tw/pub2/tex/cjk/fonts/nkait1/nkait1-1.4.2.tar.gz
  3. $tar -jxvf  nsungt1-1.4.2.tar.gz
  4. $tar -jxvf nkait1-1.4.2.tar.gz
  5. $./nsungt1-1.4.2/install.sh
  6. $./nkait1-1.4.2/install.sh
复制代码

注意: 普通用户安装, 而不是使用 root 用户安装.

例子: nsung.tex,  使用 pdflatex 编译

\documentclass[12pt,a4paper]{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{nsung}
\section{New Sung 新宋字型 \LaTeX\ CJK 測試}
晉太元中,武陵人,捕魚為業,緣溪行,忘路之遠近;忽逢桃
花林,夾岸數百步,中無雜樹,芳草鮮美,落英繽紛,漁人甚
異之。復前行,欲窮其林。林盡水源,便得一山。山有小口,
彷彿若有光,便捨船,從口入。
. . . . . .碁嫺。凃凉双崐喆峯酶酞肽脲腚釟迌堃韮。
角觸過骨。許功蓋測試。这里是简体字。许功盖测试。
這裡是日文:こんにちは 世界。
\end{CJK}
\end{document}



例子: nkai.tex,  使用 pdflatex 编译

\documentclass[12pt,a4paper]{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{nkai}
\section{New Kai 新中楷字型 \LaTeX\ CJK測試}
晉太元中,武陵人,捕魚為業,緣溪行,忘路之遠近;忽逢桃
花林,夾岸數百步,中無雜樹,芳草鮮美,落英繽紛,漁人甚
異之。復前行,欲窮其林。林盡水源,便得一山。山有小口,
彷彿若有光,便捨船,從口入。
. . . . . .碁嫺。凃凉双崐喆峯酶酞肽脲腚釟迌堃韮。
角觸過骨。許功蓋測試。这里是简体字。许功盖测试。
這裡是日文:こんにちは 世界。
\end{CJK}
\end{document}



注: nsung.tex, nkai.tex 根据 nsungt1-1.4.2/test 和 nkait1-1.4.2/test 中例子改编.

posted @ 2013-09-23 17:18  latyas  阅读(588)  评论(0编辑  收藏  举报