# Latex note - `\usepackage{package_name}`: import useful package ## macros Predefine some useful custom command. > Note: must be `\input` before `\begin{document}` ([description](https://www.overleaf.com/learn/latex/Errors/LaTeX%20Error:%20Can%20be%20used%20only%20in%20preamble)) ### Usage ``` \input{macros} \begin{document} ... ``` ### We usually do... - \newcommend: - define a new function - We have no way to determine what the proper noun is, we can temporarily define a command for it. ``` \usepackage{xifthen} %for \ifthenelse \newcommand{\frameentropy}[1][]{% \ifthenelse{\equal{#1}{}}{Frame entropy}{frame entropy}% } ```