LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3134|回复: 13

LaTeX介绍

[复制链接]
发表于 2003-2-14 20:31:31 | 显示全部楼层 |阅读模式
废话不多说。看看我写的范例(当英文作业):

\documentclass{book}
\date{2003/2/1}
\title{\TeX{}\footnote{Also TeX or $\tau\varepsilon\chi$}, Beginner's Guide}
\author{Sandy Gong}
\begin{document}
\maketitle
\tableofcontents
\frontmatter
\chapter{This Book is Presented to:}
My English Teacher as my homework
\mainmatter
\chapter{Why Use \TeX{}?}
\section{What is \TeX{}?}
Technology? Technician? Their names are beginning with
phrase ``tech''(in greek they are $\tau{}\epsilon{}\chi{}$).\\
\TeX, as the capital form of $\tau{}\epsilon{}\chi{}$, of course,
is a high-$\tau{}\epsilon{}\chi{}$ text formating system.
\subsection*{How to pronounce \TeX{}}
Is it pronounced as ``TECKS''?\\
No. $\tau{}$ and $\epsilon{}$ \emph{are} pronounced as ``te''.
But the ``X'' do \emph{not} stand for English \sf{}``ex''
\rm but the Greek letter $\chi{}$ pronounced as ``ch'' in ``loch''
\section{Is \TeX{} \tt{}WYSIWYG\rm{}?}
No. \TeX is WYTIWYG(``what you think is what you get'').
It is \sc{}automatic\rm{}.
It has more privileges than WYSIWYG doc-system
for example \emph{Microsoft Word}.
\chapter{\TeX: The Beginning}
\section{Linefeeds and Quotemarks}
\subsection{Quotemarks}
To get double-quotemark as \\
``Yes''\\
you should type:
\begin{verbatim}
``Yes''
\end{verbatim}
But for a good TeX-supported editor like \tt{}emacs\rm{}
, you just need to type \fbox{Shift}+\fbox{''/'}.
\subsection{Math Mode}
Want to get Math in TeX?
Yes.
For example:\\
$f(a)\approx{}\vec{a}\cdot{}\alpha{}-c^2\pm{}\sin{}\theta{}$\\
You should type:
\begin{verbatim}
$f(a)\approx{}\vec{a}\cdot{}\alpha{}-c^2\pm{}\sin{}\theta{}$
\end{verbatim}
Now let's have it explained:\\
\verb=$= means the delimiter of math mode\\
\verb=\approx{}= is the ``yu\={e}d\v{e}ngh\`{a}o''(approximately equal sign)\\
\verb=\vec{a}= means add a vector sign on \emph{a}\\
\verb=\cdot{}= is the multiplication\\
And more you can read \emph{The \TeX{}book}! or \emph{\LaTeX Command
Summary}
\subsection{Linefeeds and Comments}
Want linefeeds(the recarrige of lines)?
So you want to type:
\begin{verbatim}
Line 1
Line 2
\end{verbatim}
But the output is:\\
Line 1
Line 2\\
O,o! Why? Because TeX ignores LFs and replaced it as \verb=Line1 Line2=.
In fact, you need to type:
\begin{verbatim}
Line1\\Line2
OR:
Line1\\
Line2
\end{verbatim}
Yeah! We needn't to type a long line.
For example, me, I like to have every sentence a line.
\subsubsection*{Comments}
Comments? Just in programming language? No!!!
For example:
\begin{verbatim}
i18n means intern%The meaning of i18n
ationalization
\end{verbatim}
Output:
i18n means intern%The meaning of i18n
ationalization\\
\tt{}\%\rm{} means the symbol of comment.
Now you know a method to let TeX ignore your LF.
\subsection*{Compile your \TeX{}File}
Save. And invoke \fbox{\tt{}tex \emph{yourfile}.tex\rm{}}\\
Then invoke \fbox{\tt{}xdvi \emph{yourfile}.dvi\rm{}}
\end{document}

编译以后是入门啦。
发表于 2003-2-15 09:32:12 | 显示全部楼层
看起来有点象 rtf 格式的东西.
 楼主| 发表于 2003-2-15 13:53:30 | 显示全部楼层
跟RTF完全不同
看一个简单的例子(% is comment)

\documentclass{book} %定义为一本书
\title{Biao ti}
\author{Sandy, LinuxSir}
\begin{document} %开始啦
\maketitle %标题页
\tableofcontents %目录,需编译两次
\frontmatter
\chapter{A Simple Chapter} %章
A chapter\\ %\\表换行
New line
\section{A Simple Section} %节
A section
\subsection*{Penguins: Do they get angry?} %小节
If your home was so cold.
%TeX忽略换行
Wouldn't you be angry?
\end{document}%完了

需编译两次for the toc
发表于 2003-5-8 19:47:40 | 显示全部楼层
\documentclass{article}
\usepackage{CJK}
\usepackage[english]{babel}
\title{学习笔记}
\author{wide288}
    \begin{document}
    \begin{CJK*}{GBK}{song}
\maketitle
\chapter{shell 语法}
\section{新的开始}
新的一天开始了,为什么想起来要学 Linux 呢?只是想学学新东西。很好的回答。
\subsection*{准备什么}
看些安装方面的资料吧。如:怎样安装 redhat8.0 或 redhat9.0 或 debian 。Linux有很多的发行版。看看她们的安装说明吧。其中 redhat 9.0 有官方的中文安装说明书。是个很好的入门资料。

安装前要知道,她有几种安装方法。一般常用的有三种,网络安装、硬盘安装、光盘安装。其中我的 redhat8.0 就是通过光盘来安装的,而 debian 是软盘和网络来安装的。你想怎样安装呢?不过在你安装你所想装的发行版前要了解一下她都支持那种安装方式,如红旗公司的发行版就不支持硬盘安装(3.2版以前,含此版)。

在安装的过程中是一定会要求你分区的,这时你可能从来没有学过硬盘的知识,就是硬盘实际上只有四个分区可用,而你会问那我的硬盘怎么分成的五个分区。其实那是第四个分区分成的扩展分区中创建的逻辑分区,它可分许多的逻辑分区。
\subsection*{安装吧}
    \end{CJK*}
    \end{document}
---------------------------------------------------------------------------------------
你说我写的那有错呀,你运行latex name.tex
就在?号那停住,回车后才继续运行
这还不算,我再xdvi name.dvi
就是一大堆的信息,出几次后,再用xdvi name.dvi就没问题了。可以直接运行 了。
发表于 2003-5-8 22:27:35 | 显示全部楼层

我的中文支持总是搞不好。

唉,只能用它来写公式。
发表于 2003-5-9 02:55:32 | 显示全部楼层
我问一下CJK后面的*什么意思
我没有加好象也可以 你看看有没有什么警告?
估计是版面排的不对吧
发表于 2003-5-9 11:07:56 | 显示全部楼层
$ latex me-002.tex
This is TeX, Version 3.14159 (Web2C 7.3.1)
(me-002.tex
LaTeX2e <2000/06/01>
Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, i
talian, nohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2000/05/19 v1.4b Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/local/share/texmf/tex/latex/CJK/CJK.sty
(/usr/local/share/texmf/tex/latex/CJK/mule/MULEenc.sty)
(/usr/local/share/texmf/tex/latex/CJK/CJK.enc))
(/usr/share/texmf/tex/generic/babel/babel.sty
(/usr/share/texmf/tex/generic/babel/english.ldf
(/usr/share/texmf/tex/generic/babel/babel.def)))
No file me-002.aux.
(/usr/local/share/texmf/tex/latex/CJK/standard.bdg)
(/usr/local/share/texmf/tex/latex/CJK/extended.enc)
(/usr/local/share/texmf/tex/latex/CJK/extended.chr)
! Undefined control sequence.
l.9 \chapter
            {shell ^^d3^^ef^^b7^^a8}
?

------------------------------------------------------------
我去掉了*号,还是到这里停住了。
按下回车就行了
---------------------------------------------------------------
(/usr/local/share/texmf/tex/latex/CJK/GB/c19song.fd) [1] (me-002.aux) )
Output written on me-002.dvi (1 page, 3772 bytes).
Transcript written on me-002.log.
[mystery@vhb temp-1]$
------------------------------------------------------------
不过,标题“学习笔记”四字没有在.dvi文件中显示出来。
发表于 2003-5-9 13:04:32 | 显示全部楼层
不用了,我解决了,用kile
发表于 2003-5-9 13:15:14 | 显示全部楼层
kile不过是Tex的一个前端工具而已啊
问一个问题我的Texmacs自己编译的 不能输入中文怎么办?谁有着方面的经验
 楼主| 发表于 2004-5-30 22:10:55 | 显示全部楼层
TMacs本来就不支持中文,author还以为CJK是right-to-left语言
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表