跳至主要内容

Latex学习手记之一:Hello, world!

今天安装了CTEX,开始学习用Latex写文档。我们组的人一般是用scientific workplace的。但是我不太喜欢那个东西,搞得像word一样。所以决定用ctex。这是第一篇手记。一般介绍某种编程语言的书都喜欢用“Hello,world”作为第一个例子,所以这篇的名字就叫做Hello, World了。

下面是一个例子,来自ctex论坛上的视频。

\documentclass{article}
\usepackage{amsmath}
\usepackage{indentfirst}
\begin{document}

\title{My Masterpiece}
\author{Helin Gai}
\date{}
\maketitle


\tableofcontents
\section{WinEdt}
Microsoft Word is a word processor, and it is not suitable for
serious typesetting.

Duke University is one of the most renowned institutions in the US.

\section{Math}

$a^2+b^2=c^2$

\end{document}


注释:
\usepackage{indentfirst} 使用这个package使得每个section首段的首行缩进。否则每个section首段不缩进,从第二段开始首行缩进。

\date{} 该命令阻止Latex生产日期。去掉该命令,Latex将自动生成日期。

评论

此博客中的热门博文

I want to learn Emacs

I'm using crimson editor, a good text editor from Korea. It has worked very well for me till now, but it has not been updated since 2004 and recently I found some features that crimson editor does not have,such as code folding, really useful. So I want to switch to a powerful, up-to-date, extendable and cross-platform editor. Between vi and Emacs, I chose the later one. Emacs is not easy to learn, so I just want to learn some basic features firstly. 1. Switch between buffers, buffer and minibuffer, and modes. One does not need to change into a special mode to input the content in Emacs (This is one reason why I did not choose vi), but Emacs does have a minibuffer to take some complected commands from the user. And in Emacs one can have many buffers and each buffer has a mode (not the same "mode" in vi). So have to learn what they are and how to switch between them. 2. Basic editing, such as creat new, open, save, and close file, copy and paste, search and replace ... 3. F...

闲话

通常我在google上搜索的是,“如何在windows 7下配置ssh”,“vi命令”, 诸如此类的问题。百无聊赖的时候,搜一下“如何才能活得快乐”,这个居然也有答案。 这两天睡的太晚。今天实在挺不住了,回到家先睡了一觉,结果晚上睡不着。喝了点儿酒,还是睡不着。其实也不是为了睡觉才喝酒,就是想喝酒。 现在写着的这支笔,用起来不太舒服。Sailor的pocket pen, 比我另外两支pocket pen还要短1cm。不戴笔帽太短了,戴上笔帽重心太靠后,笔总向上翘,不舒服。想到Ebay上把它卖了,不过在此之前要拍照留念。我现在是不戴笔帽写的。 对,我是在纸上写的,不是在电脑上敲的。有图有真相! 太晚了,还是得去睡觉了。明天早上起来又是一个好人。张爱玲说的。 要是落款的话,现在可以用“醉墨“两个字。 我觉得这笔也没有那么讨厌了。 晚安,再见!