使用 EasyLaTeX 写论文:从新建项目到导出 PDF

帮助EasyLaTeX发布于

本教程用一份梯度下降主题的短文示例,演示在 EasyLaTeX 中组织标题、摘要、章节、公式、图表和参考文献。示例用于学习写作流程,正式论文仍需自己的研究内容和投稿模板。

1. 新建项目并设置主文件

登录EasyLaTeX 编辑器,新建空项目,打开或创建 main.tex。在顶部“选择编译主文件”处选中它;在左侧“编辑器设置”的“编译器”中选择 XeLaTeX。编译器按用户在当前项目中的选择保存,协作者也应检查自己的设置。

文件树管理资源,中间区域编辑源码,输出面板显示 PDF。图中是英文界面的示例:

EasyLaTeX 文件树、源码区与输出面板

2. 设置导言区

把下面的导言区放在文件开头。它还不是完整文档,后面需要正文的开始与结束命令:

\documentclass[UTF8,a4paper,11pt]{ctexart}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage[a4paper,margin=1in]{geometry}
\usepackage[numbers]{natbib}
\usepackage{hyperref}
\title{Gradient Descent: A Writing Example}
\author{Your Name}
\date{\today}

中文示例使用 ctexart;英文通常可用 article。有学校或期刊模板时保留其文档类和要求,不把整段导言区直接覆盖到现成模板上。

3. 写标题、摘要与章节

导言区之后写一次 \begin{document},再写 \maketitle 和摘要。整个文件最后只保留一个对应的 \end{document}。

\begin{abstract}
This document demonstrates the structure of a short paper on gradient descent.
It includes notation, an update equation, an illustrative comparison table,
an optional figure, and references.
\end{abstract}

在同一个正文内继续加入章节骨架:

\section{Introduction}
\section{Mathematical Fundamentals}
\subsection{Gradient and Update Rule}
\section{Gradient Descent Variants}
\section{Learning Rate}
\section{Conclusion}

标题与章节编号由文档类管理。下面的片段都放在正文中,不要再重复添加文档类或正文边界。文末有完整合并示例。

4. 加入公式

短公式放在 \(...\) 中;不编号的独立公式用 \[...\]。需要编号和引用时用 equation、\label 与 \eqref:

\begin{equation}
  \theta_{t+1}=\theta_t-\eta\nabla J(\theta_t)
  \label{eq:update}
\end{equation}
Equation~\eqref{eq:update} defines the update used here.

多行推导用 align,以 & 对齐,\\ 换行:

\begin{align}
J(\theta_0,\theta_1)
  &=\frac{1}{2m}\sum_{i=1}^{m}(h_{\theta}(x_i)-y_i)^2,\\
\frac{\partial J}{\partial\theta_0}
  &=\frac{1}{m}\sum_{i=1}^{m}(h_{\theta}(x_i)-y_i).
\end{align}

5. 加入表格

table 管理浮动与表题,tabular 排列单元格;示例中的比较是概念性说明,不是实验测量:

\begin{table}[tbp]
\centering
\caption{Illustrative comparison of gradient estimates}
\label{tab:variants}
\begin{tabular}{lll}
\toprule
Variant & Samples per update & Typical sampling fluctuation \\
\midrule
Batch & Full dataset & No mini-batch sampling \\
Stochastic & One example & Higher \\
Mini-batch & A selected batch & Between the two \\
\bottomrule
\end{tabular}
\end{table}

列之间用 & 分隔。把 \label 放在 \caption 后,正文用 \ref{tab:variants} 引用。

6. 上传并引用图片

通过文件树上传 loss-curve.png。下面的例子在图片缺失时显示占位框,上传真实曲线后自动使用图片:

\begin{figure}[tbp]
\centering
\IfFileExists{loss-curve.png}{%
  \includegraphics[width=0.7\linewidth]{loss-curve.png}%
}{%
  \fbox{\rule{0pt}{30mm}\rule{0.65\linewidth}{0pt}}%
}
\caption{Loss-curve illustration; replace with your own figure}
\label{fig:loss}
\end{figure}

graphicx 提供插图命令,相对宽度随可用行宽调整。文件路径与大小写必须对应;不要把占位框当作已完成的研究图。

7. 加入参考文献

少量文献可用 thebibliography。正文通过 \cite{goodfellow2016} 引用;这种方式不用 .bib 或外部文献处理程序,但引用仍可能需要平台执行重复编译:

