基于Emacs的LaTeX编辑环境
- 格式:pdf
- 大小:450.68 KB
- 文档页数:18
基于Emacs的L A T E X编辑环境Date:2011,5Version:DraftBy:sizikiEmail:siziki@目录目录第1章L A T E X编辑环境选择 (3)第2章环境准备 (4)2.1安装Emacs (4)2.2安装和配置AUCT E X (4)2.2.1关于快捷键 (7)2.2.2关于代码折叠 (8)2.3RefT E X的安装和配置 (9)2.4CDL A T E X安装和配置 (13)2.5yasnippet+auto-complete (15)2.5.1构建L A T E X模版 (16)2.5.2构建自定义环境 (17)2.6关于preview-latex (18)2.7我的el (18)2第1章L A T E X 编辑环境选择第1章L A T E X 编辑环境选择使用L A T E X 编辑文档,有很多软件可以选择,构成不同的编辑环境。
在不同的平台环境下,有不同的选择,比如windows 环境下的WinEdit ,TeXMakerX 等,MacOS 下有TeXShop 等,GNU/Linux 下有kile 。
还有通用的TeXworks 。
这些软件基本都是为L A T E X 编辑而生的。
优点是上手容易、简单易用,当然简单易用的代价就是配置的灵活性不够。
除此以外还有有些通用的编辑环境,通过适当的配置,就可以实现强大的L A T E X 的编辑环境,这种编辑环境的强大程度往往只取决于你的想象力。
本文就是要介绍基于Emacs 的L A T E X 编辑环境。
有几点需要提前说明:1.本文使用L A T E X 发行版是TeXLive2010。
2.本文使用的T E X 引擎是X ET E X ,L A T E X+CJK 的情况不涉及。
3.操作系统环境是Debian GNU/Linux ,不同系统环境下的插件安装不同。
3第2章环境准备第2章环境准备2.1安装Emacs当然首先是要有Emacs,主流的GNU/Linux发行版都可以方便的安装,以Debian为例,$sudo apt-get install emacs裸奔的Emacs是看起来不是那么可爱,需要很多很多的配置,Emacs的功能也取决于你怎么配置它,这里就详细说了。
Emacs-普通人的编辑利器Emacs -普通人的编辑利器2010年11月24日作者: yibie现代生活中,文档越来越重要,电脑已经成为编辑文本最主要的工具,程序员的工作其实就是编辑文档,选择高效的文本工具,自然要考虑程序员用的工具。
而 Emacs 就是一个是适合普通人使用的高效文档编写工具。
谈及Emacs,很多人第一个感觉就是很复杂,随之而来就有一个疑问“很难用的吧?”。
但是,我虽然不是程序员,现在使用Emcas + Org-mode(Emcas 上的插件)的组合,感觉行云流水,毫无碍难。
心中想到,为什么就算是程序员也觉得 Emcas 难用,而我作为一介非程序员却觉得 Emacs 好用呢?我觉得,这不过是以讹传讹罢了。
为什么不是程序员的你也能运用 Emacs?说实在话,就一个普通人而言,在没有接触过 Emacs 之前,是没法想像原来文本可以玩出这么多花样(Vim也很强,不过本文只谈Emacs)。
但是在网上,却有很多人在说 Emacs 难用,不得不说这是对Emacs 的妖魔化。
文本编辑器多种多样,Emacs 作为一个发展的40多年的编辑器,如果它真的要这么差的话,它早就应该成为历史的淘汰者,再不被人提起。
而事实正正相反,Emacs 不但流传广泛,而且还被誉为世界两大编辑器之一,被人称之为“神的编辑器”。
所以,以下的文字算是为 Emacs 辩解,要注意的是本文并没有贬低别的编辑器的意思。
不要妖魔化 Emacs !•妖魔化 Emacs 之①:Emacs 的操作效率不高。
o大多数这么说的人,都是使用 Vim 的程序员。
也就是说,他们的这种评语,是从他们的职业特性出发,他们的判断并没有从其他的职业来出发考虑。
事实上,就算 Emacs 的操作效率再怎么差,比起 Windows 下的记事本/Word 来说,那全键盘的操作下效率还是要高多了。
•妖魔化 Emacs 之②:Emcas 的操作复杂,不易学习。
o Emacs 没有“颠覆”人们的操作习惯,仅仅是增加了一些快捷键,使 Emacs 做到全键盘操作。
latex使用手册LaTeX 使用手册一、LaTeX 简介与安装LaTeX 是一款强大的排版系统,基于TeX 编程语言开发。
它广泛应用于学术论文、书籍、报告等文档的撰写与排版。
安装LaTeX 系统后,用户可以利用各种编辑器(如TeXstudio、TeXworks 等)编写文档,并通过命令行或图形界面进行编译。
二、LaTeX 基本语法与结构1.文档结构:LaTeX 文档由一系列章节组成,每个章节具有独立的标题和内容。
2.标题:使用section、subsection、subsubsection 等命令创建不同级别的标题。
3.段落与换行:使用par 和ewline 命令创建段落和换行。
4.文本格式:使用textbf、textit、textsf 等命令设置文本格式。
三、文本格式与排版1.字体:使用fontfamily 命令选择字体。
2.字号:使用fontsize 命令设置字号。
3.行距:使用linespacing 命令设置行距。
4.间距:使用marginpar 命令设置页面四周的空白。
四、数学公式与符号1.数学公式:使用equation、align 等命令编写数学公式。
2.符号:使用symbol 命令插入特殊符号。
五、表格与图表1.创建表格:使用begin{tabular}、end{tabular} 命令创建表格。
2.修改表格:使用hline、multicolumn 等命令修改表格样式。
3.创建图表:使用begin{figure}、end{figure} 命令创建图表。
4.修改图表:使用caption、label 等命令修改图表属性。
六、目录与参考文献1.目录:使用tableofcontents 命令生成目录。
2.参考文献:使用bibliography 命令管理参考文献。
七、跨章节引用与链接1.交叉引用:使用label 和ef 命令实现章节间的引用。
2.内部链接:使用hyperlink 命令创建内部链接。
LaTex编译器选择及配置指南LaTeX是一种用于排版科技文档的标记语言,广泛应用于学术界和科研领域。
选择适合的LaTeX编译器,并正确配置它们,对于顺利创建和编辑LaTeX文档至关重要。
本指南将向您介绍一些常用的LaTeX编译器,并提供配置建议,以帮助您更好地使用LaTeX进行文档排版。
1. TeX LiveTeX Live是一套完整的LaTeX发布套件,以其跨平台的特性而闻名。
无论您使用的是Windows、Mac还是Linux操作系统,都可以在TeX Live中找到适合您的LaTeX编译器。
TeX Live包含了许多常用的LaTeX工具和宏包,使您能够充分发挥LaTeX的功能。
配置建议:在安装TeX Live时,默认情况下会将所有相关的LaTeX工具和宏包一并安装。
如果您对LaTeX仍然不熟悉,建议保持默认设置。
随着您的使用经验的增加,您可以根据自己的需求选择安装额外的宏包。
2. MiKTeXMiKTeX是另一款广泛使用的LaTeX发行版,特点是在Windows 环境下运行良好。
与TeX Live不同,MiKTeX采用了按需安装的方式,仅在需要时下载和安装所需的宏包和工具。
这使得MiKTeX的安装过程更加轻量级和灵活。
配置建议:在安装MiKTeX时,您可以选择将宏包和工具安装到本地计算机上,也可以选择将它们安装到网络上的共享服务器上。
如果您的计算机空间有限,或者希望与其他用户共享宏包和工具,后一种配置是更好的选择。
3. LyXLyX是一种所见即所得的LaTeX编辑器,提供了一个直观的界面,方便用户编辑和预览LaTeX文档。
与其他LaTeX编译器不同,LyX的主要特点是使用一种所见即所得的编辑方式,使得文档的排版更加直观。
配置建议:安装和配置LyX非常简单。
在安装完成后,您可以通过调整字体、段落和页面设置来个性化您的文档。
此外,您还可以通过为LyX添加LaTeX宏包来扩展其功能。
4. OverleafOverleaf是一种基于云端的LaTeX编辑器,使多人协作变得更加容易。
%% 本论文的排版主要参考了LaTeX2e插图指南(王磊), LaTeX2e用户手册, media的中文学位%% 论文宏包(CDT), happaytex的ORmain1.tex等文件以及ChinaTeX, CTeX论坛上的诸多贴子. %%% 本论文采用了Miktex2.2的方式在ChinaTeX.iso系统下得到了实现,其编译方式为%% latex(得到DVI文件)+dvips(得到PS文件)+ps2pdf(可得PDF文件).%%\documentclass[12pt]{article}%需要的一些宏包\usepackage{CJK} % 中文输入环境宏包\usepackage{titlesec,titletoc} % 配合命令在后面, 章节标题设置\usepackage{indentfirst} % 使首段首行缩进\usepackage{graphicx} % 插图宏包\usepackage{caption2} % 可以更改插图, 表格的标题样式\usepackage{subfigure} % 产生并列的子图或子表, 命令\subfigure, \subtable\usepackage{longtable} % 如果表格太长, 超过了一页时, 就可以试试longtable 宏包所定义的longtable 环境\usepackage{slashbox} % 在表格中绘制斜线\usepackage{fancyhdr} % 更改页眉的宏包, 并可在页眉插入图片\usepackage{times} % Times Roman + Helvetica + Courier\usepackage{amsmath} % 数学符号宏包AMS-LaTeX, 如下面的\overset需要此宏包%页面的设置\special{papersize=21cm,29.7cm} \setlength{\textwidth}{15cm}\setlength{\textheight}{23cm} \setlength{\evensidemargin}{0.46cm}\setlength{\oddsidemargin}{0.46cm} \setlength{\topmargin}{-1.84cm}\setlength{\headheight}{2.9cm} \setlength{\headsep}{0.4cm}%字号设置\newcommand{\chuhao}{\fontsize{42pt}{\baselineskip}\selectfont}\newcommand{\xiaochuhao}{\fontsize{36pt}{\baselineskip}\selectfont}\newcommand{\yihao}{\fontsize{26pt}{\baselineskip}\selectfont}\newcommand{\xiyihao}{\fontsize{24pt}{\baselineskip}\selectfont}\newcommand{\erhao}{\fontsize{22pt}{\baselineskip}\selectfont}\newcommand{\xiaoerhao}{\fontsize{18pt}{\baselineskip}\selectfont}\newcommand{\sanhao}{\fontsize{16pt}{\baselineskip}\selectfont}\newcommand{\xiaosanhao}{\fontsize{15pt}{\baselineskip}\selectfont}\newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont}\newcommand{\xiaosihao}{\fontsize{12pt}{\baselineskip}\selectfont}\newcommand{\wuhao}{\fontsize{10.5pt}{\baselineskip}\selectfont}\newcommand{\xiaowuhao}{\fontsize{9pt}{\baselineskip}\selectfont}\newcommand{\liuhao}{\fontsize{7.5pt}{\baselineskip}\selectfont}\newcommand{\xiaoliuhao}{\fontsize{6.5pt}{\baselineskip}\selectfont}\newcommand{\qihao}{\fontsize{5.5pt}{\baselineskip}\selectfont}\newcommand{\bahao}{\fontsize{5pt}{\baselineskip}\selectfont}%页眉的设置, 要用到fancyhdr宏包\pagestyle{fancy} \fancyhead{} \fancyfoot{}\fancyhead[L]{\footnotesize Team \# 189}\fancyhead[R]{\footnotesize Page\ \thepage\ of\ 42}\fancypagestyle{plain}{%\fancyhead[L]{\footnotesize Team \# 189}\fancyhead[R]{\footnotesize Page\ \thepage\ of\ 42}}\setcounter{secnumdepth}{4}%更改\theparagraph的编号样式\makeatletter\renewcommand{\theparagraph}{\@arabic\c@paragraph}\makeatother%章节格式的设置\titleformat{\section}{\erhao\bf}{}{0em}{}[]\titleformat{\subsection}{\xiaoerhao\bf}{}{0em}{}[]\titleformat{\subsubsection}{\sanhao\bf}{}{0em}{}[]\titleformat{\paragraph}[hang]{\vspace*{0.5ex}\sihao\bf}{\hspace*{1em}\theparagraph)}{0.5em }{}[\vspace*{-0.5ex}]%更改插图的标题\renewcommand{\figurename}{\wuhao\bf\sf Figure}\renewcommand{\captionlabeldelim}{\ }%更改表格的标题\renewcommand{\tablename}{\wuhao\bf\sf Table}%更改图形或表格与其标题的间距\setlength{\abovecaptionskip}{10pt}\setlength{\belowcaptionskip}{10pt}%定义产生不浮动图形和表格的标题的命令\figcaption和\tabcaption\makeatletter\newcommand\figcaption{\def\@captype{figure}\caption}\newcommand\tabcaption{\def\@captype{table}\caption}\makeatother%自定义的可以调整粗细的水平线命令, 用于绘制表格, 调用格式\myhline{0.5mm}. \makeatletter\def\myhline#1{%\noalign{\ifnum0=`}\fi\hrule \@height #1 \futurelet\reserved@a\@xhline}\makeatother%第一层列表序号为带圈的阿拉伯数字\renewcommand{\labelenumi}{\textcircled{\arabic{enumi}}}%更改脚注设置\renewcommand{\thefootnote}{\fnsymbol{footnote}}\begin{document}\begin{CJK*}{GBK}{song}\CJKtilde\title{\bf\yihao Aviation Baggage Screening\\{\&} Flight Schedule}\author{}\date{}\maketitle\section{Introduction}Following the terrorist attacks on September 11, 2001, there isintense interest in improving the security screening process forairline passengers and their baggage. Airlines and airports areconsidered high-threat targets for terrorism, so aviation securityis crucial to the safety of the air-travelling public. Bombs andexplosives have been known to be introduced to aircraft by holdbaggage and cargo, carried on by passengers, and hidden withinaircraft supplies.At present To Screen or Not to Screen, that is a Hobson's choice.US Current laws mandate 100{\%} screening of all checked bags at the 429 passenger airports throughout the nation by explosive detection systems(EDS) by the end of the Dec 31 2003. However, because the manufacturers arenot able to produce the expected number of EDS required to meet the federal mandate, so it is significant to determine the correct number of devicesdeploy at each airport, and to take advantage of them effectively.The Transportation Security Administration (TSA) needs a complicatedanalysis on how to allocate limited device and how to best use them.Our paper contains the mathematical models to determine the number of EDSsand flight schedules for all airports in Midwest Region. We also discuss theETD devices as the additional security measures and the future developmentof the security systems.\section{Assumption and Hypothesis}\begin{itemize}\item The passengers who will get on the same airplane will arrive uniformly, namely the distribution is flat.\item The detection systems, both EDS and ETD, operate all the time during peak hour, except downtime.\item The airline checks the passengers randomly, according to its claim.\item The passengers, who are just landing and leave out, do not have to be checked through EDS or ETD.\item According to the literature, the aircraft loads approximately equal among the sets of departing flight during the peak hour.\item The landing flight did not affect the departure of the plane.\item Once a passenger arrives, he can go to EDS to be checked, except he has to wait in line.\item Once passengers finish screening, they can broad on the plane in no time.\item During peak hours, a set of flights departs at the same time every the same minutes.\item All the runways are used as much as possible during peak hours.\item The maximum number of the baggage is two, which a passenger can carry on plane. []\item The detection machine examines the bags at the same speed.\item EDS cannot make mistakes that it detect a normal object as an explosive.\end{itemize}\section{Variable and Definition}\begin{longtable}{p{100pt}p{280pt}}\caption{Variables}\\ %第一页表头的标题\endfirsthead %第一页的标题结束\caption{(continued)}\\ %第二页的标题\endhead %第二页的标题结束\hline\hline\textbf{Symbol}&\textbf{Description}\\\hline$n_{ij}$&The airplane number of the $i^{\mathrm{th}}$ type in the $j^{\mathrm{th}}$ flight set\\\hline${NP}_i\:(i=1,2,\ldots)$&The number of passengers on each airplanes of the same type.\\\hline$\xi_{ij}\:(i,j = 1,2,\cdots)$&The number of baggage on each airplane of the $j^{\mathrm{th}}$ flights\\\hline$a$&The maximal number of airplanes type\\\hline$B_j^{set}$&The total baggage number of each set of flight\\\hline${NF}_i$&Number of airplanes of each type\\\hline$\bar{\rho}$&The mean value of passengers' baggage coming per minute in every flight set\\ \hline$N_{set}$&The number of flight sets\\\hline$B_{total}$&The total number of checked baggage during the peak hour\\\hline$H_{peak}$&The length of the peak hour\\\hline$T_{set}$&The time length during which each flight set's passengers wait to be checked\\\hline$\Delta t$&The time interval between two consecutive flight set\\\hline$N_{EDS}$&The number of all the EDSs\\\hline$N_{shadow}$&The number of flight sets whose passengers will be mixed up before being checked\\\hline$v_{EDS}$&The number of baggage checking by one EDS per minute\\\hline$\rho_j$&The number of passengers' baggage coming per minute in one flight set\\\hline$N_{runway}$&The number of an airport's runway\\\hline\\*[-2.2ex]${\bar{B}}^{set}$&The mean value of checked baggage number of every flight set\\\hline$M$&The security cost\\\hline\hline\label{tab1}\end{longtable}\subsubsection{Definition:}\begin{description}\item[Flight set] A group of flights take off at the same time\item[The length of peak hour] The time between the first set of flight and the last set\end{description}\section{Basic Model}During a peak hour, many planes and many passengers would departfrom airports. Therefore, It is difficult to arrange for thepassengers to enter airports. If there are not enough EDSs forpassengers' baggage to check, it will take too long time for themto enter. That would result in the delay of airplanes. On thecontrary, if there are too many EDSs, it will be a waste. It isour task to find a suitable number of EDSs for airport. In orderto reach this objective, we use the linear programming method tosolve it.\subsection{Base analysis}The airplanes are occupied at least partly. The passengers'baggage would be checked by EDSs before they get on the airplanes.We have assumed that every passenger carry two baggages. Thisassumption would simplify the problem. According to the data fromthe problem sheet, we can obtain the useful information thatairlines claim 20{\%} of the passengers do not check any luggage,20{\%} check one bag, and the remaining passengers check two bags.Therefore, we can gain the total number of passengers' baggagethat should be carried on one plane: $\xi_{ij}$. Moreover, we canget the equation that calculate $\xi_{ij}$:\[\xi_{ij}={NP}_i\times 20\%+{NP}_i\times 60\%\times 2\]We define the matrix below as airplane baggage number matrix:\[\overset{\rightharpoonup}{\xi}_j=\left[\xi_{1j}\quad\xi_{2j}\quad\cdots\quad\xi_{ij}\quad\cdots\ right]\]We define the matrix below as flight schedule matrix:\[\left[\begin{array}{llcl}n_{11}&n_{12}&\cdots&n_{1N_{set}}\\n_{21}&n_{22}&\cdots&n_{2N_{set}}\\\multicolumn{4}{c}\dotfill\\n_{a1}&n_{a2}&\cdots&n_{aN_{set}}\end{array}\right]\]In this matrix, $n_{ij}$ is the airplane number of the$i^{\mathrm{th}}$ type in the $j^{\mathrm{th}}$ flight set whichwill take off. Apparently, this value is an integer.We define the matrix below as flight set baggage number matrix:\[\left[B_1^{set}\quad B_2^{set}\quad\cdots\quad B_j^{set}\quad\cdots\quad B_a^{set}\right] \]It is clear that they meet the relation below:\begin{equation}\begin{array}{cl}&\left[\xi_{1j}\quad\xi_{2j}\quad\cdots\quad\xi_{ij}\quad\cdots\right]\cdot\left[\begin{array}{llcl}n_{11}&n_{12}&\cdots&n_{1N_{set}}\\n_{21}&n_{22}&\cdots&n_{2N_{set}}\\\multicolumn{4}{c}\dotfill\\n_{a1}&n_{a2}&\cdots&n_{aN_{set}}\end{array}\right]\\=&\left[B_1^{set}\quad B_2^{set}\quad\cdots\quad B_j^{set}\quad\cdots\quad B_a^{set}\right]\end{array}\label{Flight:baggage}\end{equation}Then, we know:\[B_j^{set}=\sum\limits_{i=1}^a\xi_{ij}\times n_{ij}\]There are some constraints to the equation (\ref{Flight:baggage}).First, for each set of flight, the total number of airplanesshould be less than the number of runways. Second, the totalairplane number of the same type listed in the equation(\ref{Flight:baggage}) from every set of flight should be equal tothe actual airplane number of the same type during the peak hour.We can express them like these:\[\sum\limits_{i=1}^a n_{ij}\le N_{runway}\quad\quad\sum\limits_{j=1}^b n_{ij}={NF}_i \]We should resolve the number of flight sets. According to our assumptions,during the peak hour, the airlines should make the best use of the runways.Then get the number of flight sets approximately based on the number of allthe airplanes during the peak hour and that of the runways. We use anequation below to express this relation:\begin{equation}N_{set}=\left\lceil\frac{\sum\limits_{j=1}^{N_{set}}\sum\limits_{i=1}^an_{ij}}{N_{runway}}\right\rceil\label{sets:number}\end{equation}The checked baggage numbers of each flight set are equal to eachother according to our assumption. We make it based on literature.It can also simplify our model. We define $\bar{B}^{set}$ as themean value of checked baggage number of every flight set.Moreover, We define $\bar{\rho}$ as the mean value of checkedbaggage number of every flight set per minute:\[\bar{B}^{set}=\frac{B_{total}}{N_{set}}\]\[\bar{\rho}=\frac{\bar{B}^{set}}{T_{set}}=\frac{B_{total}}{T_{set}N_{set}}=\frac{B_{total}\ Delta t}{T_{set}H_{peak}}\]The course of passengers' arrival and entering airport isimportant for us to decide the number of EDSs and to make theflights schedule. Therefore, we should analyze this processcarefully. Passengers will arrive between forty-five minutes andtwo hours prior to the departure time, and the passengers who willget on the same airplane will arrive uniformly. Then we can getthe flow density of all checked baggage at any time duringpassengers' entering. This value is the sum of numbers ofpassengers' checked baggage coming per minute. To calculate thisvalue, firstly, we should obtain flow density of each flight set'schecked baggage. We define $\rho_j $, namely the number of checkedbaggage per minute of one flight set:\[\rho_j=\frac{B_j^{set}}{T_{set}}\]Secondly, we draw graphic to help us to understand. We userectangle to express the time length for all the passengers of oneflight set to come and check bags. In the graphic, the black partis the period for them to come. During the white part, nopassengers for this flight set come. According to the problemsheet, the former is 75 minute, and the latter is 45 minute. Thelength of rectangle is 120 minute. $T_{set}$ is the period duringwhich all passengers of one flight set wait to be checked. Sincewe have assumed that each time interval between two consecutiveflight set is same value, we define $\Delta t$ as it. Observe thesection that value we want to solve is $\sum\limits_j\rho_j$. Moreover, we can get another important equation from the graphic below:\begin{equation}N_{set}=\frac{H_{peak}}{\Delta t}\label{PeakHour}\end{equation}\begin{figure}[hbtp]\centering\includegraphics[width=298.2pt,totalheight=141.6pt]{fig01.eps}\caption{}\label{fig1}\end{figure}Each EDS has certain capacity. If the number of EDSs is $N_{EDS}$ and one EDS can check certain number of baggage per minute (Thatis checking velocity, marked by $v_{EDS}$), the total checking capacity is $N_{EDS}\cdot\frac{v_{EDS}}{60}$. $v_{EDS}$ is between 160 and 210.Now we can easily decide in what condition the passengers can be checked without delay:\[\sum\limits_j\rho_j\le v_{EDS}\]The passengers have to queue before being checked:$\sum\limits_j\rho_j>v_{EDS}$Well then, how can we decide how many $\rho_j$? It depends on how many flight sets whose passengers will be mixed up before being checked. We note it as $N_{shadow} $. Return to the Figure\ref{fig1}, we can know:\[N_{shadow}=\left\lfloor\frac{T_{set}}{\Delta t}\right\rfloor\]\begin{figure}%[htbp]\centering\includegraphics[width=240pt,totalheight=131.4pt]{fig02.eps}\caption{}\label{fig2}\end{figure}From Figure \ref{fig1} and Figure \ref{fig2}, we can get theresult as follows:\begin{enumerate}\item If $N_{shadow}\le N_{set}$, namely $H_{peak}>T_{set}$, then $\sum\limits_{j=1}^{N_{shadow}}\rho _j\le N_{EDS}\frac{v_{EDS}}{60}$\renewcommand{\theequation}{\arabic{equation}a}That is:\begin{equation}N_{EDS}\ge\frac{60}{v_{EDS}}\sum\limits_{j=1}^{N_{shadow}}\rho_j\approx\frac{60}{v_{ EDS}}N_{shadow}\bar{\rho}=\frac{60B_{total}\Deltat}{v_{EDS}T_{set}H_{peak}}N_{shadow}\label{EDS:number:a}\end{equation}\item If $N_{shadow}>N_{set}$, namely $H_{peak}\le T_{set}$, then $\sum\limits_{j=1}^{N_{set}}\rho_j\le N_{EDS}\frac{v_{EDS}}{60}$\setcounter{equation}{3}\renewcommand{\theequation}{\arabic{equation}b}That is:\begin{equation}N_{EDS}\ge\frac{60}{v_{EDS}}\sum\limits_{j=1}^{N_{set}}\rho_j\approx\frac{60}{v_{EDS} }N_{set}\bar{\rho}=\frac{60B_{total}\Delta t}{v_{EDS}T_{set}H_{peak}}N_{set}\label{EDS:number:b}\end{equation}\end{enumerate}\subsection{The number of EDSs}Then we begin to resolve the number of EDSs assisted by the linearprogramming method.EDS is operational about 92{\%} of the time. That is to say, whenever it isduring a peak hour, there are some EDSs stopping working. Then the workingefficiency of all the EDSs is less than the level we have expected.Therefore, the airline has to add more EDSs to do the work, which can bedone with less EDSs without downtime.We use binomial distribution to solve this problem. $N$ is the number ofactual EDSs with downtime and $k$ is the number of EDSs without downtime. Ifprobability is $P$, we can get the equation below:\[\left(\begin{array}{c}N\\k\end{array}\right)\cdot98\%^k\cdot(1-98\%)^{N-k}=P\]We can obtain $N$ when we give $P$ a certain value. In this paper,$P$ is 95{\%}. The $N_{EDS}$ is the actual number we obtainthrough the equation above.Now we have assumed that passengers can be checked unless be delayed by the people before him once he arrives at airport. Apparently, if the time length between two sets of flight is short, the density of passengers will begreat. It will bring great stress to security check and may even make some passengers miss their flight. To resolve this question, the airline has toinstall more EDSs to meet the demand. However, this measure will cost much more money. Consequently, we have to set a suitable time interval between two set of flight.Based on the base analysis above. We can use the equation(\ref{sets:number}) to decide the number of flight sets $N_{set}$assuming we know the number of runways of a certain airport. Thenbased on the equation (\ref{PeakHour}), we can decide the peakhour length $H_{peak}$ when we assume a time interval between two consecutive flight sets. Then we use \textcircled{1} and\textcircled{2} to decide which to choose between equation(\ref{EDS:number:a}) and equation (\ref{EDS:number:b}). In consequence, we can obtain the minimum of EDSs number.If we choose different numbers of runways and the time intervalsbetween two flight sets, we can get different EDSs numbers. Inthis paper that followed, we gain a table of some value of$N_{runway}$ and $\Delta t$ with the corresponding EDSs numbers. Moreover, we draw some figure to reflect their relation.For a certain airport, its number of runway is known. Givencertain time interval ($\Delta t$), we can get the length of thepeak hour ($H_{peak}$). When the $N_{runway}$ is few enough,perhaps $H_{peak}$ is too long to be adopted. However, for acertain airline, they can decide the time interval of their ownpeak hour. In this given time interval, they could find theminimum of $N_{runway}$ through the Figure \ref{fig3}. We draw asketch map to describe our steps.\begin{figure}[hbtp]\centering\includegraphics[width=352.8pt,totalheight=214.2pt]{fig03.eps}\caption{}\label{fig3}\end{figure}\subsection{The Flight Schedule }According to the base analysis, we can know that the flightschedule matrix and $\Delta t$ is one form of flight timetable. In``The number of EDSs'', we can get suitable $\Delta t$. Then weshould resolve the flight schedule matrix.Because we have assumed that the checked baggage numbers of each flight setare equal to each other. It can be described as follows:\[\left\{\begin{array}{l}\rho_j\approx\bar{\rho}\\B_j^{set}\approx\bar{B}^{set}\end{array}\right.\begin{array}{*{20}c}\hfill&{j=1,2,\cdots,N_{set}}\hfill\end{array}\]The flight schedule matrix subject to this group:\[\left\{\begin{array}{ll}\sum\limits_{j=1}^{N_{set}}n_{ij}={NF}_i&i=1,2,\cdots\\\sum\limits_{i=1}^a n_{ij}\le N_{runway}&j=1,2,\cdots,N_{set}\\n_{ij}\ge0,&\mathrm{and}\:n_{ij}\:\mathrm{is}\:\mathrm{a}\:\mathrm{Integer} \end{array}\right.\]In order to make the best use of runway, we should make$\sum\limits_{i=1}^a n_{ij}$ as great as we can unless it exceed$N_{runway}$.Then we can see that how to resolve the flight schedule matrix is a problemof divide among a group of integers. This group is all the numbers of eachflight passengers' baggage in one flight set. We program for this problemusing MA TLAB and we get at least one solution in the end. However, thematrix elements we have obtained are not integer, we have to adjust them tobe integers manually.\subsection{Results and Interpretation for Airport A and B}The number of passengers in a certain flight (${NP}_i$), the timelength of security checking ($T_{set}$), the checking velocity ofEDS ($v_{EDS}$), and the number of baggage carried by onepassenger are random.\subsubsection{Data Assumption:}\begin{itemize}\item $T_{set}$ is 110 minutes, which is reasonable for airline.\item To simplify the problem, we assume that every passenger carry 2 baggage. If some of thepassengers carry one baggage, the solution based on 2 baggages per passenger meets therequirement.\item The number of runways in airport A and airport B is 5.\end{itemize}\subsubsection{Airport A:}Once the number of runway and the number of the flights aredecided, the flight schedule matrix is decided, too. We producethis matrix using MATLAB. This matrix companied by $\Delta t$ isthe flight schedule for airport A. $\Delta t$ will be calculatedin (\ref{Flight:baggage}), (\ref{sets:number}) and(\ref{PeakHour}).We calculate $N_{EDS}$ and make the flight timetable in threeconditions. The three conditions and the solution are listed asfollowed:\paragraph{Every flight are fully occupied}The checking speed of EDS is 160 bags/hour.\begin{table}[htbp]\centering\caption{}\begin{tabular}{*{11}c}\myhline{0.4mm}$\mathbf{\Deltat(\min)}$&\textbf{2}&\textbf{4}&\textbf{6}&\textbf{8}&\textbf{10}&\textbf{12}&\textbf{14} &\textbf{16}&\textbf{18}&\textbf{20}\\\myhline{0.4mm}$N_{EDS}(\ge)$&31&31&31&31&31&29&24&22&20&17\\\hline$H_{peak}(\min)$&20&40&60&80&100&120&140&160&180&200\\\myhline{0.4mm}\end{tabular}\label{tab2}\end{table}We assume that the suitable value of $H_{peak}$ is 120 minutes.Then the suitable value of $\Delta t$ is about 12 minutes, and$N_{EDS}$ is 29 judged from Figure \ref{fig4}. Certainly, we canwork $\Delta t$ and $N_{EDS}$ out through equation.\begin{figure}[htbp]\centering\includegraphics[width=294.6pt,totalheight=253.2pt]{fig04.eps}\caption{}\label{fig4}\end{figure}\paragraph{Every flight is occupied by the minimal number of passengers onstatistics in the long run.}The checking speed of EDS is 210 bags/hour.\begin{table}[htbp]\centering\caption{}\begin{tabular}{*{11}c}\myhline{0.4mm}$\mathbf{\Deltat(\min)}$&\textbf{2}&\textbf{4}&\textbf{6}&\textbf{8}&\textbf{10}&\textbf{12}&\textbf{14} &\textbf{16}&\textbf{18}&\textbf{20}\\\myhline{0.4mm}$N_{EDS}(\ge)$&15&15&15&15&15&14&13&12&10&7\\\hline$H_{peak}(\min)$&20&40&60&80&100&120&140&160&180&200\\\myhline{0.4mm}\end{tabular}\label{tab3}\end{table}We assume that the suitable value of $H_{peak}$ is 120 minutes.Then the suitable value of $\Delta t$ is about 12 minutes, and$N_{EDS}$ is 14 judging from Figure \ref{fig5}. Certainly, we canwork $\Delta t$ and $N_{EDS}$ out through equation.\begin{figure}[htbp]\centering\includegraphics[width=294.6pt,totalheight=253.2pt]{fig05.eps}\caption{}\label{fig5}\end{figure}\paragraph{${NP}_i$ and $v_{EDS}$ are random value produced by MATLAB.}\begin{table}[htbp]\centering\caption{}\begin{tabular}{*{11}c}\myhline{0.4mm}$\mathbf{\Deltat(\min)}$&\textbf{2}&\textbf{4}&\textbf{6}&\textbf{8}&\textbf{10}&\textbf{12}&\textbf{14} &\textbf{16}&\textbf{18}&\textbf{20}\\\myhline{0.4mm}$N_{EDS}(\ge)$&15&22&21&21&15&17&21&16&13&14\\\hline$H_{peak}(\min)$&20&40&60&80&100&120&140&160&180&200\\\myhline{0.4mm}\end{tabular}\label{tab4}\end{table}We assume that the suitable value of $H_{peak}$ is 120 minutes.Then the suitable value of $\Delta t$ is about 12 minutes, and$N_{EDS}$ is 17 judging from Figure \ref{fig6}. Certainly, we canwork $\Delta t$ and $N_{EDS}$ out through equation.\begin{figure}[htbp]\centering\includegraphics[width=294.6pt,totalheight=249.6pt]{fig06.eps}\caption{}\label{fig6}\end{figure}\subsubsection{Interpretation:}By analyzing the results above, we can conclude that when$N_{EDS}$ is 29, and $\Delta t$ is 12, the flight schedule willmeet requirement at any time. The flight schedule is:\\[\intextsep]\begin{minipage}{\textwidth}\centering\tabcaption{}\begin{tabular}{c|*{8}c|c|c}\myhline{0.4mm}\backslashbox{\textbf{Set}}{\textbf{Type}}&\textbf{1}&\textbf{2}&\textbf{3}&\textbf{4}&\te xtbf{5}&\textbf{6}&\textbf{7}&\textbf{8}&\textbf{Numbers of Bags}&\textbf{Numbers of Flights}\\\myhline{0.4mm}1&2&0&0&0&2&1&0&0&766&5\\\hline2&2&0&2&0&2&0&0&0&732&4\\\hline3&0&1&1&1&2&0&0&0&762&4\\\hline4&0&1&0&0&2&1&0&0&735&4\\\hline5&0&1&0&0&2&1&0&0&735&5\\\hline6&2&0&0&0&1&0&0&1&785&5\\\hline7&2&0&0&0&2&0&1&0&795&5\\\hline8&0&1&0&0&2&1&0&0&735&4\\\hline9&2&0&0&0&2&1&0&0&766&5\\\hline10&0&0&0&2&2&0&0&0&758&5\\\hlineTotal&10&4&3&3&19&5&1&1&7569&46\\\myhline{0.4mm}\end{tabular}\label{tab5}\end{minipage}\\[\intextsep]We have produced random value for ${NP}_i$ and $v_{EDS}$. On thiscondition, the number of EDSs is 17, which is less than 29 that wedecide for the airport A. That is to say our solution can meet thereal requirement.\subsubsection{Airport B:}\paragraph{The passenger load is 100{\%}}The checking speed of EDS is 160 bags/hour.\begin{table}[htbp]\centering。
[程序员小助手] Emacs,最强编辑器,没有之一[程序员小助手] Emacs,最强编辑器,没有之一程序员联盟2015-06-04 00:18内容简介1、Emacs简介2、Emacs三个平台的安装与配置3、自动补全插件4、小编的Emacs配置文件5、常用快捷方式6、和版本控制系统的配合(以SVN为例)【程序员小助手】系列在这个系列文章中(不定期更新),小编会把这些年(也没几年)的编程学习和工作中使用到的个人感觉非常好的软件推荐给大家,希望能够共享美好资源,使大家提高编程和办事效率。
Emacs,最强编辑器,没有之一小编知道,此标题一出,肯定会遭受广大群众“诟病”,说不好还会被其他编辑器的粉丝暗地里“干掉”。
比如,Vim 编辑器的粉丝可能就会来“踢馆”,VS或Eclipse的粉丝也兴许会“群起而攻”,但是小编只是表达一下自己的感受,请拍砖的时候轻一点,鸡蛋少扔几个,如果扔的鸡蛋多也请多扔几个番茄过来,这样我可以做番茄炒蛋,谢谢。
对于很多人来说,使用Vim和Emacs,不仅是提升“逼格”的方式,更是上升到“信仰”的层面,夸张吧。
当然这和宗教信仰不一样,只是一种可爱的“偏执”而已。
Emacs实在能做很多事,不要认为它就只是一个文本编辑器,它可以说是一个整合环境,或可称它为“集成开发环境”,它还可以做以下事情:上网,浏览网页看视频收发邮件调试程序,结合GDB,EDebug等。
支持C/C++,Perl,Python,Lisp等等玩游戏计算器记日记管理日程,Task,ToDo,约会等个人信息管理目录管理文件比较阅读info和man文档等等小编以前在Linux 下编写代码是使用Vim编辑器的,也非常强大,但是自从2014年接触到Emacs之后,就爱上了Emacs(fall in love with Emacs),Vim虽然有时还会用到,但是大部分时间编写代码还是用的Emacs。
一开始我不知道为什么Emacs如此优美又强大,直到后来阅读了《黑客与画家》这部经典著作(硅谷创业教父Paul Graham 保罗·格雷厄姆所写,其实也就是他的一些日志汇编而成),里面讲述了Lisp语言的强大和优美,而Emacs就是用Lisp语言编写的,怪不得。
latex 使用方法LaTeX 使用方法LaTeX是一种专业的排版系统,用于生成高质量的科技和数学文档。
本文将介绍LaTeX的使用方法,包括安装、编辑、编译和生成文档等方面。
一、安装LaTeX要使用LaTeX,首先需要安装TeX发行版,例如TeX Live或MiKTeX。
这些发行版提供了LaTeX的核心程序和必要的宏包。
在安装过程中,可以选择安装其他相关工具和编辑器。
二、编辑LaTeX文档LaTeX文档是以.tex为扩展名的纯文本文件。
可以使用任何文本编辑器来编辑LaTeX文档,例如Notepad++、Sublime Text或TeXworks等。
LaTeX文档由预定义的命令和普通文本组成。
命令通常以反斜杠(\)开头,后跟命令名和参数。
例如,\section{Introduction}表示一个章节标题。
三、编译LaTeX文档完成编辑后,需要将LaTeX文档编译为可阅读的PDF、DVI或PS格式。
编译过程通常包括多个步骤,例如生成辅助文件、解析源代码和生成目标文件等。
LaTeX提供了许多编译工具,例如pdflatex、xelatex和lualatex 等。
选择合适的编译器并执行编译命令,即可生成最终的文档。
四、生成文档编译成功后,可以在输出目录中找到生成的文档文件。
使用PDF阅读器打开PDF文件,即可查看最终结果。
可以通过打印或分享文档来传播自己的作品。
除了生成PDF文件,LaTeX还支持生成其他格式的文档,例如HTML、EPUB和Beamer等。
根据需要选择合适的输出格式。
五、高级技巧LaTeX提供了许多高级功能和技巧,可以帮助用户更好地排版文档。
以下是一些常用的技巧:1. 使用宏包:LaTeX提供了丰富的宏包,可以扩展其功能。
可以根据需要引入不同的宏包,例如graphicx用于插入图片,amsmath用于数学公式等。
2. 定制样式:LaTeX允许用户自定义文档的样式和布局。
可以通过定义新的命令、环境和页面设置来实现样式定制。
emacs高级用法一、Emacs基本用法1. Emacs is a super - powerful text editor. I can just open it up and start typing away like I'm pouring my thoughts onto a digital canvas. For example, if I want to write a simple note, I open Emacs, and it's like stepping into a blank room where I can arrange my words however I like. “Emacs就像一个超级强大的文本编辑器。
我只要打开它就可以开始输入,就好像把我的想法倾倒在数字画布上一样。
例如,如果我想写一个简单的便签,我打开Emacs,这就像是走进一个空白的房间,我可以随心所欲地排列我的文字。
”2. One of the basic things in Emacs is moving around. I use the arrow keys, but there are also these cool shortcuts. It's like having a secret passageway in a maze. For instance, Ctrl - f moves the cursor forward one character. “Emacs的基本操作之一就是移动光标。
我可以使用方向键,但也有一些很酷的快捷键。
这就像是在迷宫里有一条秘密通道。
例如,Ctrl - f可以将光标向前移动一个字符。
”3. Saving a file in Emacs is a piece of cake. I just hit Ctrl - x Ctrl - s. It's as easy as closing a box after you put something in it. “在Emacs 中保存文件很容易。
Emacs编辑器基础教学第一章:什么是Emacs编辑器Emacs编辑器是一个功能强大的文本编辑器,广泛应用于编程、文档写作和其他各种计算机任务中。
Emacs自由软件基金会开发并于1976年首次发布。
Emacs编辑器的最大特点是高度可定制性和可扩展性,用户可以通过自定义配置文件来满足自己的需求。
第二章:Emacs编辑器的安装和介绍2.1 安装Emacs安装Emacs可以通过源代码或者预编译的二进制文件进行。
在Linux环境下,可以使用包管理器直接安装Emacs。
在Windows环境下,可以从Emacs官方网站上下载安装包进行安装。
2.2 用户界面介绍Emacs编辑器启动后,可以看到一个分为多个窗口的界面。
主要包括菜单栏、工具栏、编辑区域和模式栏。
编辑区域是用户编写代码或者文档的主要区域,模式栏显示当前模式或者特殊功能的状态。
第三章:Emacs编辑器的基本操作3.1 打开和保存文件通过菜单栏或者快捷键组合可以打开和保存文件。
用户可以使用Emacs编辑器打开文本文件、代码文件、各种配置文件等。
保存文件可以使用快捷键组合,也可以通过菜单栏中的保存选项实现。
3.2 基本文本编辑操作Emacs编辑器提供了丰富的基本文本编辑操作,包括复制、剪切、粘贴、撤销和重做等。
这些操作可以通过快捷键组合来实现,也可以通过菜单栏中的选项实现。
3.3 光标移动和选择文本在Emacs编辑器中,可以使用快捷键组合来移动光标的位置,如向上、向下、向左、向右等。
选择文本可以通过按住Shift键并移动光标来实现。
选中的文本可以进行复制、剪切和粘贴等操作。
第四章:Emacs编辑器的高级功能4.1 宏录制和执行Emacs编辑器提供了宏录制和执行功能,可以将一系列操作录制成宏,然后通过快捷键组合来执行宏。
宏录制功能可以提高编辑效率,减少重复操作。
4.2 多窗口编辑Emacs编辑器支持多窗口编辑,可以在同一个Emacs编辑器中打开多个文件并同时进行编辑。
Emacs+LaTeX快速上手Emacs + LaTeX 快速上手本教程完全针对本校D215机房Ubuntu系统中的Emacs 和LaTeX配置。
关于如何配置,请看这里。
本教程中涉及的LaTeX源文件和图片都可以在这里找到。
目录1 Emacs + AucTeX,60分钟快速入门为什么非要推荐LaTeX?这完全是出于个人喜好。
从1996年开始接触计算机到现在,Windows、UNIX、MS-Word、LaTeX 我都用过了。
我觉得我该把我认为优秀的东西推荐给你。
即使你不感兴趣,但做为计科专业的学生你应该知道它的存在。
为什么非要推荐Emacs?这不仅是出于个人喜好,也不仅是因为Emacs是最优秀的编辑器,我最基本的目的是,希望每一个计科专业的学生能熟练使用键盘。
1.1 放松心情LaTeX很强大,但对于初学者来说,你不必关心它有多强大,因为最为常用的命令和环境不过就是那么几个。
而且你也不必手工输入这些命令,只要你用Emacs+AucTeX,几个简单的快捷键就足以满足你的基本需求了。
对于格式复杂的需求,通常你只要套用模版就可以解决问题了。
所以,大家只要把Emacs用熟,一切迎刃而解。
1.2 用LaTeX写文章就是在编程我们先回忆一下用Emacs写一个hello.c的过程:1.打开Emacs;2.开始编辑一个新文件,名字叫hello.c:3.C-x C-f在Emacs窗口的最下面(也就是mini buffer里)写上新文件的名字hello.c:C-j4.向文件里写东西:5.#include6.int main(int argc, char *argv[])7.{8. printf ("Hello, world!\n");9.return 0;10.}保存:C-x C-s编译:gcc hello.c运行:./a.out再来看一下用Emacs写一个hello.tex的过程:1.打开Emacs;2.开始编辑一个新文件,名字叫hello.tex:3.C-x C-f在Emacs窗口的最下面(也就是mini buffer里)写上新文件的名字hello.tex:hello.texC-jC-j4.向文件里写东西:5.\documentclass{article}6.\begin{document}7.Hello, world!8.\end{document}保存:编译:xelatex hello.tex看结果:evince hello.pdf怎么样?hello.c和hello.tex的编辑过程没什么分别吧。
Ubuntu下使用vim编辑latex文件的方法贰叁事发表于2012年1月1日由galois这篇文章的标题看起来很唬人,里面有三个英文单词。
没办法,谁让这三样东西都是美国人发明的呢。
不过这也很明白的表明了本文的目的,三个单词都不知道是什么东西的同学,可以直接无视这篇文章啦。
近来要编辑一些数学公式,作为一名数学爱好者,自然的想要用latex这个排版神器来完成这项任务了。
而vim可以说是linux下最犀利的编辑器之一(照顾一下emacs爱好者的情绪)。
如果两者合体,一定会发生一些惊天动地的事情。
经过一番折腾,终于成功的实现了这个目的。
以下为具体步骤。
1.首先我们要安装vim和latex编译器1.1安装gvimubuntu中自带控制台下的vim,但是为了方便后面使用vim-latex插件,在此我建议安装图形界面下的gvim。
ubuntu的软件源里包含gvim,所以我们只需要在终端里输入一条语句即可:$ sudo apt-get install vim-gtk安装完毕后,在终端里输入gvim,就可以看到闪亮出场的gvim界面啦。
不过在我的系统(ubuntu10.10)里,gvim的菜单栏显示有误,凡是有汉字的地方都显示错乱。
经过google大神的帮助,发现这是因为字符编码的区别,ubuntu中默认的汉字编码格式为UTF8,而gvim只认识UTF-8编码格式的字符。
因此我们只需要告诉GVim将菜单栏的字符编码强制使用UTF-8就OK啦,要达到这一目的,要在/home/galois(galois是我在linux中的用户名,改成你的即可)目录下新建一个GVim的配置文件.vimrc,并在其中添加以下内容:set langmenu=zh_CN.UTF-8source $VIMRUNTIME/delmenu.vimsource $VIMRUNTIME/menu.vim记住这个.vimrc文件,后续我们还要用到它。
latex编译使用说明LaTeX是一种专业的排版系统,广泛应用于学术界和技术领域。
本文将为您介绍如何编译和使用LaTeX,以便更好地应对各种排版需求。
LaTeX的编译过程相对复杂,但只需掌握几个基本步骤即可。
首先,您需要安装LaTeX软件包,如TeX Live或MiKTeX。
这些软件包提供了LaTeX编译器及相关工具。
安装完成后,您可以使用任何文本编辑器编写LaTeX代码。
LaTeX代码以.tex作为文件扩展名。
在编写LaTeX代码时,您需要遵循一些基本规则。
首先,每个LaTeX文档都应以\documentclass命令开始,该命令定义了文档的类型和样式。
接下来,您可以使用一系列命令和环境来设置文档的结构和格式。
例如,\section命令用于创建章节标题,\textbf命令用于加粗文本。
您还可以使用环境例如itemize和enumerate来创建项目列表和编号列表。
编写完成后,您可以使用LaTeX编译器将.tex文件转换为最终的PDF或DVI格式。
编译过程通常需要多次运行,以解析交叉引用、生成目录和处理参考文献等任务。
具体的编译命令取决于您使用的LaTeX编译器和工作流程。
一般来说,您可以使用latex命令或pdflatex命令进行编译。
如果您的文档中包含参考文献,您还需要使用bibtex命令进行编译。
除了基本的编译命令,LaTeX还提供了大量的宏包和模板,以满足各种专业需求。
宏包是一组预定义的命令和环境,用于扩展LaTeX 的功能。
例如,graphicx宏包用于插入图像,amsmath宏包用于数学公式排版。
模板是一种预定义的文档格式,用于简化特定类型的文档编写。
例如,beamer模板用于制作演示文稿,IEEEtran模板用于撰写学术论文。
LaTeX的强大之处在于它可以处理复杂的排版任务,例如数学公式、图表和参考文献。
LaTeX提供了丰富的数学符号和公式环境,使得数学公式的排版变得简单而优雅。
您可以使用\frac命令创建分数,\sqrt命令创建平方根,\sum命令创建求和符号等等。
LaTeX模板使用方法介绍接下来,我们可以开始编写 LaTeX 文件。
LaTeX 文件的后缀名通常为 .tex。
在文件的开头,我们需要确定文档的类型,即文档类。
常见的文档类有 article、report、book 和 beamer(用于制作演示文稿)。
可以使用命令“\documentclass{文档类}”来指定文档类。
在文档类之后,我们可以在文件中添加一些全局设置,如设置页面边距、字体、行间距等。
这些设置通常在一个称为“导言区”的部分进行。
导言区位于“\documentclass”之后,但是在“\begin{document}”之前。
在导言区之后,我们可以开始编写文档的正文了。
正文部分位于“\begin{document}”和“\end{document}”之间。
在正文中,我们可以使用 LaTeX 提供的各种命令和环境来排版文档。
LaTeX 中的环境用于将一组命令作用于一些范围内的内容。
常见的环境有 itemize、enumerate、table 和 figure等。
例如,使用“\begin{itemize}”和“\end{itemize}”可以创建一个无序列表。
在 LaTeX 中,数学公式的排版是其重要的特点之一、我们可以使用“\(\)”或“$ $”来排版行内公式,使用“\[\]”来排版居中的公式。
还可以使用“\begin{equation}”和“\end{equation}”来为公式添加编号,以便在文中引用。
此外,LaTeX 还提供了许多宏包,用于扩展其功能。
我们可以使用“\usepackage{宏包名称}”来引入宏包。
一些常用的宏包有 graphicx(用于插入图片)、amsmath(用于排版数学公式)和 hyperref(用于添加超链接)等。
elsc的latex overleaf模板-回复如何使用els-cas.cls模板在Overleaf上编写科技论文。
步骤一:打开Overleaf网站并创建一个新项目要使用els-cas.cls模板在Overleaf上编写科技论文,首先请访问Overleaf 网站并登录您的账户。
如果您还没有账户,请先创建一个。
然后,在Overleaf首页上,点击“New Project”按钮,然后选择“Blank Project”。
步骤二:添加els-cas.cls模板到项目中创建新项目后,您将会看到一个空白的编辑窗口。
接下来,您需要将els-cas.cls模板添加到项目中。
为此,请点击页面左上角的“Menu”按钮,然后选择“Upload Project”选项。
在弹出的对话框中,找到您存放els-cas.cls模板文件的位置并上传它。
步骤三:将编译器设置为XeLaTeX在Overleaf网站上编写科技论文时,为了确保能够正确编译使用els-cas.cls模板编写的文章,请将编译器设置为XeLaTeX。
为此,请点击页面上方的“Menu”按钮,然后在“LaTeX编译器”下拉菜单中选择“XeLaTeX”。
步骤四:设置文档类型接下来,您需要设置文档类型为els-cas.cls。
为了做到这一点,请在您的tex文件的起始位置输入以下行:\documentclass[a4paper,fleqn]{els-cas}。
这将告诉Overleaf使用els-cas.cls模板来呈现您的文档。
步骤五:编辑正文和格式您可以自由编辑科技论文的正文和格式。
此外,els-cas.cls模板还提供了一些特定的命令和环境,用于帮助您创建符合Elsevier出版标准的论文。
例如,您可以使用\title、\author和\abstract命令创建标题、作者名和摘要。
您还可以使用\maketitle命令生成文档的封面。
步骤六:插入图表和引用els-cas.cls模板还提供了一些特殊的环境和命令来处理图表和引用。
org-mode 数学公式
org-mode 是一种用于在 Emacs 中编辑文档的模式。
它支持在文档中使用 LaTeX 数学公式来插入数学表达式和符号。
要在 org-mode 中插入数学公式,可以使用 LaTeX 数学环境。
下面是一个简单的示例:
```
#+BEGIN_SRC org
* 例子
我们可以使用LaTeX公式来插入数学表达式和符号。
以下是两个简单的例子:
1. 行内公式:$E = mc^2$,其中 $E$ 是能量,$m$ 是质量,$c$ 是光速。
2. 块级公式:
$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$
在上面的公式中,$n$ 是一个整数,$\sum$ 是求和符号,
$i$ 是索引变量,$\frac{n(n+1)}{2}$ 是求和的结果。
我们还可以使用其他常见的数学符号,如 $\alpha$、$\beta$、$\pi$ 等。
注意:为了正确地显示数学公式,在使用 org-mode 时,建议将LaTeX 配置正确地安装在您的系统上。
#+END_SRC
```
这样的文本将在 org-mode 中正确显示为数学公式。
希望这可以帮助你使用 org-mode 编辑中文文档中的数学公式。
基于Emacs的L A T E X编辑环境Date:2011,5Version:DraftBy:sizikiEmail:siziki@目录目录第1章L A T E X编辑环境选择 (3)第2章环境准备 (4)2.1安装Emacs (4)2.2安装和配置AUCT E X (4)2.2.1关于快捷键 (7)2.2.2关于代码折叠 (8)2.3RefT E X的安装和配置 (9)2.4CDL A T E X安装和配置 (13)2.5yasnippet+auto-complete (15)2.5.1构建L A T E X模版 (16)2.5.2构建自定义环境 (17)2.6关于preview-latex (18)2.7我的el (18)2第1章L A T E X 编辑环境选择第1章L A T E X 编辑环境选择使用L A T E X 编辑文档,有很多软件可以选择,构成不同的编辑环境。
在不同的平台环境下,有不同的选择,比如windows 环境下的WinEdit ,TeXMakerX 等,MacOS 下有TeXShop 等,GNU/Linux 下有kile 。
还有通用的TeXworks 。
这些软件基本都是为L A T E X 编辑而生的。
优点是上手容易、简单易用,当然简单易用的代价就是配置的灵活性不够。
除此以外还有有些通用的编辑环境,通过适当的配置,就可以实现强大的L A T E X 的编辑环境,这种编辑环境的强大程度往往只取决于你的想象力。
本文就是要介绍基于Emacs 的L A T E X 编辑环境。
有几点需要提前说明:1.本文使用L A T E X 发行版是TeXLive2010。
2.本文使用的T E X 引擎是X ET E X ,L A T E X+CJK 的情况不涉及。
3.操作系统环境是Debian GNU/Linux ,不同系统环境下的插件安装不同。
3第2章环境准备第2章环境准备2.1安装Emacs当然首先是要有Emacs,主流的GNU/Linux发行版都可以方便的安装,以Debian为例,$sudo apt-get install emacs裸奔的Emacs是看起来不是那么可爱,需要很多很多的配置,Emacs的功能也取决于你怎么配置它,这里就详细说了。
需要好几本书才可以说清,甚至都说不清。
结合下面的配置,就可以建立一个基本的L A T E X编辑环境了。
2.2安装和配置AUCT E X然后就是是安装AUCT E X了。
Debian下安装AUCT E X有两个选择,一个是使用Debian的工具:$sudo aptitude install auctexDebian可能还会安装相应的依赖,它会安装源里面的TeXLive,而这个TeXLive不是最新版的,所以不推荐这样安装AUCT E X。
根据在Debian下的经验,推荐安装最新版的AUCT E X,它对preview-L A T E X的支持更好。
可以通过下面的方式安装最新版的AUCT E X:cvs-d:pserver:anonymous@:/sources/auctex co. cd auctex./configure42.2.安装和配置AUCT E X5makemake install接下来就是要配置AUCT E X了,经过配置的AUCT E X才强大。
首先,设置基本的选项:(load”auctex.el”nil t t)(load”preview-latex.el”nil t t)(setq TeX-auto-save t)(setq TeX-parse-self t)(setq-default TeX-master nil)将这些配置写入.emacs中,然后打开一个T E X文件看看,菜单栏上就会有相应的L A T E X编辑命令和选项了,如图2.1。
图2.1L A T E Xmode下的菜单栏AUCT E X有很多的选项可以设定,可以到AUCT E X的主页上看这些选项的说明。
这里列出和我平常编辑L A T E X关系比较密切的选项设定。
在看下面的选项配置之前,需要说明的是,下面的配置代码都是包含在一个hook之内的1⃝:(add-hook’LaTeX-mode-hook(lambda()......))好了,可以看具体的配置了:1⃝不了解hook?找本Emacs的介绍来简单看看吧。
6第2章环境准备;;LaTeX模式下,不打开自动折行(turn-off-auto-fill);;显示行数(linum-mode1);;打开自动补全(auto-complete-mode1);;启动math mode,你也可以不用。
(LaTeX-math-mode1);;打开outline mode(outline-minor-mode1);;接下来是和编译TeX有关的;;编译的时候,不在当前窗口中显示编译信息(setq TeX-show-compilation nil)(setq TeX-clean-confirm nil)(setq TeX-save-query nil);;按\后光标跳到mini-buffer里面输入命令;;看个人习惯,因为如果有了auto-complete和yasnippet;;这个不开启也问题不大。
(setq TeX-electric-escape t);;重新定义pdf viewer,我设定为了evince。
(setq TeX-view-program-list’((”Evince””evince%o”)))2.2.安装和配置AUCT E X7(setq TeX-view-program-selection’((output-pdf”Evince”)));;设置编译引擎为XeTeX(setq TeX-global-PDF-mode tTeX-engine’xetex);;使用XeLaTeX作为默认程序来编译LaTeX(add-to-list’TeX-command-list’(”XeLaTeX””%‘xelatex%(mode)%’%t”TeX-run-TeX nil t))(setq TeX-command-default”XeLaTeX”)这些设置,基本够用。
打开一个TeX文档,然后测试一下编译,默认的编译快捷键是:C-c C-c更多选项,就去看AUCT E X手册页吧。
2.2.1关于快捷键AUCT E X自己定义了很多快捷键,这写快捷键如果熟悉之后,可以大大提高速度,你可以浏览一下都有哪些可以用的快捷键,当然也可以自己定义自己顺手的快捷键。
列出几个常用的快捷键:C-c C-c TeX-command-master;;编译,当前环境下是XeLaTeXC-c C-e LaTeX-environment;;插入环境,默认sectionC-c C-f TeX-font;;字体设置快捷键前缀,C-c C-j LaTeX-insert-item;;插入item,C-c C-k TeX-kill-job;;取消编译8第2章环境准备C-c C-v TeX-view;;打开pdf viewerC-c;TeX-comment-or-uncomment-region;;注释2.2.2关于代码折叠如果文档很长,就需要折叠相应的代码,AUCT E X也提供了良好的支持,首先你需要打开fold,(TeX-fold-mode1)然后到一个编辑的文档的buffer中,输入下面的快捷键:C-c C-o C-b就可以折叠当前buffer中的所有支持的环境和macro。
当然,你发现有很多环境没有被fold起来,不要担心,这些都是可以配置的,通过下面的方式来增加你需要配置的环境:(setq TeX-fold-env-spec-list(quote((”[figure]”(”figure”))(”[table]”(”table”))(”[itemize]”(”itemize”))(”[overpic]”(”overpic”)))))然后,你再来试试下面的快捷键,所有自定义的环境应该都可以被折叠了。
就可以自定义折叠环境的这点来说,AUCT E X就是很强大的。
C-c C-o C-b到目前为止,Emacs和AUCT E X已经能够完成基本的L A T E X编辑工作了。
可是到遇到大的文档编辑时,文档之间的互相引用的问题,AUCT E X是解决不了的,这就需要另外一个工具,那就是RefT E X。
2.3.REFT E X的安装和配置9 2.3RefT E X的安装和配置RefT E X的主要作用是在L A T E X方便的实现类似ref,cite的功能,尤其是当文档比较大,需要较多ref的时候,RefT E X就显得尤其好用。
下载最新版版的RefT E X包,然后安装:tar zxvf reftex-4.34.tar.gzcd reftex-4.34make$sudo make install然后开始配置,首先需要在.emacs中写入:(require’reftex)(add-hook’LaTeX-mode-hook’turn-on-reftex)(setq reftex-plug-into-AUCTeX t)(setq reftex-enable-partial-scans t)(setq reftex-save-parse-info t)(setq reftex-use-multiple-selection-buffers t) (autoload’reftex-mode”reftex””RefTeX Minor Mode”t)(autoload’turn-on-reftex”reftex””RefTeX Minor Mode”nil)(autoload’reftex-citation”reftex-cite””Make citation”nil)(autoload’reftex-index-phrase-mode”reftex-index””Phrase mode”t)这个时候,重启一下emacs或者,eval-buffer一下,你就会看到,菜单栏多出了一个菜单项:Ref10第2章环境准备点击最上面的Table of Contents你就可以看到当前文档的章节目录列表。
更方便的是,使用快捷键:C-c=就可以生成一个新的buffer,在buffer里面显示当前文档的章节目录,默认是水平的一个buffer,如图2.2。
图2.2水平的toc buffer在这个buffer里面,可以用快捷键操作实现自己想要的目录显示结果,根据上面的说明操作即可,很简单。
不习惯水平显示buffer?那就改,这就是Emacs的灵活强大之处,按照下面的方式来设置toc buffer 的显示方式:RefT E X不仅可以修改toc buffer显示的位置,连宽度都可以设置:;;*toc*buffer在左侧。