简单的LaTex例子

full circle issue 11 上看到的。名字叫"introduction to latex"。确实很简单。下面是代码,随便什么文本编辑器,存为一个后缀为.tex的文件,如my.tex。

这个代码格式太烂了。源代码见附件。

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\usepackage{multicol}
\title{My LaTeX Primer}
\author{Wang Ning}

\begin{document}

\maketitle
\clearpage
\tableofcontents
\clearpage
\listoftables
\clearpage
\listoffigures
\clearpage

\section{Equations}

I will begin by adding a famous equation to the document, and referencing the equation in the text.

Einstein published important papers in 1905, and one of them was Special Relativity, popularly known as \ref{eqn1}.

\begin{equation}
\label{eqn1}
E = mc^2
\end{equation}

where, E represents energy, m the mass of the object, and c the speed of light.

I will make my second equation. This should be like \ref{eqn2}.

\begin{equation}
\label{eqn2}
a = b^c
\end{equation}

This means nothing. But I create it.

\section{Table}

Now we will insert a table containing a fictional list of names and ages. Table \ref{table1} contains...

\begin{table}[!ht]
\caption{A table to contain ages and names}
\label{table1}
\begin{center}
\begin{tabular}{|c|c|}
\hline
Name & Ages\\
\hline
Bob & 24\\
Dave & 13\\
Lucy & 27\\
Claire&12\\
\hline
\end{tabular}
\end{center}
\end{table}

\section{Columns}

It is very easy to add multiple columns to the document:

\begin{multicols}{2}
LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF CONTENT LOTS OF
\end{multicols}

\section{Image}

Here is a picture as image \ref{image1} shows.

\begin{figure}[!ht]
\caption{Penguin Image}
\label{image1}
\begin{center}
\includegraphics[width=3in]{tux.png}
\end{center}
\end{figure}

\end{document}

 这里面有个图片,叫tux.png,随便找个图片方上去就可以。

然后系统中要有pdflatex命令。在命令行下运行$pdflatex my.tex,就输出pdf文件了。效果还不错。

文章最后还推荐了一个不错的文档:http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf

以后在慢慢研究吧。

### LaTeX 文档示例 对于希望了解如何创建高质量学术论文的人来说,LaTeX 提供了多种模板来简化这一过程。下面是一个基于 Elsevier 模板的简单例子,展示了如何设置带有作者照片和个人简介的部分[^1]。 ```tex \documentclass{cas-dc} \usepackage{wrapfig} % 宏包用于环绕图片文字排版 \usepackage{graphicx} \begin{document} \title[version=journal]{Title of the Paper} \author[1]{Author Name}[type=editor,orcid=0000-0002-9999-3724] \affil[1]{Organization name, Address line 1, Postal code, City, Country} \begin{abstract} This is an example abstract. \end{abstract} \keywords{Keyword one, Keyword two, Keyword three} \maketitle \section{Introduction} The introduction text goes here. \subsection*{Biography Sketches} \begin{wrapfigure}{l}{25mm} \centering \includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{path/to/your/photo.jpg} \end{wrapfigure} \noindent\textbf{Author Name}\\ A brief biography can be included after each author's affiliation information. This section may contain details such as academic background, research interests, and recent publications or achievements relevant to this work. \end{document} ``` 上述代码片段演示了如何利用 `cas-dc` 类型的文章类定义文档结构,并通过 `\begin{wrapfigure}` 命令嵌入作者的照片以及个人简介部分。注意这里使用的是双栏模式 (`cas-dc`) 的期刊模板[^3]。 为了更好地理解不同类型的布局选项,可以参考有关于 LaTeX 中单栏和双栏布局的具体描述[^2]。此外,更多详细的模板实例可以在 CTAN 上找到 els-cas-template 资源库[^4]。 #### 关键组件解释: - **Document Class**: 使用特定于出版商或会议的文档类别(如这里的 `cas-dc`),这决定了整体页面格式。 - **Packages**: 导言区加载必要的宏包以支持所需功能,比如图形插入(`graphicx`) 或者图文混排(`wrapfig`)。 - **Metadata Sections**: 包括标题、作者列表及其所属机构等元数据信息。 - **Abstract & Keywords**: 论文摘要及关键词通常紧跟在前言之后。 - **Main Content**: 正文主体按照章节划分撰写具体内容。 - **Biographical Sketches**: 可选地为每位贡献者提供简短的职业生涯概述。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值