如何用latex写论文

本文针对overleaf在线使用latex的情况编写。

文档结构

  • 文档类型设置
\documentclass[12pt,article]{book} % []中设置文档格式,文档字体大小默认为10pt,article指定文档用纸类型,其他常用类型还包括a4paper、legalpaper;
% {}设置文档类型,常用类型包括book,report,article
  • 添加作者
\author{wangzai}\thanks{thanks **}
  • 添加日期
\date{\today} % 设置写作的具体日期,\today显示今天的日期
  • 文档体

latex中正文内容需要被document包裹起来,类似html中的body标签的作用,如下:

\begin{document}
\end{document}
  • 添加标题

latex中添加标题需要两个设置:
1)文档(document)前设置标题名称

\title{Latex quickstart tutorial} % 设置标题名称

该内容设置在\begin{document}前。
2) 文档(document)中添加标题

\maketitle % 添加标题

该内容被\begin{document} \end{document}包裹。

  • 添加摘要
\begin{abstract}
    the is abstract 
\end{abstract}
  • 添加目录
\tableofcontents
  • 添加章节
\chapter{chp1 name}

章节和小节一般不在同一个文档中重复使用。

  • 添加小节
\section{section1 text} % latex会自动给文档中的小节编号
\subsection{subsection name}
\section*{section without number} % \section*{}表示该小节取消数字编号
  • 添加段落
\paragraph{paragraph1}
\subparagraph{subparagraph 1}

要点

  • 无序要点
\begin{enumerate} % enumerate显示无序要点
    \item the enumerate denotes the ordered item 
    \item where you can see item is the same
\end{enumerate}
  • 有序要点
\begin{itemize} % itemize显示有序要点
\item the itemize include unordered list 
\item the figure 
\end{itemize}

导入图片

latex中导入图片分三个要设置的内容:
1)导入图片包:

 \usepackage{graphicx}% LaTeX package to import graphics

2) 指定图片在overleaf环境下的目录路径:

\graphicspath{{image/}} % configuring the graphicx package, {image/} is the image folder
  1. 文章部分指定图片相对路径载入图片:
\includegraphics{image/linuxroadmap.png}  % {} is the relative path of image

若要设置图片显示的格式,可通过{figure}包括includegraphics的方式设置:

\begin{figure}
    \centering % 设置对齐方式
    \includegraphics[width=0.85\textwidth]{image/linuxroadmap.png}
    % 设置图片宽度为文本宽度的0.85
    \caption{this is the figure title} % 设置图片标题
    \label{fig:fig1} % 设置图片标签
\end{figure}

设置了标签的图片,后文可以通过\ref引用,如:

There's a picture reference \ref{fig:fig1} 

使用表格

表格通过\begin{tabular},\end{tabular}的方式导入:

\section{tables}
\begin{center} % 设置表格居中
\begin{tabular}{|c |r l} % {}设置单元格对齐方式,c表示居中,r表示向右对齐,l表示向左对齐
\hline\hline % 添加横线,一个\hline表示表格对应位置添加一个横线
cell1&cell2&cell3\\ % \\表示换行;&表示分隔单元格
cell1&cell2&cell3\\ 
cell1&cell2&cell3\\
\hline

\end{tabular}
\end{center}

效果如图所示:
在这里插入图片描述

在线excel to latex转换

推荐一个在线工具,可以上传excel表,直接转换成latex代码。
https://tableconvert.com/zh-cn/csv-to-latex

添加引用

latex中引用要输入四个命令:
1)

\usepackage{biblatex} % 导入引用包
\addbibresource{sample.bib} %导入要引用的参考文献的引文数据
\cite{einstein} % 在文档中引用
\printbibliography % 生成引文

参考文献和引用

参考资料

  1. overleaf30分钟latex入门教程:https://www.overleaf.com/learn/latex/Learn_LaTeX_in_30_minutes
  2. NIPS提交论文的latex格式源码: https://neurips.cc/Conferences/2014/PaperInformation/StyleFiles
  3. overleaf document : https://www.overleaf.com/learn
  4. https://www.overleaf.com/learn/latex/Bibliography_management_in_LaTeX
### 如何使用 LaTeX学术论文 LaTeX 是一种强大的排版工具,尤其适合撰学术论文。以下是关于如何利用 LaTeX高质量学术论文的关键要点: #### 使用合适的模板 为了提高效率并确保格式一致,建议选用现成的 LaTeX 模板[^1]。这些模板通常已经预设好诸如页边距、字体大小以及双栏布局等参数,可以直接应用于各类学术期刊的要求。 #### 插入必要的组成部分 一份完整的学术文章应当包含摘要(Abstract),正文(Main Text),图表(Figures & Tables)以及参考文献(Bibliography)[^3]。具体实现方法如下: - **摘要**: 在文档开头定义摘要部分。 - **章节划分**: 利用 `\section` 和 `\subsection` 命令来组织内容结构。 - **图像嵌入**: 可以借助 `graphicx` 宏包完成图片插入操作。例如: ```latex \usepackage{graphicx} ... \begin{figure}[h!] \centering \includegraphics[width=0.5\textwidth]{example-image-a} \caption{Example Figure Caption}\label{fig:my_label} \end{figure} ``` - **公式处理**: 对于复杂的数学表达式,推荐采用专门的在线编辑器辅助生成正确的 LaTex 语法,并将其粘贴到 Overleaf 或本地环境中[^5]。同时记得给每一个重要方程式赋予唯一标签以便后续引用: ```latex \begin{equation} E = mc^2 \label{eq:einstein} \end{equation} As shown in Equation~(\ref{eq:einstein}),... ``` #### 提升工作效率的小技巧 除了基本功能外,掌握一些额外技能可以帮助进一步简化流程。比如熟悉宏包管理机制(`ctan`);学会调试常见错误提示信息;定期备份项目文件以防数据丢失等等[^2]。 #### 工作原理简介 理解其背后运作机理也有助于更好地操控整个系统。实际上,无论是 HTML 还是 TeX 文件都需要通过特定解析程序转换为目标产物形式,在这方面二者存在诸多相似之处[^4]。 综上所述,按照上述指导原则实践练习即可逐步精通基于 LaTeX 的科技报告创作技艺。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值