Latex学习--30minutes入门

在overleaf上看了那个30minutes的教程,自己使用TexStudio软件测了一遍

% 文章类型,article/book/report 不同的类型有细微差异
% 存在部分标签不能跨类型使用
\documentclass[12pt, a4paper]{article}
% 页面布局,采用A4纸,a4paper/letterpaper/...
\usepackage[a4paper, total={6in, 8in}]{geometry}
% 编码,默认utf-8
\usepackage[utf8]{inputenc}
% 导入外部包,部分函数要导入相应包才能使用
\usepackage{graphicx}
% 标题
\title{My First Document Demo}
% 作者
\author{Tao \thanks{funded by the Overleaf team}}
% 日期
\date{Oct 2019}
%以上的信息统称为preamble,序言
\begin{document}
    % 设置了title,才能使用maketitle,表示将标题信息打印
    \maketitle
    % 摘要
    \begin{abstract}
        This is a simple paragraph at the beginning of the 
        document. A brief introduction about the main subject.
    \end{abstract}

    % 正文
     First document. This is a simple example, with no extra parameters or packages included.
%\chapter{First Chapter},要文章类型是book,才能使用的标签
% 章节
    \section{section one}
    % 换行要留一个空格,或者在最后加上\\ ,否则不会换行
    % 加粗、斜体、下划线标签
        Some of the \textbf{greatest}
        discoveries in \textit{science}
        were made by \underline{accidents}
    \section{section two}
        Some of the greatest \emph{discoveries} in science were made by accidents
     
        \textit{Some of the greatest \emph{discoveries} in science were made by accidents}
        % 子章节标签
    \subsection{First Subsection}
        \textbf{Some of the greatest \emph{discoveries} in science were made by accident.}
     
        There is a photo demo, as you can see in the figure \ref{fig:wlop-},also you can see in the page \pageref{fig:wlop-}.
    
    Now, there are some order demo:
    % 无序list标签
    \begin{itemize}
        \item The individual entries are indicated with a black dot, a so-called bullet.
        \item The text in the entries may be of any length.
    \end{itemize}
    % 有序list标签
    \begin{enumerate}
        \item This is the first entry in our list
        \item The list numbers increase with each entry we add
    \end{enumerate}
    % 数学符号使用$$
 In physics, the mass-energy equivalence is stated 
 by the equation $E=mc^2$, discovered in 1905 by Albert Einstein.
 The mass-energy equivalence is described by the famous equation
    % 占用一行
 \[ E=mc^2 \]
 
 discovered in 1905 by Albert Einstein. 
 In natural units ($c = 1$), the formula expresses the identity
 % 占用1行并显示等式序号
 \begin{equation}
 E=m
 \end{equation}
 \begin{equation}
 E=mc^2
 \end{equation}
 % 下标和上标
Subscripts in math mode are written as $a_b$ and superscripts are written as $a^b$. These can be combined an nested to write expressions such as

\[ T^{i_1 i_2 \dots i_p}_{j_1 j_2 \dots j_q} = T(x^{i_1},\dots,x^{i_p},e_{j_1},\dots,e_{j_q}) \]
We write integrals using $\int$ and fractions using $\frac{a}{b}$. Limits are placed on integrals using superscripts and subscripts:

\[ \int_0^1 \frac{1}{e^x} =  \frac{e-1}{e} \]
% 插入图片,以及给图片加上说明信息,标签
    \begin{figure}
    \centering
    \includegraphics[width=0.7\linewidth]{C:/Users/Penger/Pictures/WLOP-赛丽亚}
    \caption{this is a \textbf{caption} demo}
    \label{fig:wlop-}
    \end{figure}
% 希腊字母大小写表示
Lower case Greek letters are written as $\omega$ $\delta$ etc. while upper case Greek letters are written as $\Omega$ $\Delta$.

Mathematical operators are prefixed with a backslash as $\sin(\beta)$, $\cos(\alpha)$, $\log(x)$ etc.
% 表格表示1
\begin{center}
    \begin{tabular}{ c r l }
        cell1 & cell2 & cell3 \\ 
        cell4 & cell5 & cell6 \\  
        cell7 & cell8 & cell9    
    \end{tabular}
\end{center}
%表格表示2
\begin{center}
    \begin{tabular}{ |c| r| l| }
        \hline
        cell1 & cell2 & cell3 \\ 
        cell4 & cell5 & cell6 \\  
        \hline
        cell7 & cell8 & cell9\\
        
        \hline    
    \end{tabular}
\end{center}
%表格表示3
\begin{center}
    \begin{tabular}{||c c c c||} 
        \hline
        Col1 & Col2 & Col2 & Col3 \\ [0.5ex] 
        \hline\hline
        1 & 6 & 87837 & 787 \\ 
        \hline
        2 & 7 & 78 & 5415 \\
        \hline
        3 & 545 & 778 & 7507 \\
        \hline
        4 & 545 & 18744 & 7560 \\
        \hline
        5 & 88 & 788 & 6344 \\ [1ex] 
        \hline
    \end{tabular}
\end{center}
Table \ref{table:data} is an example of referenced \LaTeX{} elements.
% 表格表示4
\begin{table}[h!]
    \centering
    \begin{tabular}{||c c c c||} 
        \hline
        Col1 & Col2 & Col2 & Col3 \\ [0.5ex] 
        \hline\hline
        1 & 6 & 87837 & 787 \\ 
        2 & 7 & 78 & 5415 \\
        3 & 545 & 778 & 7507 \\
        4 & 545 & 18744 & 7560 \\
        5 & 88 & 788 & 6344 \\ [1ex] 
        \hline
    \end{tabular}
    \caption{Table to test captions and labels}
    \label{table:data}
\end{table}
\end{document}

你可能感兴趣的:(Latex学习--30minutes入门)