Skip to content

Instantly share code, notes, and snippets.

@jeasinema
Last active May 12, 2019 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeasinema/224ce6ef72e83855dd6937714a11c9cb to your computer and use it in GitHub Desktop.
Save jeasinema/224ce6ef72e83855dd6937714a11c9cb to your computer and use it in GitHub Desktop.
Some useful macros for writing technical papers
% packages
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{hyperref}
\usepackage{xspace}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{color}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{footmisc}
\usepackage{subfigure}
% amsthm config
\newtheorem{assumption}{Assumption}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{corollary}{Corollary}
\newtheorem{proposition}{Proposition}
\newtheorem{remark}{Remark}
\newtheorem{definition}{Definition}
% autoref config
\newcommand{\assumptionautorefname}{Assumption}
\newcommand{\theoremautorefname}{Theorem}
\newcommand{\lemmaautorefname}{Lemma}
\newcommand{\corollaryautorefname}{Corollary}
\newcommand{\propositionautorefname}{Proposition}
\newcommand{\remarkautorefname}{Remark}
\newcommand{\definitionautorefname}{Definition}
\newcommand{\figureautorefname}{Figure}
\newcommand{\subfigureautorefname}{Figure}
\newcommand{\tableautorefname}{Table}
\newcommand{\algorithmautorefname}{Algorithm}
\newcommand{\algorithmicautorefname}{Algorithm}
\newcommand{\sectionautorefname}{Section}
\newcommand{\subsectionautorefname}{Section}
\newcommand{\subsubsectionautorefname}{Section}
% change algorithm heading
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
% common operators
\newcommand{\argmin}{\mathop{\mathrm{argmin}}}
\newcommand{\argmax}{\mathop{\mathrm{argmax}}}
% common abbreviations
\providecommand{\eg}{\textit{e.g.}\@\xspace}
\providecommand{\ie}{\textit{i.e.}\@\xspace}
\providecommand{\wrt}{\textit{w.r.t.}\@\xspace}
\providecommand{\etal}{\textit{et al}\@\xspace}
% extra spaces
\newenvironment{hproof}{
\renewcommand{\proofname}{Proof (sketch)}\proof}{\endproof}
% reviewer tag
\def\mxj#1{{\color{red}{\bf [Xiaojian:} {\it{#1}}{\bf ]}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment