Latex入门

版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/u012319493/article/details/50598711

首先下载CTex

使用
编写:

\documentclass{article}
\begin{document}
hello, world
\end{document} 

编译运行:
这里写图片描述
查看:
这里写图片描述
效果:
这里写图片描述

系统找不到指定文件
是因为找不到“TeXify.exe”,所以要重新选择安装目录
这里写图片描述

图片
latex一般只插入eps格式图片,需要将jpg/png转换一下,方法:
在WinEdit下方找到命令窗口:
这里写图片描述
切换到图片所在目录后,输入:

bmeps -c example.jpg example.eps

插入图片:
插入一张图片

\begin{center}   %居中
       \includegraphics[scale=0.5]{picture/SIQR.eps} %缩小一半
\end{center}

插入多张图片

\begin{figure}[htbp!]
    \centering
    \includegraphics[scale=0.5]{code/code.eps}
    \includegraphics[scale=0.5]{code/co.eps}
    \caption{}
    \end{figure}
\

图片并排

\begin{figure*}

\begin{minipage}[b]{0.48\linewidth}  %[b]表示图片低端对齐
  \includegraphics[height=4cm,width=6cm]{fig8.eps}
  %\includegraphics[width=0.45\textwidth]{fig9.eps}
%\caption{Initial-level direct rays}
%\label{fig:8}       % Give a unique label
\end{minipage}  % 后面一定不能有空行,否则图片不在同一行
\begin{minipage}[b]{0.48\linewidth}
  \includegraphics[height=4cm,width=6cm]{fig9.eps}
%\caption{Judgment of intersection point P inside a polygon}
%\label{fig:9}    % Give a unique label
\end{minipage} \\   % 换行


\begin{minipage}[t]{0.48\linewidth}  % [t] 表示标题顶端对齐
\caption{Judgment of intersection point P inside a polygon}
\label{fig:8}    % Give a unique label
\end{minipage} % 后面一定不能有空行,否则图片不在同一行
\begin{minipage}[t]{0.48\linewidth}
\caption{Judgment of intersection point P inside a polygon}
\label{fig:9}    % Give a unique label
\end{minipage}

\end{figure*}

这里写图片描述

\usepackage{subfigure}


\begin{figure*}

\subfigure[Ground]{
  \label{fig:13:a}
  \includegraphics[width=0.5\textwidth]{fig10.eps}} % subfigure后面一定不能有空行,否则图片不在同一行
\subfigure[Buildings]{
  \label{fig:13:b}
  \includegraphics[width=0.5\textwidth]{fig10.eps}}

\caption{The strength distribution of the radio waves from the cell B4\_cell4}
\label{fig:13}

\end{figure*}

这里写图片描述

表格

\begin{table}[htb]
\setlength{\abovecaptionskip}{0pt}
\setlength{\belowcaptionskip}{10pt}
\label{tab:table1}       %从table1后自动编号
\caption{initial data}   %表格标题
\centering               %表格居中
\begin{tabular}{c l}     %开始画表格,c表示居中,l表示左对齐,r表示右对齐。
\toprule                 %最上面的表格线
Notations& Descriptions\\  %列与列之间用&隔开
\midrule                 %中间的表格线
b & 0.00001 \\
$\beta$ & 0.00006 \\
$\gamma$ & 0.002\\
$\delta$ & 0.3\\
$\alpha_1$ & 0.0001 \\
$\alpha_2$ & 0.3\\
$\epsilon$ & recovery rate.\\
\bottomrule              %最底下的表格线
\end{tabular}            %画表格结束
\end{table}

这里写图片描述

如果想跨越多页,将\begin{tabular}{c l} 改成\begin{longtable}{c l},须经两或三次编译,才能得到正确结果。

表格并列

\begin{table}
\begin{minipage}{0.49\textwidth}
\caption{}
\begin{tabular}{ll}
\hline\noalign{\smallskip}
Strength/dbm &Percentage \\
\noalign{\smallskip}\hline\noalign{\smallskip}
[$+\infty$, -60) &11.97\% \\
(-60, 75] &41.00\% \\
(-75, -95] &23.50\% \\
(-95, -110] &15.73\% \\
(-110,$-\infty$) &7.81\% \\
\noalign{\smallskip}\hline
\end{tabular}
\end{minipage}
\begin{minipage}{0.49\textwidth}
\caption{}
\begin{tabular}{ll}
\hline\noalign{\smallskip}
Types &Amount \\
\noalign{\smallskip}\hline\noalign{\smallskip}
Overall &5,469,445,032 \\
Direct  &6,938,764 \\
Reflect &239,316,548  \\
Diffraction &4,984,399,057 \\
Refraction &238,790,663 \\
\noalign{\smallskip}\hline
\end{tabular}
\end{minipage}
\end{table}

这里写图片描述

