Tuesday, July 10, 2012

some latex command that i need to use

1. to make symbol like degree and μ

\usepackage{mathtools}%for equation\usepackage{textcomp}%for insert text with math/symbol
\usepackage{gensymb} %for degree and micro meter symbol
eg:

annealed at 900 \degree C for 1 hour
1-\micro m diamond

2. table and figure

\usepackage{booktabs}%for table
\usepackage{multirow}%for table
\usepackage{graphicx}%for figure with caption
\graphicspath{{./pic/}}%define path for pic

eg:


\begin{figure}[hb]
  \centering
  \includegraphics[width=4in]{protein.png}
  \caption[protein configuration \label{protein}]
   {Protein configuration of amino acid.}
 
\end{figure}
Figure~\ref{protein} shows that the picture is not bla bla bla


\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\begin{table}[htbp]
\centering
\ra{1.3}
\begin{tabular}{lcccccccccc}
\toprule
\multirow{2}[4]{*}{Sample} & \phantom{abc}& \multicolumn{4}{c}{Relative concentration (at\%)} & \phantom{abc} & \multicolumn{3}{c}{Ratio}  \\
\cmidrule {3-6} \cmidrule {8-10}\
&& Ti & Ni & O & C && Ti/Ni & [O2-]/[OH-] & [H2O]/ [OH-] \\
\midrule
Before HPT && 19.06 & 2.24 & 46.87 & 31.83& & 8.509 & 2.317 & 0.331 \\
N=0.25 & &19.65 & 1.78 & 44.87 & 33.7 && 11.039 & 6.698 & 0.57 \\
N=0.5 && 9.97 & 2.96 & 37.47 & 49.6 && 3.368 & 1.945 & 0.691 \\
N=5 & &3.91 & 2.76 & 32.79 & 60.54 && 1.417 & 0.345 & 1.04 \\
\bottomrule
\end{tabular}%
\label{tab:addlabel}%
\end{table}%


rasanya mesti ada simple way
tapi aku kan suka nak menyusahkan diri sendiri









No comments: