Latex的一些技巧

來源:互聯網
上載者:User

今天介紹點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}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.