Statistics
| Branch: | Revision:

root / latex / tips.tex @ d1ed66aa

History | View | Annotate | Download (1.33 KB)

1
%!TEX root = note.tex
2

    
3
%%%%%%%%%%%%%%%%%%
4
% TIPS
5
%%%%%%%%%%%%%%%%%%
6
\section{Tips}
7
    \subsection{LaTEX}
8
        \subsubsection{Add caption for code listing}
9
            \lstinline{[caption=blabla, label=amb]}
10

    
11
        \subsubsection{Escape the underscore \_ effectively}
12
            Help from \href{http://tex.stackexchange.com/questions/62705/underscore-in-textmode-vs-mathmode}{here}
13
            \begin{lstlisting}
14
\usepackage[T1]{fontenc}
15
\AtBeginDocument{%
16
  \begingroup\lccode`~=`_%
17
  \lowercase{\endgroup\let~}_%
18
  \catcode`_=12
19
}            \end{lstlisting}
20

    
21

    
22

    
23
    \subsection{Shell}
24
        \subsubsection{Make shell ignore the dollar sign at the beginning, and run the command
25

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

    
29
        /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
30

    
31
          \begin{lstlisting}
32
cd /usr/local/bin
33
sudo ln -s /usr/bin/colorgcc gcc
34
sudo ln -s /usr/bin/colorgcc g++
35
sudo ln -s /usr/bin/colorgcc cc
36
sudo ln -s /usr/bin/colorgcc c++
37
          \end{lstlisting}
38

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