Latex的一些技巧

今天介绍点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 lines
Category & Number & Examples \\
\hline
Hotel & 6 & \tabincell{c}{Gardens By The Bay}\\
\hline
Park & 3 & \tabincell{c}{Sands SkyPark}\\
\hline
Food & 17 & \tabincell{c}{Trasapura Masters Food Court}\\
\hline
Shopping & 8 & \tabincell{c}{Marina Square}\\
\hline
Landmark & 7 & \tabincell{c}{The Singapore Flyer} \\
\hline
\end{tabular}
\label{table:venuecategory}
\end{table}


你可能感兴趣的:(Latex)