# Hla Hla Htay's Notes

## Just another WordPress.com weblog

### Latex : Table across two columns – 2July 12, 2010

Filed under: Latex,Writing — hhh123 @ 3:16 am
Tags:

Seth Johnson (http://reference-man.com/blog) shared a good example to reduce any extra space into the document.

****************************************
I thanks Seth Johnson for sharing with us. WordPress is banned and sorry that I am not able to approve your comment by skipping proxy :D. So I post your comment by posting with email. Thank you .

****************************************

I second Anne. All that’s necessary is using <code>table*</code> rather than <code>table</code>. The other cruft (using <code>hfill</code>, etc.) detracts from the main point. I’d suggest the following, which doesn’t introduce any extra space into the document:<pre>
\begin{table*}[htb]
\centering
\begin{tabular}{lll}\hrule
&amp; $\rho_\text{th}$ &amp; $\rho_\text{exp}$
\\ \hrule
$\Sigma_t h=0.100$ &amp; 0.2185 &amp; 0.2182
\\
$\Sigma_t h=0.300$ &amp; 0.1889 &amp; 0.2818
\\
$\Sigma_t h=0.500$ &amp; 0.1875 &amp; 0.4020
\hrule
\end{tabular}
\caption{Caption goes here.}
\label{tab:widetable}
\end{table*}
</pre>

P.S. I’d recommend not putting all those lines on your table as though it’s a Microsoft Word document&mdash;that’s a big visual design faux pas.

Centering Table Caption

\documentclass[11pt,a4paper]{article}
\usepackage{capt-of}
\begin{document}

\begin{center}
\captionof{table}{sweet sweet sweet}
\label{table1} % for use in \ref{table1} if you want to refer to the table number
\begin{tabular}{|c|c|c|c|c|c|}
a&a&a&a&a&a\\
\end{tabular}
\end{center}

\begin{center}
\captionof{table}{sweet sweet sweet sweet sweet}
\label{table1} % for use in \ref{table1} if you want to refer to the table number
\begin{tabular}{|c|c|c|c|c|c|}
a&a&a&a&a&a\\
\end{tabular}
\end{center}
\end{document}

### LaTex : How to break a long equation more than a lineDecember 11, 2009

Filed under: Latex,Writing — hhh123 @ 12:08 pm
Tags:

\begin{center}
{\small
\hfill{}
\begin{figure*}[ht]
\begin{eqnarray*}
result&=& \frac{a}{b} + \frac{aaaaaaaaaaaaaaaaaaaaaaa}{b} * \frac{bbbbbbbbbbbbbbbbbb}{a} + \frac{ccccccccccccccccccc}{b} \\
&=& [ \frac{a}{b} + \frac{aaaaaaaaaaaaaaaaaaaaaaa}{b} * \frac{bbbbbbbbbbbbbbbbbb}{a} + \frac{ccccccccccccccccccc}{b} * \\ &&
\frac{a}{b} + \frac{aaaaaaaaaaaaaaaaaaaaaaa}{b} * \frac{bbbbbbbbbbbbbbbbbb}{a} + \frac{ccccccccccccccccccc}{b} * \\ &&
\frac{a}{b} + \frac{aaaaaaaaaaaaaaaaaaaaaaa}{b} * \frac{bbbbbbbbbbbbbbbbbb}{a} + \frac{ccccccccccccccccccc}{b} *\\ &&
\frac{a}{b} + \frac{aaaaaaaaaaaaaaaaaaaaaaa}{b} * \frac{bbbbbbbbbbbbbbbbbb}{a} + \frac{ccccccccccccccccccc}{b}] \\
result&=& good

\end{eqnarray*}
\end{figure*}}
\hfill{}
\end{center}

1. \begin{figure*}[ht]****\end{figure*}} can move around if the page is two-column mode
2. \begin{eqnarray*} *****\end{eqnarray*} is good for a series of equations
3. \\&& is used to break lines if an equation is too long

