Skip to content

Latest commit

 

History

History
255 lines (193 loc) · 7.37 KB

latex.md

File metadata and controls

255 lines (193 loc) · 7.37 KB

Mathematics

\usepackage{amsmath,amssymb,amsfonts,amsthm}
% \usepackage{bm} % defines \bm
\usepackage{mathtools} % hollow char, see [1]
\usepackage{stmaryrd} % hollow bracket, see [1]

% argmax, argmin
\DeclareMathOperator*{\argmin}{\arg\min}
\DeclareMathOperator*{\argmax}{\arg\max}
% iverson bracket
\DeclarePairedDelimiter{\iverson}{\llbracket}{\rrbracket}

Algorithm/Pseudo-code & Code

% pseudo code (algorithm)
\usepackage{algorithm}
\usepackage{algorithmic}

% code
\usepackage{listings}

Figure & Table

% table
\usepackage{bigstrut}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{extarrows}
\usepackage{makecell}
\usepackage{multirow}

% figure
\usepackage{graphicx}
%\usepackage{subfigure}
\usepackage{subcaption} % use it to include subfigure

draw hierarchy

To show hierarchy with box-drawing characters, e.g. in quantitative result tables:

Base Method
  ├─ + Plugin A
  └─ + Plugin B

use

\usepackage{pmboxdraw}

\textSFii   %
\textSFviii %
\textSFx    %

wrap figure/table

Let a figure / table be wrapped around by text instead of spanning the whole row, use wrapfigure and wraptable in

\usepackage{wrapfig}

References and examples:

album layout

Album layout: a big figure on one side, several small figures forming a grid on the other side:

 _____    ___   ___
|     |  |___| |___|
|     |   ___   ___
|_____|  |___| |___|

I use the solution in [1] using the subcaption package and \newbox, \bigpicturebox, \sbox and \usebox commands.

  1. Big picture with several smaller ones on the side
  2. How can I create this layout of 3 subfigures?
  3. How to place two figures in one column, and then another figure in the 2nd column with double the size?
  4. 用floatrow宏包实现插图的异形布置
  5. Specific image layout

Abbreviations

  • Note: (some of) these may be already defined by the template, e.g. the cvpr.sty in [4].
\usepackage{xspace}

\makeatletter
\DeclareRobustCommand\onedot{\futurelet\@let@token\@onedot}
\def\@onedot{\ifx\@let@token.\else.\null\fi\xspace}
\def\eg{\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot}
\def\ie{\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot}
\def\viz{\emph{viz}\onedot}
\def\cf{\emph{cf}\onedot} \def\Cf{\emph{Cf}\onedot}
\def\etc{\emph{etc}\onedot}
\def\vs{\emph{vs}\onedot} % `vs.` not `v.s.`
\def\wrt{w.r.t\onedot} \def\dof{d.o.f\onedot}
\def\iid{i.i.d\onedot} \def\wolog{w.l.o.g\onedot}
\def\etal{\emph{et al}\onedot}
\makeatother

Text & Symbol

\usepackage{soul} % \st: stridethrough text

% \bs := \boldsymbol
\ifdefined\bm
  \PackageWarning{\jobname}{\string\bm\space is already defined.}
\else
  \newcommand{\bm}{\boldsymbol}
\fi

encoding

Sometimes there may be some accent character in author names in the bibliography, e.g.:

  • Stanis{\l}aw Jastrz{\k{e}}bski

Include the following two packages to avoid compiling errors with pdflatex:

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

Reference:

Custom Colours

You can use these colours to configure the citation, link and url colour of hyperref. See [8] for some named colours.

\usepackage{xcolor} % \textcolor, \definecolor

\definecolor{bilibili}{RGB}{251, 114, 153}
\definecolor{phub}{RGB}{255, 163, 26}
\definecolor{halfgreen}{RGB}{0, 153, 0} % FROM: https://arxiv.org/abs/1805.08193
\definecolor{kaiming-green}{RGB}{57, 181, 74} % FROM: https://arxiv.org/abs/2402.10739
\definecolor{royalblue}{RGB}{0, 113, 188}
\definecolor{halfblue}{RGB}{0, 0, 128} % ICML citation blue

Citation & Reference

% url & cite
\usepackage[
  pagebackref,
  breaklinks,
  colorlinks,
  bookmarks=true,
  citecolor=royalblue % custom colour defined above
]{hyperref}

% easy reference of figure, table, section
% - `\eqref`: built in the `amsmath` package
% - `\nameref`: built in the `nameref` package
% - `\pageref`: built-in
\providecommand{\eqnref}[1]{Eq.~\eqref{#1}}
\providecommand{\Eqnref}[1]{Equation~\eqref{#1}}
\providecommand{\figref}[1]{\figurename~\ref{#1}}
\providecommand{\tabref}[1]{\tablename~\ref{#1}}
\providecommand{\secref}[1]{\S\ref{#1}}
\providecommand{\Secref}[1]{Section~\ref{#1}}

Alternative: use \autoref provided in hyperref package.

Alternative: use cleveref.

Detailed Citation

To cite a specific section/figure/theorem/etc. of another paper, e.g. [7, Section 2], cite with argument like \cite[Section 2]{cvpr23abc}.

Quotation Marks

"a", ``b'', 'c', `d'.

Fonts

Figure in Title & Text

See TeX source of:

  • (arxiv'24) PointMamba: A Simple State Space Model for Point Cloud Analysis - arXiv

Its custom \charimage command:

\newcommand{\charimage}[1]{\raisebox{-0.25\height}{\includegraphics[height=\baselineskip]{figure/logo.png}}}

Its hacked \title:

\title{
\vspace{-1.em}
\renewcommand{\windowpagestuff}{
\quad\includegraphics[width=1.cm, trim={0cm 10cm 0cm 0cm}, clip=False]{figure/logo.png}
}
\begin{cutout}{0}{0.3cm}{22cm}{1}
\vspace{-30pt}
{\color{white} empty} \protect\linebreak
\protect\linebreak
{\color{white} \qquad } PointMamba: A Simple State Space Model for Point Cloud Analysis
\end{cutout}
\vspace{-0.7em}
}

References

  1. latex空心小写字母、数字、括号
  2. latex自定义缩写
  3. latex cite命令、款式
  4. guanyingc/cv_rebuttal_template
  5. guanyingc/latex_paper_writing_tips
  6. MLNLP-World/Paper-Writing-Tips
  7. MLNLP-World/Paper-Picture-Writing-Code
  8. LaTeX Color