latex學(xué)習(xí)之圖表和公式

一、數(shù)學(xué)公式輸入

1 使用mathtype

首先mathtpye中要設(shè)置為latex代碼,如下圖。設(shè)置后,在mathtype中輸入的公式復(fù)制后可變?yōu)榇a粘貼到texstudio中。

mathtpye頁面

例如:輸出為行列式方程

\[\left( \begin{array}{l}1\;\;4\;\;6\\2\;\;7\;\;8\\3\;\;8\;\;0\end{array} \right)\left( \begin{array}{l}{x_1}\\{x_2}\\{x_3}\end{array} \right) = \left( \begin{array}{l}2\\3\\4\end{array} \right)\]

\[\left( \begin{array}{l}1\;\;4\;\;6\\2\;\;7\;\;8\\3\;\;8\;\;0\end{array} \right)\left( \begin{array}{l}{x_1}\\{x_2}\\{x_3}\end{array} \right) = \left( \begin{array}{l}2\\3\\4\end{array} \right) \eqno (2)\]

加入\eqno (2)為公式編號,其他不曉得一堆什么東西,這就不用學(xué)代碼了哈哈哈哈哈哈

2 下面是一些標簽符號

% 定理 ? \begin{Theorem} \end{Theorem}

% 引理 ? \begin{Lemma} \end{Lemma}

% 證明 \begin{proof} \end{proof}


這一part暫時沒啥要寫的了?



二、插入圖表

1 圖片

插入一張圖片

\begin{figure}[h]

\small ? ? ? ? ? ? ? ? ? ? ?

\centering ? ? ? ? ? ? ? ? ? ? %居中

\includegraphics[width=8cm]{example-image-a} ? ? ? ? ? ? ?? %寬度高度? 圖片a

\caption{The name of figure}

\label{fig:aa} ? ? ? ? ? ? %標題

\end{figure} ? ? ?

成功了嘿嘿

插入并列圖片

需要的宏包是:\usepackage{subfigure},要放在引言部分。

使用方法是\subfigure[單個圖片的名稱]{\includegraphics[圖片參數(shù)]{文件夾中圖片名稱}}

代碼:

\begin{figure}[h]?

\centering

\subfigure[1]{

\includegraphics[width=0.45\textwidth]{1} } ? ?

\subfigure[2]{ ? ?

\includegraphics[width=0.45\textwidth]{2}} ? ?

\caption{The price terms} ? ?

\label{The price terms} ? ?

\end{figure}

又成功了嘿嘿

2? 表格

普通環(huán)境tabular

\begin{tabular}{|l|c|r|} ?? # |l|c|r|:第一列居左第二列居中第三列居右,四條豎線代表表格框架的四條豎線

\hline #畫第一條橫線

指標1&指標2&指標3\\? #每一列用&隔開,最后以\\結(jié)尾

\hline #畫第二條橫線

居左&居中&居右\\

\hline?#畫第三條橫線

\end{tabular}

三線表

\begin{center}

\begin{spacing}{1.1}

%longtable的意思是 這個表格可以跨頁

\begin{longtable}{p{.1\textwidth}p{.7\textwidth}m{.3\textwidth}}

\caption{description}

\label{table1}

? ? \toprule? %第一行線

? ? %表示第一列占1.5cm 第二列占6cm 第三列占2cm 的距離 并且這幾個字都是居中對齊

? ? \multicolumn{1}{m{1.5cm}}{\centering Symbol} & \multicolumn{1}{m{6cm}}{\centering Definition} & \multicolumn{1}{m{2cm}}{ Unit} \\

? ? \midrule? %第二行線

? ? $V$ & index & -- \\

? ? $X$ & The? & -- \\

? ? $Y$ & The & -- \\

? ? $Z$ & The? & -- \\

? ? \bottomrule? %第三行線

\end{longtable}

\end{spacing}

\end{center}

三線表


更復(fù)雜的

\begin{table*}[]

\scriptsize

\centering

\caption{Optimized results of the circular arch for different slenderness and opening angles}

\label{Tab03}

\begin{tabular}{cccccccccc}

\toprule

\multirow{2}{*}{Opening angle} & \multicolumn{3}{c}{$R/r=10$} & \multicolumn{3}{c}{$R/r=25$} & \multicolumn{3}{c}{$R/r=50$} \\

\cmidrule(r){2-4} \cmidrule(r){5-7} \cmidrule(r){8-10}

&? $\omega_{1} (\%)$? ? ? &? $r_{{\rm min}}/r_0$? ?&? ?$r_{{\rm max}}/r_0$

&? $\omega_{1} (\%)$? ? ? &? $r_{{\rm min}}/r_0$? ?&? ?$r_{{\rm max}}/r_0$

&? $\omega_{1} (\%)$? ? ? &? $r_{{\rm min}}/r_0$? ?&? ?$r_{{\rm max}}/r_0$? \\

\midrule

$\varphi=60^{\circ} $? ? ? ? ? ? ?&3.920? ? ? ? ? ? ? ? ? ? ? ? ? & 0.793? ? ? ? ? ? ? ? ? ? & 1.355? ? ? ? ? ? ? ? ? ?& 5.243? ? ? ? ? ?& 0.558? ? ? ? ? ?& 1.122? ? ? ? ? & 6.694? ? ? ? ? ?& 0.503? ? ? ? ? ?& 1.133? ? ? ? ? \\

$\varphi=90^{\circ} $? ? ? ? ? ? ?&4.061? ? ? ? ? ? ? ? ? ? ? ? ? & 0.660? ? ? ? ? ? ? ? ? ? & 1.106? ? ? ? ? ? ? ? ? ?& 7.242? ? ? ? ? ?& 0.500? ? ? ? ? ?& 1.136? ? ? ? ? & 8.060? ? ? ? ? ?& 0.501? ? ? ? ? ?& 1.140? ? ? ? ? \\

$\varphi=120^{\circ} $? ? ? ? ? ? ?&6.480? ? ? ? ? ? ? ? ? ? ? ? ? & 0.558? ? ? ? ? ? ? ? ? ? & 1.127? ? ? ? ? ? ? ? ? ?& 9.011? ? ? ? ? ?& 0.500? ? ? ? ? ?& 1.145? ? ? ? ? & 9.535? ? ? ? ? ?& 0.500? ? ? ? ? ?& 1.147? ? ? ? ? ?\\

$\varphi=150^{\circ} $? ? ? ? ? ? ?&8.756? ? ? ? ? ? ? ? ? ? ? ? ? & 0.500? ? ? ? ? ? ? ? ? ? & 1.142? ? ? ? ? ? ? ? ? ?& 10.763? ? ? ? ? ?& 0.500? ? ? ? ? & 1.153? ? ? ? ? & 11.126? ? ? ? ? ?& 0.500? ? ? ? ? & 1.155? ? ? ? ? ? \\

\bottomrule

\end{tabular}

\end{table*}

太麻煩了

實在是太太太太太太麻煩了,所以還是excel轉(zhuǎn)latex表吧。

用excel2latex ,下載見這篇https://blog.csdn.net/LF21011501/article/details/89684798

生成latex代碼

代碼直接復(fù)制過去會很丑,還需要調(diào)整。

丑丑丑

把上方代碼cc換成p{2cm}p{3cm}l,即

\begin{tabular}{p{2cm}p{3cm}l} ? ? ?? #設(shè)置列的寬度

還是很丑


圖表學(xué)到這里!


三、字體字號

Latex 設(shè)置字體大小命令由小到大依次為:

\tiny

\scriptsize

\footnotesize

\small

\normalsize

\large

\Large

\LARGE

\huge

\Huge

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容