### LaTex : TrueType font installationAugust 21, 2008

Filed under: Latex,University,Writing — hhh123 @ 12:54 pm
Tags: , , ,

I want to write Myanmar fonts in LaTex. Since May, I kept on trying to install in Vista. If you follow the exactly what is written in http://www.radamir.com/tex/ttf-tex.htm, you can easily install in Window XP. In Vista, the font can show in PS only, not in PDF. I feel relax after it shows in PS 😛 I have to solve it.

No need to solve it. 🙂 Fortunately, it works well in this way. First, covert LaTex to ps , and go to that folder and in command line, type ps2pdf input.ps output.pdf

The example declaration in Tex header.

\newcommand\wininnwa{\usefont{T1}{tnr}{m}{it}}
\DeclareTextFontCommand{\textwin}{\wininnwa}

Whenever you need in the text , call in this way \textwin{vSvSaX;}

I wrote how to do for Myanmar fonts in http://www.mmgeeks.org/forum/viewtopic.php?f=19&t=56&p=337&hilit=miktex&sid=cc78a2e0949138e07ac51da8b57d55cb#p337

### Latex : Table across two columnsAugust 13, 2008

Filed under: Latex,Writing — hhh123 @ 11:37 am
Tags: , , ,

Normally, papers has to be prepared in two column mode. The following code will allow you the table across two columns.

\begin{center}
\begin{table*}[ht]
{\small
\hfill{}
\begin{tabular}{|l|l|c|c|c|c|c|c|c|}
\hline
\textbf{Hello}&\textbf{Hello}& \multicolumn{7}{|c|}{\textbf{Hello}}\\
\cline{3-9}
\hline
AAAAA&AAAAA&AAAAA&AAAAA&AAAAA&AAAAA&AAAAA&AAAAA&AAAAA\\
BBBBB&BBBBB&BBBBB&BBBBB&BBBBB&BBBBB&BBBBB&BBBBB&BBBBB\\
AAAAA&AAAAA&AAAAA&AAAAA&AAAAA&AAAAA&AAAAA&AAAAA&AAAAA\\
BBBBB&BBBBB&BBBBB&BBBBB&BBBBB&BBBBB&BBBBB&BBBBB&BBBBB\\
\hline
\end{tabular}}
\hfill{}
\caption{Table Name}
\label{tb:tablename}
\end{table*}
\end{center}

I copy their comments for those who has the same problem. @Thanks you, Chus”.@ 🙂

Liz said that “This code produces a line spacing of 3 lines in my document. Is it possible to avoid that?”
Chus solved this problem by introducing the center environment inside the table environment.

### LaTex : changing font size for the whole table entriesAugust 6, 2008

Filed under: Latex,Writing — hhh123 @ 6:02 am
Tags: , ,

font size command such as \Large , \large, \tiny etc just before tabular.
{\Large \begin{tabular}{|c|l|l|} …. \end{tabular} }

The original example can be found in the following URL http://www.cqf.info/forum/viewtopic.php?t=3850

\usepackage{subfigure} are required to place side by side . \subfigure{} and \subtable{} commands are used.

\begin{figure}
\centering
\subtable{
\centering
\renewcommand{\arraystretch}{1.2}
{\Large
\begin{tabular}{|c|l|l|}
%\toprule
\hline
Region & nMOS & pMOS\\
%\midrule
\hline
A & cutoff & linear\\
B & saturation & linear\\
C & saturation & saturation\\
D & linear & saturation\\
E & linear & cutoff\\
\hline
%\bottomrule
\end{tabular}}}
\subtable{
\centering
\renewcommand{\arraystretch}{1.2}
{\tiny\tt
\begin{tabular}{|c|l|l|}
\hline
Region & nMOS & pMOS\\
\hline
A & cutoff & linear\\
B & saturation & linear\\
C & saturation & saturation\\
D & linear & saturation\\
E & linear & cutoff\\
\hline
\end{tabular}} }
\end{figure}