Statistics
| Branch: | Revision:

root / latex / tips.tex @ d5b7a27f

History | View | Annotate | Download (1.78 KB)

1 d1ed66aa Quynh PX Nguyen
%!TEX root = note.tex
2
3
%%%%%%%%%%%%%%%%%%
4
% TIPS
5
%%%%%%%%%%%%%%%%%%
6
\section{Tips}
7 1bac9234 Quynh PX Nguyen
    \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 d1ed66aa Quynh PX Nguyen
    \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 b56a7ca2 Quynh PX Nguyen
19
20 d1ed66aa Quynh PX Nguyen
\usepackage[T1]{fontenc}
21
\AtBeginDocument{%
22
  \begingroup\lccode`~=`_%
23
  \lowercase{\endgroup\let~}_%
24
  \catcode`_=12
25
}            \end{lstlisting}
26
27 b56a7ca2 Quynh PX Nguyen
        \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 d1ed66aa Quynh PX Nguyen
35
36
    \subsection{Shell}
37 1bac9234 Quynh PX Nguyen
        \subsubsection{Make shell ignore the dollar sign at the beginning, and run the command}
38 d1ed66aa Quynh PX Nguyen
39
        \subsubsection{Color code the output of gcc}
40
        http://stackoverflow.com/questions/14922960/is-there-an-easy-way-to-color-code-the-compiler-outputs
41
42
        /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
43
44
          \begin{lstlisting}
45
cd /usr/local/bin
46
sudo ln -s /usr/bin/colorgcc gcc
47
sudo ln -s /usr/bin/colorgcc g++
48
sudo ln -s /usr/bin/colorgcc cc
49
sudo ln -s /usr/bin/colorgcc c++
50
          \end{lstlisting}
51
52
        https://imranfanaswala.wordpress.com/2009/02/02/setting-up-colorgcc/