Skip to content

Instantly share code, notes, and snippets.

@hasantahir
Created August 2, 2016 17:58
Show Gist options
  • Save hasantahir/2782a02314109d59a01aa6149cc6fabb to your computer and use it in GitHub Desktop.
Save hasantahir/2782a02314109d59a01aa6149cc6fabb to your computer and use it in GitHub Desktop.
Add this before each LaTeX document
% ------------------------------- Useful Tricks Learnt
% Use ={}& to align subequations to the left
% Use = for single equations
% Put comments % in between the lines in order to avoid forming a new paragraph.
% To enter special characters into Inkspace figures, use Ctrl+U and then enter the unicode. e.g., for \times symbol, the unicode is U+0D7. So the key entry would be Ctrl+U U+0d7 and then press enter.
%
% ----------------- To compile with references use the following order in Shell"
% 1. pdflatex filename.tex
% 2. bibtex filename (no extension)
% 3. bibtex filename (no extension)
% 4. pdflatex filename.tex
% -----------------
% Personal definitions
% Operators
\renewcommand{\v}[1]{\mathbf{#1}} % vectors
\newcommand{\ti}[1]{\tilde{#1}} % spectral representation
% Symbols
\renewcommand{\O}{\omega} % omega
\newcommand{\E}{\varepsilon} % epsilon
\renewcommand{\u}{\mu} % mu
\newcommand{\p}{\rho} % rho
\newcommand{\x}{\times} % times
\renewcommand{\inf}{\infty} % infinity
\newcommand{\infint}{\int\limits_{-\inf}^\inf} % integral by R
\newcommand{\del}{\nabla} % nabla operator
\renewcommand{\^}{\hat} % unit vector
@hasantahir
Copy link
Author

hasantahir commented Aug 2, 2016

Create macros for shortcut to deal with frequently used math operators and symbols using the
% To overwrite an already created command use:
\renewcommand{\v}[1]{\mathbf{#1}} % \v{} as a vector operator resulting in boldfaced arguments.

% To create a new command
\newcommand{\p}{\rho} % \p displays \rho symbol.

@hasantahir
Copy link
Author

Similarly the complex numbers can be denoted by an upright letter i or j rather than the default italic one.

\newcommand{\i}{\mathrm{i}} % \p displays \rho symbol.

\newcommand{\j}{\mathrm{j}} % \p displays \rho symbol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment