今天介紹點latex的小細節
1 label
example:
我們加入
\begin{figure}[!htbp]\begin{center} \includegraphics[width = 0.4\textwidth]{wc.eps}\end{center} \caption{Performance comparison of venue prediction with varying number of topics, with the number of word to be 30 and 50} \label{fig:3050}\end{figure}
問引用時候用:
\ref{fig:3050}
2 標註:
\footnote{\url{http://wikitravel.org/}}
3 演算法:
\begin{algorithm}\caption{Dense Subgraph Detection}\label{Algorithm 1}\begin{algorithmic}[1]\renewcommand{\algorithmicrequire}{\textbf{Input:}}\renewcommand{\algorithmicensure}{\textbf{Output:}}\REQUIRE~~\\ Weighted adjacency array $A$ and an initialization $x(0)$;\\ Set $\mathbf{x} = x(0)$;\\\indent\textbf{Repeat:} \STATE \quad Update the partial derivative $g(\mathbf{x})$ with respect to each variable $x_i$; \STATE \quad Find a pair $(v_i, v_j)$ \STATE \quad Compute the best step size to maximize the increase the objective; \STATE \quad \textbf{Until:} $\mathbf{x}$ is a local maximizer; \STATE \quad \textbf{Output}: A KKT point $\mathbf{x}^*$\end{algorithmic}\end{algorithm}
4 table
這裡主要有一個如何在一個element裡面自動換行:
\begin{table}[!t]\caption{Venue Category Distribution}\label{tab:venuecategory}\centering\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}\begin{tabular}{|c|c|c|}\hline\hline %inserts double horizontal linesCategory & Number & Examples \\\hlineHotel & 6 & \tabincell{c}{Gardens By The Bay}\\\hlinePark & 3 & \tabincell{c}{Sands SkyPark}\\\hlineFood & 17 & \tabincell{c}{Trasapura Masters Food Court}\\\hlineShopping & 8 & \tabincell{c}{Marina Square}\\\hlineLandmark & 7 & \tabincell{c}{The Singapore Flyer} \\\hline\end{tabular}\label{table:venuecategory}\end{table}