1. 程式人生 > >LaTeX快速上手--十分鐘掌握髮論文常用技能

LaTeX快速上手--十分鐘掌握髮論文常用技能

目錄

常用包

\usepackage{times}  %Required
\usepackage{helvet}  %Required
\usepackage{courier}  %Required
\usepackage{url}  %Required
\usepackage{graphicx}  %Required
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage{algorithmicx}  
\usepackage{algpseudocode}  
\usepackage{multirow}

常用記號

 \frac{}{}
 \overrightarrow
 \textbf
 \hat
 \propto 
 \left \|  \right \|
 \left \  \right \
 \mathcal
 \partial
 \alpha
 \beta
 \lambda
 \theta
 \times
 \div

這裡寫圖片描述

演算法

\begin{algorithm}[htb]
  \caption{ ... Framework}
  \label{alg:Framwork}
  \begin{algorithmic}[1]
    \Require
	  in...
    \Ensure
      out...
    \State Construct ...
\Repeat \State Apply ... \Until{converge} \For{each $edge(u_i, v_j)\in E$} \State Update ... \EndFor \Return ... \end{algorithmic} \end{algorithm}

公式

\begin{equation}
Precision = \frac {TP}{TP + FP}
\end{equation}

圖片

\begin{figure}[h]%% fig
	\centering  %
center \includegraphics[width=0.7\linewidth]{figures/metric_curve} % location \caption{Performance comparison visualization.} % name \label{fig:metric_curve} % for reference \end{figure}

表格

\begin{table*}
\begin{center}
\caption{。。。}
	\begin{tabular}{|c|c|c|c|c|}
	\hline
	\multirow{2}{*}{Multi-Row}&
	\multicolumn{2}{c|}{Multi-Column}&
	\multicolumn{2}{c|}{\multirow{2}{*}{Multi-RowandCol}} \\
	\cline{2-3}
	  & column-1&column-2 & \multicolumn{2}{c|}{}\\
	\hline
	label-1 & label-2&label-3 & label-4& label-5\\
	\hline
	\end{tabular}
\end{center}
\end{table*}

腳註

\footnote

作者上角標

\author{Lily\textsuperscript{1}        \and
        Alexw\textsuperscript{2}  
}

通訊作者的小信封標識

\usepackage[misc]{ifsym}
\begin{document}
\institute{ \Letter  Alexw\at
}

引用

\cite{Shen2012Learning}      % 編譯之前 至少引用一次 ,否則會出錯,引用bib檔案第一行,ref.bib檔案如下,自己對號入座。

\bibliographystyle{aaai}     % 對應下圖的 aaai.bst
\bibliography{ref}           % 對應下圖的 ref.bib

這裡寫圖片描述

ref.bib 檔案格式如下,可以通過百度文庫自動匯出,這裡就不講了,有興趣去查。

@inproceedings{Shen2012Learning,
  title={Learning personal + social latent factor model for social recommendation},
  author={Shen, Yelong and Jin, Ruoming},
  booktitle={Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining},
  pages={1303-1311},
  year={2012},
 keywords={personal + social factor;social recommender system},
 abstract={Social recommendation, which aims to systematically leverage the social relationships between users as well as their past behaviors for automatic recommendation, attract much attention recently. The belief is that users linked with each other in social networks tend to share certain common interests or have similar tastes (homophily principle); such similarity is expected to help improve the recommendation accuracy and quality. There have been a few studies on social recommendations; however, they almost completely ignored the heterogeneity and diversity of the social relationship. In this paper, we develop a joint personal and social latent factor (PSLF) model for social recommendation. Specifically, it combines the state-of-the-art collaborative filtering and the social network modeling approaches for social recommendation. Especially, the PSLF extracts the social factor vectors for each user based on the state-of-the-art mixture membership stochastic blockmodel, which can explicitly express the varieties of the social relationship. To optimize the PSLF model, we develop a scalable expectation-maximization (EM) algorithm, which utilizes a novel approximate mean-field technique for fast expectation computation. We compare our approach with the latest social recommendation approaches on two real datasets, Flixter and Douban (both with large social networks). With similar training cost, our approach has shown a significant improvement in terms of prediction accuracy criteria over the existing approaches.},
}

...

檔案都有了,接下來就是編譯執行,有四步流程
- LaTeX編譯 % 編譯整篇文件
- BibTeX編譯 % 載入bib檔案
- LaTeX編譯 % 重新編譯
- LaTeX編譯 % 這時才會在正文中出現正確引用

Misplaced alignment tab character &

在用latex匯入參考文獻時,有時會出現這種錯誤,原因在於參考文獻中出現了&,這是我們在前面加上\就可以了。即 
& -> \& 

LaTeX Error: Something’s wrong–perhaps a missing \item.

確保在 .tex檔案的正確位置引用了至少一篇參考文獻, 如 \cite{Shen2012Learning} 
確保 .bib檔案中有上面引用的這篇paper1;
刪除 .bbl檔案,重新編譯即可。