\begin{thebibliography}{9}
\bibitem{goodfellow2016} Ian Goodfellow, Yoshua Bengio, and Aaron Courville.
\emph{Deep Learning}. MIT Press, 2016.
\bibitem{bottou2012} Leon Bottou.
Stochastic Gradient Descent Tricks. In \emph{Neural Networks: Tricks of the Trade}, 2012.
\bibitem{kingma2015} Diederik P. Kingma and Jimmy Ba.
Adam: A Method for Stochastic Optimization. ICLR, 2015.
\end{thebibliography}

需要复用文献库或换样式时,参阅BibTeX 与 biblatex 教程。

8. 编译、检查并下载

点击编译后,当前编辑内容会先保存。等待本次任务结束,再检查公式、图表、引用和 PDF。出错时打开“Bug”查看错误与“原始日志”,必要时使用“AI修复”。具体流程见编译排错。

工具栏下载菜单中的“下载 PDF 文件”用于最终阅读和提交,“下载 LaTeX 项目”用于保存源码与资源。确认编译成功后再下载 PDF:

EasyLaTeX 下载 LaTeX 项目和 PDF 的菜单

完整的 main.tex

以下是一份可独立使用的结构示例;图片未上传时会显示占位框。复制时用它替换测试项目的主文件,不要接在已有的 \end{document} 后面:

\documentclass[UTF8,a4paper,11pt]{ctexart}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage[a4paper,margin=1in]{geometry}
\usepackage[numbers]{natbib}
\usepackage{hyperref}
\title{Gradient Descent: A Writing Example}
\author{Your Name}
\date{\today}
\begin{document}
\maketitle
\begin{abstract}
This document demonstrates the structure of a short paper on gradient descent.
It includes notation, an update equation, an illustrative comparison table,
an optional figure, and references.
\end{abstract}
\section{Introduction}
Background is discussed in~\cite{goodfellow2016,bottou2012,kingma2015}.
\section{Mathematical Fundamentals}
Let $J$ be a differentiable objective and $\eta>0$ a step size.
\begin{equation}
  \theta_{t+1}=\theta_t-\eta\nabla J(\theta_t)
  \label{eq:update}
\end{equation}
Equation~\eqref{eq:update} defines the update used here.
\begin{align}
J(\theta_0,\theta_1)
  &=\frac{1}{2m}\sum_{i=1}^{m}(h_{\theta}(x_i)-y_i)^2,\\
\frac{\partial J}{\partial\theta_0}
  &=\frac{1}{m}\sum_{i=1}^{m}(h_{\theta}(x_i)-y_i).
\end{align}
\section{Gradient Descent Variants}
\begin{table}[tbp]
\centering
\caption{Illustrative comparison of gradient estimates}
\label{tab:variants}
\begin{tabular}{lll}
\toprule
Variant & Samples per update & Typical sampling fluctuation \\
\midrule
Batch & Full dataset & No mini-batch sampling \\
Stochastic & One example & Higher \\
Mini-batch & A selected batch & Between the two \\
\bottomrule
\end{tabular}
\end{table}
Table~\ref{tab:variants} is a qualitative illustration, not measured performance.
\section{Learning Rate}
Upload your own loss-curve image to replace the placeholder in Figure~\ref{fig:loss}.
\begin{figure}[tbp]
\centering
\IfFileExists{loss-curve.png}{%
  \includegraphics[width=0.7\linewidth]{loss-curve.png}%
}{%
  \fbox{\rule{0pt}{30mm}\rule{0.65\linewidth}{0pt}}%
}
\caption{Loss-curve illustration; replace with your own figure}
\label{fig:loss}
\end{figure}
\section{Conclusion}
Check the assumptions, results, and references for your actual paper.
\begin{thebibliography}{9}
\bibitem{goodfellow2016} Ian Goodfellow, Yoshua Bengio, and Aaron Courville.
\emph{Deep Learning}. MIT Press, 2016.
\bibitem{bottou2012} Leon Bottou.
Stochastic Gradient Descent Tricks. In \emph{Neural Networks: Tricks of the Trade}, 2012.
\bibitem{kingma2015} Diederik P. Kingma and Jimmy Ba.
Adam: A Method for Stochastic Optimization. ICLR, 2015.
\end{thebibliography}
\end{document}

下一步用自己的论证、数据和图表替换示例内容,并按学校或期刊的模板检查格式。

使用 EasyLaTeX 写论文:从新建项目到导出 PDF | EasyLaTeX | EasyLaTeX