## Latex Notes

This is a summary of some of the things I learned about using latex. This post is being constantly updated over the years. (Every time I learn something new, I will update this document).

I am breaking this notes into several sections, including Math symbols, Bibliography, Text highlighting and organization and Figures.

Figures

1. 0.5textwidth is half a page, good for two column publications
2. Placement of figures (horizontally in two columns) in a separate post
3. Crop images
1. images are often too big with lots of white space, we can use trim command to do it, the order is the following
1. An example: \includegraphics[trim={5cm 0 0 0},clip]{example-image-a}
2. The order: trim={<left> <lower> <right> <upper>}
1. Pitfall: be careful not trimming out the legends or the axis labels
4. ImageWidth
1.  \includegraphics[page=1,trim=4cm 11cm 0cm 0cm, clip, width=1.5\linewidth]
5. Caption
1. adjust width: use package caption, and then do
1. captionsetup{width=\columnwidth}
2. adjust the starting point, shift caption to the right
1.  \captionsetup{oneside,margin=25pt}

Math

1. math symbols

You can use

\autorinfo{author1, author2 \\ author3} to control authors in different lines.

Or, you can do everything by hand with this cool use of the basic \author{}

\author{Yunming Zhang,  $^\dag$Person2 \\Aff1, $^\dag$Aff2}

Show algorithms

The official documentation

http://tug.ctan.org/macros/latex/contrib/algorithmicx/algorithmicx.pdf

algorithmic[1] is with line number, [0] is without line number.

Usually lines begin with \Statement,

Common commands include \Procedure \EndProcedure, \Comment (usually following  \Satement) …

Always begin and end statements with $, this can significantly shorten the lines (pack the content close to each other). For example, \Statement$a\gets b\$

You can also set the location of the algorithm like a normal float environment.

\begin{algorithm}[t]