发现了一个神奇的网站,overleaf
以下是基于默认模板写的。
documentclass[a4paper]{article}
%% Language and font encodings
usepackage[english]{babel}
usepackage[utf8x]{inputenc}
usepackage[T1]{fontenc}
%% Sets page size and margins
usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
%% Useful packages
usepackage{amsmath}
usepackage{graphicx}
usepackage[colorinlistoftodos]{todonotes}
usepackage[colorlinks=true, allcolors=blue]{hyperref}
usepackage[fontset=ubuntu]{ctex}
itle{我的第一次在线书写}
author{lart}
egin{document}
maketitle
egin{abstract}
机缘巧合之下,找到了这个网站,很好,省去了本地安装tex各种相关软件的麻烦,倒是剩下了不少磁盘空间。就是内存占的高了点。毕竟是用浏览器。
end{abstract}
section{简单描述}
这是一个新的尝试,实验一下在线使用tex的快感。
这个网站很好,https://www.overleaf.com
上面也有许多人在分享模板共我们使用。
默认的对于中文支持需要进行一些设置。
在设置里设置使用xelatex和pdf。
下面是该网站默认模板的一些使用。
section{这里是一些默认模板中的可供参考的部分}
subsection{注释的方法}
使用\%作为单行注释。
% * <lartpang@163.com> 2017-06-29T06:22:43.307Z.
subsection{添加图片}
先上传图片。使用包含命令添加到文本中。使用figure和caption添加数字和标题。例如代码Figure
ef{fig:frog}
egin{figure}
centering
includegraphics[width=0.3 extwidth]{frog.jpg}
caption{label{fig:frog}这只青蛙通过程序目录上传。}
end{figure}
subsection{添加表格}
使用table和tabular命令可以制作一个简单的表格 --- 可看 Table~
ef{tab:widgets}
egin{table}
centering
egin{tabular}{l|r}
Item & Quantity \hline
Widgets & 42 \
Gadgets & 13
end{tabular}
caption{label{tab:widgets}一个示例表格}
end{table}
subsection{怎样写数学公式}
LaTeX{}对于数学公式的呈现是极其擅长的。 设有 $X_1, X_2, ldots, X_n$ 这样一组独立同分布的变量,且期望为 $ ext{E}[X_i] = mu$ 方差为 $ ext{Var}[X_i] = sigma^2 < infty$,则有样本均值
[S_n = frac{X_1 + X_2 + cdots + X_n}{n}
= frac{1}{n}sum_{i}^{n} X_i]
随着 $n$ 趋于无穷大,变量 $sqrt{n}(S_n - mu)$ 服从正态分布 $mathcal{N}(0, sigma^2)$。
subsection{如何创建部分和小节}
只要使用section和subsection按钮,便可以创建。
subsection{如何添加列表}
您可以自动编号列表 dots
egin{enumerate}
item Like this,
item and like this.
end{enumerate}
dots or bullet points dots
egin{itemize}
item Like this,
item and like this.
end{itemize}
subsection{如何添加引文和引用列表}
你可以上传一个用JavRef创建的包含BibTeX条目的 verb|.bib| 文件,或者引入你的 href{https://www.overleaf.com/blog/184}{Mendeley}, CiteULike or Zotero library 作为 verb|.bib| 文件。 然后你可以引用它的条目,就像这样: cite{greenwade93}。 只要记住指定一个参考书目风格,以及 verb|.bib| 的文件名
你可以在这个 href{https://www.overleaf.com/help/97-how-to-include-a-bibliography-using-bibtex}{参考} 里了解下 BibTeX.
ibliographystyle{alpha}
ibliography{sample}
end{document}
样式: