latex使用筆記

1:空一行表明分節html

2:讓圖片在指定位置插入app

使用包  \usepackage{float}less

 插入圖片代碼ide

\begin{figure}[H]  //圖片標籤
    \centerline{\includegraphics[width=\columnwidth]{fig1.jpg}} // 加載圖片
    \caption{Magnetization as a function of applied field.   //標註
        It is good practice to explain the significance of the figure in the caption.}
    \label{fig1}    //標籤
\end{figure}

 

3:\par   圖表內換行 字體

4: _下標   ^上標spa

5:\mathit  數學斜體 \textit{$ 文本 $}文本斜體,$B$  數學中的B變量,.net

6: \tag{}  公式標號 code

7:數學符號對照表 http://blog.csdn.net/caiandyong/article/details/53351737orm

8:\qquad  大空格 ,\quad  小空格  \  \後面幾個空格就是幾個空格,能夠用於數學公式中htm

9:$$  裏面加數學公式,單獨佔一行,$裏面放數學公式,不佔一行。

10:使多行公式左對齊  http://blog.sina.com.cn/s/blog_629f79b1010190r3.html

%多行左對齊,帶編號
\begin{equation}\label{eq:12}
\begin{split}
& \mathit{R_i}=1 \\
& \mathit{R_j}=2 \\
\end{split}
\end{equation}

 

\begin{align*}  //每行前面會有空格 ,不能夠用mathit
& \textit{$N$}_\textit{$n$}=number\ of\ elements\ in\ ring\ n; \\
& \textit{$H$}= number\ of\ rings; \\
\end{align*}


\begin{flushleft}  //自定義前面的空格
$\qquad\mathit{N}_\mathit{n}=number\ of \ elements \ in\ ring\ n;$
\end{flushleft}

11:矩陣公式

% 矩陣公式
$$X=\left(
\begin{matrix}
x_{11} & x_{12} & \cdots & x_{1d}\\
x_{21} & x_{22} & \cdots & x_{2d}\\
\vdots & \vdots & \ddots & \vdots\\
x_{m1} & x_{m2} & \cdots & x_{md}\\
\end{matrix}
\right)
=\left(
\begin{matrix}
x_1^T \\
x_2^T \\
\vdots\\
x_m^T \\
\end{matrix}
\right)
$$

12:大括號公式:

$$  %不產生標號
\left\{ 
\begin{array}{c}
    a_1x+b_1y+c_1z=d_1 \\ 
    a_2x+b_2y+c_2z=d_2 \\ 
    a_3x+b_3y+c_3z=d_3
\end{array}
\right. 
$$

% 大括號公式
\begin{equation}   %產生標號
%$$
\left\{ 
\begin{array}{c}
Min \{PSLL(\mathit{r_0,r_1,r_2,...,r_n,r_H}) \} \\

\mathit{N_n}=\left \lfloor \frac{2\pi\mathit{r_n}}{\mathit{d_n}} \right \rfloor, 0<\mathit{d_c}\leqslant \mathit{d_n},n=1,2,...,\mathit{H} \\

\sum_{\mathit{n}=0}^\mathit{H}=\mathit{N}
  
\end{array}
\right.
\tag{3} %自定義標號
%$$
\end{equation}
 
 

 

 

 13:大括號 要用\{ \}標記

 14:橫除號表示:\frac  橫除號,第一個大括號是上面的部分,第二個大括號是下面的部分。

\frac{2\pi\mathit{r_n}}{\mathit{d_n}}

 15:latex中各類括號的表示:http://blog.csdn.net/han____shuai/article/details/49679335

16: 當下標是公式時,要用{} 括起來

r_{n-1}

 17:出現錯誤提示:Missing $ inserted. where \xi

       是由於 \xi 在數學公式中才能使用,須要在 $$ 數學公式中使用   

 18 表格的操做:http://blog.csdn.net/JueChenYi/article/details/77116011

 
 

\begin{table}[!htbp] 

{table}有若干可選參數 [!htbp] 
h表明here,將表格排在當前文字位置 
t 表示將表格放在下一頁的 top (頁首) 
b 表示將表格放在當前頁的 bottom (底部) 
!表示忽略美觀因素,儘量按照參數指定的方式來處理表格浮動位置。 
表格將會按照所給參數,依次嘗試按照每一個參數進行排版,當沒法排版時,將會按照下一個參數

\centering  %整個表格居中

\caption{Units for Magnetic Properties}  %標題
\label{table} 
\setlength{\tabcolsep}{3pt}
\begin{tabular}{|p{25pt}|p{75pt}|p{115pt}|}  %表格  ,| 列線,c居中,75pt指定大小等

\hline  橫線  
 \cline{2-4}是指在第2-4列上面插入框線

\multicolumn{3}{|c|}{學生信息}\\ % 用\multicolumn{3}表示橫向合併三列 
                        % |c|表示居中而且單元格兩側添加豎線 最後是文本

    \end{tabular}
\caption{這是一張三線表} %放在表格下面的標題 \label{tab1} \end{table}

 19:

表格橫排:使用 \usepackage{rotating}  %使表格橫排整個頁面

\iffalse %表格橫排
\begin{sidewaystable}
\centering
\begin{threeparttable}[b]
\caption{Survey of bond lengths.tnote{a}}
\label{Tab:bondleng}
\begin{tabular}{ccccccccccc}
hello,hdjsklagnkdjkgksjdfffffffffffffffffffffffffffffffffffff
\end{tabular}
\begin{tablenotes}
\item [a] { } 
\end{tablenotes}
\end{threeparttable}
\end{sidewaystable}
\clearpage
\fi

 20:&   格式對齊符號

 21:表格佔據兩欄格式下整個頁面,

環境可用在雙欄版式中插入通欄的浮動的表格啊

   \begin{table*}

   \end{table*}

22:表格多行合併

TABLE 1

\begin{table*}[!htbp]

    \centering
    \caption{ HYBRID GENETIC ALGORITHM 
        (HGA), PEAK SIDELOBEL LEVEL (PSLL),MODIFIED REAL GENETIC ALGORITHM(MGA), NUMBER OF ELEMENTS(N), RUN TIME(RT), RING 
        RADII( ), AND NUMBER OF ELEMENTS IN THE RINGS ( ) 
    }
    \label{table}
    \setlength{\tabcolsep}{3pt} %列間距
    \begin{tabular}{p{25pt}p{75pt}p{15pt}p{25pt}p{25pt}p{25pt}p{25pt}p{25pt}p{25pt}p{25pt}p{25pt}p{25pt}}
        \hline
        method& PSLL(dB)& RT&N&n&1&2&3&4&5&6&7  \\
        \hline
%        \multicolumn{4}{c}{te}
        \multirow{2}*{HGA}&\multirow{2}*{HGA}&\multirow{2}*{HGA}&\multirow{2}*{bHGA}
        &r&1.00&1.59&1.59&1.59&1.59&1.59&1.59\\
        \cline{5-12}
        & & & &n&1.59&1.59&1.59&1.59&1.59&1.59&1.59 \\
        \hline
    \end{tabular}
    \label{tab1}
\end{table*}

TABLE2

\begin{table*}
\centering  
\caption{Parameters of SROI} 
\label{tab2} 
\begin{tabular}{cccccccc}
     \hline  
     \multicolumn{1}{c}{\multirow{2}{1.2cm}{Number}} 
     &\multicolumn{5}{c}{(Frequency, Scale)}  &\multicolumn{1}{c}{\multirow{2}{1.6cm}{Direction Number}} &\multicolumn{1}{c}{\multirow{2}{1.6cm}{Direction Increment}} \\  
     \cline{2-6}  \multicolumn{1}{c}{}  &\multicolumn{1}{c}{1} & {2} & {3} & {4} & {5} &\multicolumn{1}{c}{} \\ \hline  Filter bank1 &(0.50,61)&(0.50,67)&(0.55,61)&(0.55,66)&(0.60,51)&8&$\pi/8$ \\ 
     \hline
   \end{tabular}
 \end{table*}

 

      

23:在新的一頁最上方,將文字或圖片 ,跨雙欄,居中,置頂 ,的方法

\clearpage  %新的一頁
\usepackage{stfloats} %置頂 \newcounter{TempEqCnt} \begin{figure*}[ht] %[hb置地] \caption{Diagram of a concentric ring array.} \label{fig1} \end{figure*}
\clearpage

    不帶圖片標題,只含文字的居中

    

\clearpage
\newcounter{TempEqCnt}
\begin{figure*}[ht]
\centering\fontsize{16}{18}\selectfont
             Front page
\end{figure*}
\clearpage

 

24:圖片排列

\usepackage{graphicx}
\usepackage{subcaption}  %圖片%圖片,多個圖方便的放在一塊兒
%圖片
\begin{figure*}[htb]
    \centering
    \begin{subfigure}[b]{.22\linewidth}   %下面文字標註的長度
        \centering
        \includegraphics[width=4.5cm,height=3.5cm]{fig2.png}
        %\caption{A subfigure}\label{fig:1a}
        Fig. 2. Convergence characteristics
    \end{subfigure}
    \begin{subfigure}[b]{.23\linewidth}
    \centering
    \includegraphics[width=4.5cm,height=3.5cm]{fig3.png}
    Fig. 3.Radiation pattern of the
    best optimal result.
\end{subfigure}
    \begin{subfigure}[b]{.28\linewidth}
    \centering
    \includegraphics[width=4.5cm,height=3.5cm]{fig4.png}
    Fig. 4. Cross section of radiation pattern
    in $\mathit{u=0}$   and $\mathit{v=0}$ 
\end{subfigure}
    \begin{subfigure}[b]{.25\linewidth}
    \centering
    \includegraphics[width=4.5cm,height=3.5cm]{fig5.png}
    Fig. 5. The layout of the best sparse concentric ring array
\end{subfigure}  \\     %換行
     \begin{subfigure}[b]{.23\linewidth}
     \centering
     \includegraphics[width=4.5cm,height=3.5cm]{fig6.png}
Fig. 6. Convergence characteristics of simulation B
 \end{subfigure}
 \begin{subfigure}[b]{.23\linewidth}
     \centering
     \includegraphics[width=4.5cm,height=3.5cm]{fig7.png}
    Fig. 7.Radiation pattern of the
best optimal result in simulation B.
 \end{subfigure}
 \begin{subfigure}[b]{.26\linewidth}
     \centering
     \includegraphics[width=4.5cm,height=3.5cm]{fig8.png}
    Fig. 8. Cross section of radiation pattern
in $\mathit{u=0}$ and $\mathit{v=0}$  in simulation B.
 \end{subfigure}
 \begin{subfigure}[b]{.24\linewidth}
     \centering
     \includegraphics[width=4.5cm,height=3.5cm]{fig9.png}
 Fig. 9. The layout of the best sparse array in simulation B
 \end{subfigure}    
\end{figure*}

 25:最後一頁底部對齊

         a:  直接使用 :\usepackage{flushend}  %底部對齊

        b:使用\newpage  能夠手動調整右欄內容從哪裏開始,能夠用在\clearpage命令裏面

    

3:\balance 能夠放在一頁末尾,系統自動對齊,須要引入\usepackage{balance} 

 

 26:  分欄

%方法1
\documentclass[UTF8]{ctexart}
\usepackage{multicol}
\usepackage{mwe}
\begin{document}
\begin{abstract}
  這裏是摘要。\blindtext
\end{abstract}
\begin{multicols}{2}  %指定兩行
這裏是正文。\lipsum[1-5]
\end{multicols}
\end{document}

%方法2
\documentclass[UTF8, twocolumn]{ctexart} %在開頭指定兩行
\usepackage{mwe}
\usepackage{abstract}
\begin{document}
\twocolumn[
  \begin{onecolabstract}  %摘要一行
    這裏是摘要。\blindtext
  \end{onecolabstract}
]

這裏是正文。\lipsum[1-5]
\end{document}

 27 設置頁邊距:加入

      

\usepackage{anysize}
\marginsize{2cm}{2cm}{2cm}{2cm}  %設置頁邊距

 28:設置小標題 \section 居左,使用:

\usepackage[raggedright]{titlesec}%設置section標題居左顯示

 29:向量,矩陣的表示方法 https://jingyan.baidu.com/article/f3e34a128c53aef5ea653542.html

\begin{equation}
U=\vec{R}+j\vec{N}  %\vec向量
\begin{bmatrix}  %矩陣
r_1+jN_1 \\
r_2+jN_2 \\ 
......   \\ 
r_n+jN_n \\ 
......   \\
r_H+jN_H \\ 
\end{bmatrix}
\label{eq}\tag{7}
\end{equation}

 

 29:加入連接

 

\documentclass{report}
\usepackage[explicit]{titlesec}
\usepackage{hyperref}

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}
  {\Huge\hyperlink{chap\thechapter}{#1}}
\titleformat{name=\chapter,numberless}[display]
  {\normalfont\huge\bfseries}{}{-22pt}
  {\Huge#1}

\makeatletter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
  \refstepcounter{chapter}%
  \typeout{\@chapapp\space\thechapter.}%
  \addcontentsline{toc}{chapter}%
    {\protect\numberline{\thechapter}\string\hypertarget{chap\thechapter}{#1}}%
\else
  \addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
  \@topnewpage[\@makechapterhead{#2}]%
\else
  \@makechapterhead{#2}%
  \@afterheading
\fi}
\makeatother

\begin{document}

\tableofcontents
\chapter{Test Chapter One}
\chapter{Test Chapter Two}
\chapter{Test Chapter Three}

\end{document}

 30:latex設置字體顏色

1.組合red、green和blue的值合成咱們想要的顏色
\usepackage{color}
\textcolor[rgb]{r,g,b}{text}
其中{r,g,b}表明red、green和blue三種顏色的組合,取值範圍爲[0-1]
31:使整篇文章標題caption 居中用:
\usepackage[justification=centering]{caption}
32:在cls文件中自定義環境,例如:
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{SimSun}
\newenvironment{mytest}{\begin{equation}}{\end{equation}}
\begin{document}
    \begin{mytest}
        1+1=2;
    \end{mytest}
\end{document}

 33: 給中文加粗:\bf

\begin{bf}
摘要
\end{bf}

34:公式中含有\lable{}  時,latex轉word,此公式將轉化不了
\begin{equation}
\mathit{F(X)}=a(\sin(X-\pi))+b((X-10)^2)+c \\
\label{eq} 須要去掉
\end{equation}

 35:latex中使用換行符:

 

\begin{equation}
    \begin{aligned}
    B'&=-\partial \times E,\\
        & \partial \times B - 4\pi j,
    \end{aligned}
\end{equation}

 

 

 36 :latex中輸入羅馬數字:

\uppercase\expandafter{\romannumeral20}

將輸入大寫羅馬數字20,

\romannumeral20

 

將輸入小寫羅馬數字20。

37: 在Latex中插入eps圖片或者表格時有時想控制圖片或表格的位置,只須要在\begin{figure}後加入[!htbp],可是當表格或者圖片佔用雙欄模板的兩欄時(即在\begin{table*}時),這些位置控制選項就失效了。例如:

\begin{figure}[!htbp]

其中htbp是可選的,它們分別表明

!-忽略「美學」標準

h-here

t-top

b-bottom

p-page-of-its-own

 

38:latex中製做斜線頭

加入包diagbox

\diagbox[width=5em,trim=l]{Time}{Day}

39:表格換行:https://zhidao.baidu.com/question/556615887760105052.html

相關文章
相關標籤/搜索