子表

\begin{table}
\caption{aabb}
\subtable[a]{
\begin{tabular}{lllll}
\hline\noalign{\smallskip}
 &WCS ($<-95$ dBm) &ECS &OCS &PM3CLS\\
\noalign{\smallskip}\hline\noalign{\smallskip}
Overall &23.54 &12.81 &4.40 &8.83\\
Outdoor  &14.72 &18.31 &7.64 &9.73\\
Indoor &25.55  &11.49 &3.62 &8.61\\
\noalign{\smallskip}\hline
\end{tabular}
}
\subtable[b]{
\begin{tabular}{lllll}
\hline\noalign{\smallskip}
 &WCS ($<-95$ dBm) &ECS &OCS &PM3CLS\\
\noalign{\smallskip}\hline\noalign{\smallskip}
Overall &23.54 &12.81 &4.40 &8.83\\
Outdoor  &14.72 &18.31 &7.64 &9.73\\
Indoor &25.55  &11.49 &3.62 &8.61\\
\noalign{\smallskip}\hline
\end{tabular}
}
\end{table}

这里写图片描述

公式
在线latex公式编辑器
http://latex.codecogs.com/eqneditor/editor.php

括住几个公式的大括号

$$ \left\{     %方程组的左边包括大括号\{
\begin{array}{rcl}  %方程组开始   
\frac{dS}{dt} & = & b-\beta SI-bS \\   % &表示列分隔符,\\表示行分隔符
\frac{dI}{dt} & = & \beta SI-(\gamma +\delta+b+\alpha_1)I\\
\frac{dQ}{dt} & = & \delta I-bQ-\alpha_2Q-\varepsilon Q\\
\frac{dR}{dt} & = & \gamma I+\varepsilon Q-bR \ t\neq nT,n=0,1,2,\ldots$$  
\end{array}         %方程组结束
\right. $$    %方程组的右边无符号,利用“.“来标示

这里写图片描述

\begin{align}
& \frac{dI}{dt}=kS(t)I(t)  \label{eq:rel1} \\
& \frac{dR}{dt}=li  \label{eq:rel2}\\
& \frac{dI}{dt}=kSI-\frac{dR}{dt}\label{eq:rel3} \\
& \frac{dS}{dt}=-kSI \label{eq:rel4}\\
& \frac{dI}{ds}=\frac{kSI-li}{-kSI}=\frac{\rho}S-1 \label{eq:rel5}\\
& S\mid_{t_0}=S_0=n-I_0 \label{eq:rel6}\\
& \rho=\frac{l}k \label{eq:rel7}\\
& I\mid_{S=S_0}=n-S_0 \label{eq:rel8}\\
& R(t)=\frac{\rho^2}S_0[(\frac{S_0}\rho+1)+\alpha th(\frac{\alpha lt}2-\psi)] \label{eq:rel9}\\
& R(t)=\sum^6_{i=0} m_it^i \label{eq:rel10}\\
& I(t)=\sum^6_{i=0} n_it^i \label{eq:rel11}
\end{align}

这里写图片描述

公式内换行

\usepackage{amsmath}

\begin{equation}
\begin{split}
&\mbox{if}\ h(0, j)=(h(0, j-1)+h(0, j+1))/2,\ p(0, j)\ \mbox{is removed}; \\
&\mbox{if}\ h(m, j)=(h(m, j-1)+h(m, j+1))/2,\ p(m, j)\ \mbox{is removed}; \\
&\mbox{if}\ h(i, 0)=(h(i-1, 0)+h(i+1, 0))/2,\ p(i, 0)\ \mbox{is removed}; \\
&\mbox{if}\ h(i, n)=(h(i-1, n)+h(i+1, n))/2,\ p(i, n)\ \mbox{is removed}; 
\end{split}
\end{equation}

这里写图片描述

\usepackage{bm}


\begin{equation}
\bm{n} \cdot (\bm{O} + \bm{d}t_{hit} - \bm{A}) = 0 
\end{equation}

这里写图片描述

调整公式大小

\begin{equation}
\resizebox{.91\hsize}{!}{$公式$}
\end{equation}

分条陈述

\section{Model I}     %主标题

\subsection{Basic Assumption}   %副标题
\begin{itemize}       %开始分条陈述
\item                 %第一条
We don't take the rate of nature born, mortality and migration in consideration.Meanwhile, compared with the rate of death, the rate of recovery is nearly zero, which can be ignored.
\item
 The data from World Health Organization shows that, humans are not infectious until they develop symptoms in the incubation period of Ebola. [1]
\item
We regard all Ebola transmission routes as touching the pathogen.
\end{itemize}

这里写图片描述

控制行间距

\vspace{2mm}

参考
http://www.docin.com/p-1557458572.html

展开阅读全文

没有更多推荐了,返回首页