Graphics, Figures & TablesAlignment of Equality Sign in a Table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pallav
Posts: 170
Joined: Wed Nov 12, 2008 5:53 pm

Alignment of Equality Sign in a Table

Post by pallav »

Thanks to cgnieder for his extensive help in this thread.

I want to do few different things through the attached code for the betterment of the PDF output. Note that the following code gives no error and no warning.
  1. Need all the equal sign in column 2 & 4 be aligned.
  2. The line under the table should be in gray and should be left justify to the table.
  3. Need the 1st row to be centered.
  4. I think the table position is not correct, if I am correct, please help me to do so.

Code: Select all

\documentclass[11pt]{article}
\usepackage{caption}
\usepackage{booktabs,multirow,amsmath,amssymb,array}
\usepackage{siunitx}
\usepackage[table]{xcolor}

\begin{document}
  \begin{table}[!ht]
    \caption{Markov channel parameter settings}
    \centering
    \label{tab:markovchapara}
                \tiny\addtolength{\tabcolsep}{-5pt}
								\colorbox{lightgray}{%
    \begin{tabular}{
      c
      >{$}c<{$}
      @{~}
      >{$}c<{$}
      @{~~~~~~~}
      >{$}c<{$}
      @{~}
      >{$}c<{$}
    }\toprule
      \multirow{2}{*}[-0.5ex]{Channel $j$} & \multicolumn{2}{p{9em}}{\text{A long, long, long line, that is broken}}  & \multicolumn{2}{p{9em}}{A long, long, long line, that is broken 2} \\ \cmidrule(r){2-3}\cmidrule(l){4-5}
        & p_j                                     & q_j                 & \pi_{bj}                               & \pi_{ij} \\ \midrule
    1 & \Phi\left(N(t)\right)=- \left( 2\,\alpha\,L-L+2\,\alpha-{\alpha}^{2} \right)     
			& {\lambda}^{2}+\Omega_{{1}}\lambda+\Omega_{{2}}     
			&\Phi\left(N(t)\right)=\frac{\beta\,y^*\alpha}{\left( x^*+\alpha \right) ^{2}}   
			& i\Omega_{{1}}\omega+\Omega_{{2}}  \\[2ex]
    2 & \Phi\left(N(t)\right)=\left( L\,\beta\,\frac{\left( \beta-\gamma \right)}{\delta}\right)     
			& -{\omega }^{2}+a_{{10}}b_{{01}}-\cos \left( \omega \,\tau  \right) a_{{01}}b_{{10}}     
			&\Phi\left(N(t)\right)= \alpha\,L\, \frac{\left( \delta\,\alpha-\gamma\,\beta \right)}{\delta}    
			& -{ \omega} \left( a_{{10}}+b_{{01}} \right)  \\
    \bottomrule
    \end{tabular}}
		The parameters $\alpha$'s are given in the numerical section.
  \end{table}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply