文章目錄
- LaTeX排版論文的常見問題匯總(持續更新中)
- 1.如何上傳期刊或會議提供的LaTeX模板?
- 2.模板中各文件的說明
- 3.LaTeX中如何設置字體大小?
- 3.1如何設置表格中的字體大小?
- 3.2如何設置表格、圖片標題的字體大小?
- 3.3LaTeX設置字體大小命令(由小到大)
- 4.LaTeX表格字數過多時,如何設置自動換行?
- 5.LaTeX表格里面的元素如何實現水平和垂直居中?
- 6.表格過寬或者表格過窄時如何調整?
- 7.如何創建用于跨越兩欄的表格或者圖片?
- 8.LaTeX中如何設置點擊引用跳轉?
LaTeX排版論文的常見問題匯總(持續更新中)
LaTeX是我們用于排版的一個工具,在這里推薦大家使用overleaf去編寫自己的LaTeX代碼。當我們想要投稿期刊或會議時,首先我們需要找到其提供的相應論文模板(可以參考這篇博客期刊LaTeX模板下載,點擊跳轉),然后我們上傳模板到overleaf中,根據模版的內容就可以仿照給出的例子開始編寫。通過參照模板,整體格式布局我們很好的就可以進行把控,但是涉及到圖片、表格以及公式,當前提供的案例語法可能并不適用于我們的需求,基于這樣的問題,我針對表格、圖片和公式單獨做了教程,鏈接如下:
- LaTeX-設置圖像大小
- LaTeX-設置表格大小
- LaTeX-設置圖像與表格位置
- LaTeX-設置公式長度
除此之外,本文總結了在排版論文時所遇到的一些常見問題以及一些必要的知識,供大家參考查閱。
1.如何上傳期刊或會議提供的LaTeX模板?
在項目管理頁面單擊【創建新項目=> 上傳項目】,上傳項目壓縮包。
2.模板中各文件的說明
.tex
文件,主文檔文件,編寫LaTeX代碼的地方。.bst
文件,定義文獻引用格式,用于指定參考文獻的排列方式。.bib
文件,BibTeX數據庫文件,存放參考文獻的地方。.ins
文件,安裝文件(不用管).dtx
文件,文檔化的TeX文件(不用管)
3.LaTeX中如何設置字體大小?
3.1如何設置表格中的字體大小?
\begin{table}\tiny %將表格字體設置為tiny\begin{tabular}
\end{tabular}
\end{table}
3.2如何設置表格、圖片標題的字體大小?
使用caption
包全局或局部設置標題的樣式。使用這種方法,首先需要在文檔開頭使用\usepackage{caption}
命令來導入包。然后,可以使用\captionsetup
命令來全局或局部設置標題樣式。
- 全局設置示例
\documentclass[twocolumn]{article}
\usepackage{caption}
\usepackage{tabularx}
\captionsetup[table]{font=large} % 將所有表格標題的字體設置為大號
\captionsetup[figure]{font=large} % 將所有圖片標題的字體設置為大號\begin{document}\begin{table*}[t]
\caption{Table to test captions and labels.}
\label{table1}
\begin{tabularx}{\linewidth}{l X}
\hline
Notation & Description \\ \hline
$A^i$ & The $i$th row of matrix A \\
$A_j$ & The $j$th column of matrix A \\
$A_{ij}$ & The element at the $i$th row and the jth column of matrix A \\
$R^{k}$ & The k-dimensional Euclidean space \\
$e_k^i(or \ e^i)$ & The $i$th vector of the standard orthonormal basis in $R^k$ \\
$l_k$ & a k-dimensional vector with all its entries being $l$ \\
$supp(v)$ & The support of vector $v$ \\
$\Delta_k$ & The standard (k-1)-simplex \\
$(R,C)$ & A bimatrix game with payoff matrices $R$ and $C$ \\
$m$ & The number of row player's pure strategies \\
$n$ & The number of column player's pure strategies \\
$(x,y)$ & A strategy profile that row player chooses x and column palyer chooses y \\ \hline
\end{tabularx}
\end{table*}\end{document}
- 局部設置示例
只想對特定的表格應用這個設置,可以將\captionsetup
命令放在表格環境內部,這樣它就只會影響該表格。
\begin{table}[h]
\centering
\captionsetup{font=small}
% Table Contents
\caption{This is a small font for the table title}
\end{table}
3.3LaTeX設置字體大小命令(由小到大)
\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge
4.LaTeX表格字數過多時,如何設置自動換行?
添加包\usepackage{tabularx}
,使用tabularx
環境。在tabularx
環境中,X
列類型是用來指定應該自動調整寬度并自動換行的列。每個X
列都會根據表格的總寬度來自動調整其寬度。(注意,X必須大寫
)參考案例如下:
\begin{table}[h]
\begin{tabularx}{\textwidth}{|l|X|}
\hline
Notation & Description \\
\hline
Testing line breaks & Though Multimodal Sentiment Analysis (MSA) proves effective by utilizing rich information from multiple sources (e.g., language, video, and audio), the potential sentiment-irrelevant and conflicting information across modalities may hinder the performance from being further improved. To alleviate this \\
\hline
\end{tabularx}
\end{table}
【補充】LaTeX表格內強制換行語法:\newline
5.LaTeX表格里面的元素如何實現水平和垂直居中?
在同一個表格中實現水平居中和垂直居中,可以使用array
包中的m{寬度}
列類型。添加包\usepackage{array}
,參考案例如下:
\begin{table}[h]
\begin{tabular}{|m{3cm}|m{8.2cm}|} %調整具體的值,適應你的需求
\hline
Notation & Description \\
\hline
Testing line breaks & Though Multimodal Sentiment Analysis (MSA) proves effective by utilizing rich information from multiple sources (e.g., language, video, and audio), the potential sentiment-irrelevant and conflicting information across modalities may hinder the performance from being further improved. To alleviate this \\
\hline
Testing line breaks & Though Multimodal Sentiment Analysis (MSA) proves effective by utilizing rich information from multiple sources (e.g., language, video, and audio), the potential sentiment-irrelevant and conflicting information across modalities may hinder the performance from being further improved. To alleviate this \\
\hline
\end{tabular}
\end{table}
6.表格過寬或者表格過窄時如何調整?
建議大家使用tabularx
環境創建表格,tabularx
環境不會出現這樣的問題。如果使用tabular
環境,出現這樣的問題,也是有應對辦法的。解決辦法如下:(此方法同樣可以用于調整圖片大小)
解決辦法:使用\resizebox
命令。
在LaTeX中,\resizebox
命令用于調整盒子(例如文字、圖片、表格等)的大小,以使其適應指定的寬度和高度。\resizebox
命令來自graphicx
包,因此在使用之前需要確保已經用\usepackage{graphicx}
導入了該包。
\resizebox
命令的基本語法是:\resizebox{寬度}{高度}{內容}
。
寬度
是你希望盒子調整后的寬度,可以是具體數值(如4cm
、100pt
等),也可以是\textwidth
(使寬度與文本寬度相同),或者!
(表示寬度會自動調整以保持高度比例)。高度
是你希望盒子調整后的高度,同樣可以是具體數值或!
。內容
是需要調整大小的對象。
\begin{center}
\resizebox{\textwidth}{!}{
\begin{tabular}{cccccccccccc}
Models & $\hat c$ & $\hat\alpha$ & $\hat\beta_0$ & $\hat\beta_1$ & $\hat\beta_2$ & Models & $\hat c$ & $\hat\alpha$ & $\hat\beta_0$ & $\hat\beta_1$ & $\hat\beta_2$ \\ \hline
model & 30.6302 & 0.4127 & 9.4257 & - & - & model & 30.6302 & 0.4127 & 9.4257 & - & -\\
model & 12.4089 & 0.5169 & 18.6986 & -6.6157 & - & model & 30.6302 & 0.4127 & 9.4257 & - & - \\
model & 14.8586 & 0.4991 & 19.5421 & -7.0717 & 0.2183 & model & 30.6302 & 0.4127 & 9.4257 & - & - \\
model & 3.06302 & 0.41266 & 0.11725 & - & - & model & 30.6302 & 0.4127 & 9.4257 & - & - \\
model & 1.24089 & 0.51691 & 0.83605 & -0.66157 & - & model & 30.6302 & 0.4127 & 9.4257 & - & - \\
model & 1.48586 & 0.49906 & 0.95609 & -0.70717 & 0.02183 & model & 30.6302 & 0.4127 & 9.4257 & - & - \\
\end{tabular}}
\end{center}
【注意】雖然\resizebox
很強大,但過度使用可能會導致文檔中的元素比例失衡,特別是當你同時強制調整寬度和高度而不保持原始寬高比時。此外,對文本內容使用\resizebox
可能會導致字體大小不一致。所以推薦使用tabularx
環境創建表格。
7.如何創建用于跨越兩欄的表格或者圖片?
在LaTeX中,table*
環境用于創建跨越兩欄的寬表格,figure*
環境用于創建跨越兩欄的圖片。它們將占據整個頁面的寬度,而不是僅僅占據一欄。
\begin{figure*}\centering\includegraphics[width=\linewidth]{1}\caption{Three Categories of Distributed Nash Equilibrium Seeking Strategies}\label{fig:enter-label}
\end{figure*}
\begin{table*}
\centering
\begin{tabular}{cc}
% 內容
\end{tabular}
\end{table*}
【注意】在雙欄格式中,通常不可以使用[h]
或[b]
位置參數來控制表格或圖片的精確放置,但可以使用[t]
或[p]
位置參數來控制表格或圖片的精確放置。
8.LaTeX中如何設置點擊引用跳轉?
通過包hyperref
實現點擊引用跳轉到相應的文獻處、圖片處以及表格處。
\usepackage{hyperref}
引用文獻:\cite{name}
引用圖片或表格:\ref{label_name}
😃😃😃