Statistics
| Branch: | Revision:

root / latex / tips.tex @ 4f432e4a

History | View | Annotate | Download (2.18 KB)

1
%!TEX root = note.tex
2

    
3
%%%%%%%%%%%%%%%%%%
4
% TIPS
5
%%%%%%%%%%%%%%%%%%
6
\section{Tips}
7
    \subsection{LaTEX Tools}
8
        \texttt{Ctrl-b} Build
9
        \texttt{Ctrl-l, j} jump to the point in the PDF file corresponding to the current cursor position, without re-building.
10

    
11
    \subsection{LaTEX}
12
        \subsubsection{Add caption for code listing}
13
            \lstinline{[caption=blabla, label=amb]}
14

    
15
        \subsubsection{Escape the underscore \_ effectively}
16
            Help from \href{http://tex.stackexchange.com/questions/62705/underscore-in-textmode-vs-mathmode}{here}
17
            \begin{lstlisting}
18

    
19

    
20
\usepackage[T1]{fontenc}
21
\AtBeginDocument{%
22
  \begingroup\lccode`~=`_%
23
  \lowercase{\endgroup\let~}_%
24
  \catcode`_=12
25
}            \end{lstlisting}
26

    
27
        \subsubsection{Multiline in table}
28
            Solution from \href{http://tex.stackexchange.com/questions/2441/how-to-add-a-forced-line-break-inside-a-table-cell}{here}
29

    
30
            \begin{lstlisting}
31
\begin{tabular}{c|c|p{10cm}}
32
            \end{lstlisting}
33

    
34
        \subsection{Citation with author-year-number}
35

    
36
            \href{http://tex.stackexchange.com/questions/135649/make-citemy-reference-show-name-and-year}{Stack Overflow}
37

    
38
            Use \emph{natbib}
39

    
40
        \subsection{Useful websites}
41
            \href{http://www.johndcook.com/blog/2010/02/15/top-latex-mistakes/}{4 common mistakes in LaTEX:} double quotes, Math mode, differential equations
42

    
43

    
44

    
45
    \subsection{Shell}
46
        \subsubsection{Make shell ignore the dollar sign at the beginning, and run the command}
47

    
48
        \subsubsection{Color code the output of gcc}
49
        http://stackoverflow.com/questions/14922960/is-there-an-easy-way-to-color-code-the-compiler-outputs
50

    
51
        /href{http://blog2.emptycrate.com/content/using-colorgcc-ubuntu-and-other-linux-distributions}{This blog post} provides detailed explanation on why the soft link to gcc should be made in the \texttt{user/local/bin} folder
52

    
53
          \begin{lstlisting}
54
cd /usr/local/bin
55
sudo ln -s /usr/bin/colorgcc gcc
56
sudo ln -s /usr/bin/colorgcc g++
57
sudo ln -s /usr/bin/colorgcc cc
58
sudo ln -s /usr/bin/colorgcc c++
59
          \end{lstlisting}
60

    
61
        https://imranfanaswala.wordpress.com/2009/02/02/setting-up-colorgcc/