latex tips

All kinds of details regarding to use the latex in writing paper.

http://www.mohu.org/info/lshort-cn.pdf

注意在表格编译的时候 ccc的地方标记的是具体有多少列 这个小错误很容易忽略然后造成表格显示不全面

使用bibtex的时候可以参考这个

注意只有cite之后的引用才会在文章中显示出来 没有cite的话就不会显示

多行公式

叠加

3、上标和下标
用 ^ 来表示上标,用 _ 来表示下标,看一简单例子:

$$\sum_{i=1}^n a_i=0$$

latex中输入罗马数字
http://blog.sina.com.cn/s/blog_5e16f1770100g5sl.html

不使用首行的缩进
https://tex.stackexchange.com/questions/27802/set-noindent-for-entire-file

使用reference不需要manually的方式直接修改paper的内容

\section{Introduction}
\label{sec:intro}

In Section \ref{sec:intro} ...

表格

双栏排版中 表格放在单栏 并且居中

\begin{table*}[htbp]
\centering
\begin{tabular}{| l | l | l | l | l | l | l | }
\hline
Number of Node & 2 & 4 & 16 & 32 & 64 & 128 \\ \hline
Number of Server Process & 16 & 32 & 256 & 512 & 1024 & 8192 \\ \hline
Number of Work Load & 256$\times$16 & 256$\times$32 & 256$\times$256 & 256$\times$512 & 256$\times$1024 & 256$\times$8192 \\ \hline
\end{tabular}
\caption{Experiment setup for weak scaling}\label{tab:weaksetup}
\end{table*}

refer to https://blog.csdn.net/zjccsg/article/details/51926069

表格宽度

refer to
https://blog.csdn.net/ProgramChangesWorld/article/details/51867351

控制表格宽度的例子

\begin{table}[h]
\caption{User Interfaces}
\label{tab:interfaces}
\centering
\begin{tabular}{|p{3cm}|p{5cm}|}
\hline
topic\_subscribe & subscribe event with topic based messages \\
\hline
data\_subscribe & subscribe event with customized scripts for data properties \\
\hline
topic\_unsubscibe & unsubscribe event with topic based messages \\
\hline
data\_unsubscribe & unsubscribe event with customized scripts for data properties \\
\hline
publish & publish event with topic based event messages \\
\hline
notify & send notification to the operator to trigger the action related with this notification \\
\hline
\end{tabular}
\end{table}

制作表头的例子

https://tex.stackexchange.com/questions/110018/professional-slashbox-alternative

一个非常好看的表格的例子,中间省略掉了多余的线,表头部分重点标记出来,看起来比默认的表格形式好很多。

\begin{table*}[ht]
\begin{center}
\caption {Adding captions here}

\begin{tabular}{lllllll}
\toprule
Approach & Distribution & Serial & OpenMP & CUDA & Kokkos\_CUDA & Kokkos\_HIP \\ \midrule
\multirow{3}{*}{Reduce by key} & Uniform & $24363$ & $713$ ($34\times$) & $635$ ($\mathbf{38\times}$) & $3188$ ($7\times$)& $1423$ ($17\times$)\\
& IndependentG & $25117$ & $716$ ($35\times$) & $624$ ($\mathbf{40\times}$) & $3183$ ($7\times$) & $1475$ ($17\times$)\\
& MultivariateG ($1000$ samples) & $24996$ & $725$ ($\mathbf{34\times}$)& $826$ ($30\times$)& $3351$ ($7\times$) & $1454$ ($17\times$)\\
\midrule
\multirow{3}{*}{Fixed block size} & Uniform & $1075$ & $91$ ($11\times$) & $171$ ($6\times$)& $147$ ($7\times$)& $74$ ($\mathbf{14\times}$)\\
& IndependentG & $1609$ & $92$ ($17\times$)& $171$ ($9\times$)& $155$ ($10\times$)& $78$ ($\mathbf{20\times}$)\\
& MultivariateG ($1000$ samples) & $1444$ & $93$ ($15\times$)& $357$ ($4\times$)& $302$ ($4\times$)& $94$ ($\mathbf{15\times}$)\\
\bottomrule
\end{tabular}
\end{center}
\end{table*}

公式

公式换行 注意使用 split + & + \

refer to

https://stackoverflow.com/questions/2860145/how-can-i-have-linebreaks-in-my-long-latex-equations

补充:

添加comment的技巧

导出图片的时候要弄成pdf的形式 而不是 png或者是jpg的形式 pdf的形式 效果会更清晰

开始一个新的段落的时候不要求额外的缩进 使用这个符号 ~\\

latex插入多张图片 并排或者竖放

https://blog.csdn.net/a6822342/article/details/80533135

注意中间的空格

使用item

example:

\begin{itemize}[noitemsep,leftmargin=*]

\item We design and implement the scalable topic based Pub/Sub broker based on dynamic group management.

\item We use the dynamic data redistribution mechanism to solve the load imbalance issue for topic based Pub/Sub when there is large subscribers.

\item We provide the architecture for event based framework to construct the workflow based on event based task dependency.

\item We implement the data centric Pub/Sub mechanism letting user provide customized scripts (predicates) for multiple backend data storage service during subscription, when interesting patten described in scripts happen, the subscriber will be notified and following task will be triggered.

\end{itemize}

通过leftmargin可以让不同的item产生左对齐的效果

figures

2*2 subfigures across multiple columns, there are lots of online resource, this one works best

\usepackage{graphicx}
\usepackage{subfigure}


\begin{figure*}
\centering %%% not \center
\subfigure[Figure A]{\label{fig:a}\includegraphics[width=85mm]{./submission/figure/umlmcp.pdf}}
\subfigure[Figure B]{\label{fig:b}\includegraphics[width=85mm]{./submission/figure/umlmcp.pdf}}
\subfigure[Figure C]{\label{fig:b}\includegraphics[width=85mm]{./submission/figure/umlmcp.pdf}}
\hspace{0.12in}
\subfigure[Figure D]{\label{fig:b}\includegraphics[width=85mm]{./submission/figure/umlmcp.pdf}}
\caption{my caption}
\end{figure*}

using hspace between the two subgraphics could control the distance between two pictures.

magic vspace

when finish the paper, at last, you need to adjust the content to make it fit the page size, how to make it to fit the size perfectly? The first is that use the [h] to make all the figure al the top of the page. Second is to use the vspace command wisely, by this way, you could adjust it properly according to the content of the data. It is always good to set the table at the top of the specific page

推荐文章