本文送给想了解Latex基本排版功能&面对庞大的模板不知所措的小伙伴

1.全英文输出

\documentclass{article}
% 这里是导言区
\begin{document}
Hello, world!
\end{document}

2.中英文混输

\documentclass[UTF8]{ctexart}
\begin{document}
你好,world!
\end{document}

3.数学公式

(空一行为另起一段,\\为段内强制换行。)

\documentclass{article} 
\usepackage{amsmath} 
\usepackage{amssymb} 
\begin{document}
The Newton's second law is $F=ma$.
 
Greek Letters $\eta$ and $\mu$ 
 
Fraction $\frac{a}{b}$ 
 
Power $a^b$  
\end{document}

输出
在这里插入图片描述

\documentclass{article} 
   \usepackage{amsmath} 
   \usepackage{amssymb} 
\begin{document}
$p_{\theta }\left ( x\mid y \right )\propto exp\sum_{e\in E,k}^{}\lambda _{k} $
\end{document}

在 https://private.codecogs.com/latex/eqneditor.php 网站中编辑数学公式
$$是开启行内数学模式,用于和文本合在一起使用。
在这里插入图片描述

4.标题,作者

\documentclass{article} 
   \author{My Name} 
   \title{The Title} 
\begin{document}  
   \maketitle  
   hello, world % This is comment  
\end{document}

在这里插入图片描述

5.段落章节

\documentclass{article} 
   \title{Hello World} 
\begin{document}  
   \maketitle  
   \section{Hello China} China is in East Asia.  
     \subsection{Hello Beijing} Beijing is the capital of China.  
       \subsubsection{Hello Dongcheng District}  
         \paragraph{Tian'anmen Square}is in the center of Beijing  
           \subparagraph{Chairman Mao} is in the center of Tian'anmen Square  
      \subsection{Hello Guangzhou}  
         \paragraph{Sun Yat-sen University} is the best university in Guangzhou.  
\end{document}

在这里插入图片描述

文档结构点击相应位置可以准确定位
在这里插入图片描述

6.插入图片,可以调整图片大小

\documentclass{article} 
   \usepackage{graphicx} 
\begin{document}
hello world!\\
   \includegraphics[width=1.40in,height=1.30in]{1.png}  
\end{document}

[width = .5\textwidth] 按图片原比例调整图片大小

7.制作表格

\documentclass{article} 
   \usepackage{graphicx} 
\begin{document}
\begin{table}
\centering
\caption{TableName}
\begin{tabular}{|l|l|l|l|}
\hline
 & vgg16 & incev3 & resnet \\ \hline
patch-unary & 0.734 & 0.766 & 0.888 \\ \hline
patch-binary & 0.677 & 0.788 & 0.676 \\ \hline
\end{tabular}
\end{table}
\end{document}

效果不怎么样,略丑
在这里插入图片描述

8.引用文献

过程有点曲折。。
首先要有一个放以下引用目录的bib文件

@article{rivero2001resistance,
title={Resistance to cold and heat stress: accumulation of phenolic compounds in tomato and watermelon plants},
author={Rivero, Rosa M and Ruiz, Juan M and Garc{\i}a, Pablo C and L{\'o}pez-Lefebre, Luis R and S{\'a}nchez, Esteban and Romero, Luis},
journal={Plant Science},
volume={160},
number={2},
pages={315--321},
year={2001},
publisher={Elsevier}
}


@article{gostout1992clinical,
title={The clinical and endoscopic spectrum of the watermelon stomach},
author={Gostout, Christopher J and Viggiano, Thomas R and Ahlquist, David A and Wang, Kenneth K and Larson, Mark V and Balm, Rita},
journal={Journal of clinical gastroenterology},
volume={15},
number={3},
pages={256--263},
year={1992},
publisher={LWW}
}

一开始创建的时候只可以创建tex文件,然后选打开方式,用texwork打开,另存为选择bib格式,然后和.tex存到同一个目录下
一开始编译说undefine

\documentclass{article}
\usepackage[numbers]{natbib}
\begin{document} 
          One reference about watermelon \cite{gostout1992clinical}         
          Another reference about watermelon \cite{rivero2001resistance}         
          \bibliographystyle{plain}         
          \bibliography{reference}         
        \end{document}

采用玄学编译法使用 pdflatex 编译

之后使用 bibtex 编译

之后在使用 pdflatex 编译两次

可以之后可以使用bibtex 编译一次

Xelatex 编译两次。
最后再快速构建一次就行了
想知道怎么得到BIB文件内容的戳我
在这里插入图片描述

https://blog.csdn.net/junruitian/article/details/102736042

8.标号

\begin{itemize}
\item 内容
\item 
\end{itemize}
%默认为圆点标记
\begin{enumerate}
\item 内容
\item 
\end{enumerate}
%数字有序标识
Logo

助力广东及东莞地区开发者,代码托管、在线学习与竞赛、技术交流与分享、资源共享、职业发展,成为松山湖开发者首选的工作与学习平台

更多推荐