Graphics, Figures & TablesRow alignment in Longtables..

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
dmuthu_cse
Posts: 97
Joined: Fri Sep 04, 2009 4:56 pm

Row alignment in Longtables..

Post by dmuthu_cse »

Hello friends,

I currently with longtable alignment.

I have created a longtable 3 columns, with images at the 3rd column. After inserting the images which are about 1 to 2 inch height, the text which is in first 2 columns get bottom aligned.
(i.e. the content of the cell is bottom aligned)

I can solve this problem in tabular environment, by defining
m{value}. But I cannot do this with longtable please do help me..

Code: Select all

\begin{center}
\setlength{\extrarowheight}{0.5cm}
\begin{longtable}{|m{0.5in}@{}|m{3in}@{}|c|}
\hline {\textbf{No.}} & \textbf{Name} & \textbf{Symbol} \\ \hline 
\endfirsthead
\hline \multicolumn{3}{|c|}{{\bfseries \tablename\ \thetable{} -- continued from previous page }} \\
\hline \multicolumn{1}{|c|}{\textbf{No.}} &
\multicolumn{1}{c|}{\textbf{Name}} &
\multicolumn{1}{c|}{\textbf{Symbol}} \\ \hline 
\endhead

\hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
\endfoot

\hline \hline
\endlastfoot
1.7 & Fundamental Symbols &  \\ \hline
1.7.1 & Direct Current & \includegraphics{Sym-1.eps}\\ \hline 
1.7.2 & Alternating Current, General Symbol & \includegraphics{Sym-2.eps} \\ \hline 
1.8.25 & Plug & \includegraphics{Sym-50.eps} \\ \hline
\end{longtable}
\end{center}
Thanks in advance.

With regards,
Muthu

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Row alignment in Longtables..

Post by Stefan Kottwitz »

Hi Muthu,

you could use \raisebox like

Code: Select all

1.7.1 & Direct Current & \raisebox{-.5\height}{\includegraphics{Sym-1.eps}}\\ \hline
Stefan
LaTeX.org admin
dmuthu_cse
Posts: 97
Joined: Fri Sep 04, 2009 4:56 pm

Re: Row alignment in Longtables..

Post by dmuthu_cse »

Hello Stefan,

Thanks for your response.

I tried the code, what you have given to me.. I am getting some errors.. like .. undefined control sequence.. near the \raisebox code...

I suspect that, my package is not updated.. i will do it now..

But my actual question is to center the "text" which is fist to columns. i.e. related to the coding i have given,

I have to make the text "1.7.1" and "Direct Current" to the middle of the row..

Regards,
Muthu.
dmuthu_cse
Posts: 97
Joined: Fri Sep 04, 2009 4:56 pm

Re: Row alignment in Longtables..

Post by dmuthu_cse »

Hello Stefan,

I've tried updating packages from MikeTex 2.7. It say thats no packages related to "syntrace" need to installed..

So, i tried of downloading syntrace package manually.. But it supplies one "syntrace.dtx" file along with pdf..

I don't know how to install, that into my MiKTeX package list..

Please help..

Regards,
Muthu.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Row alignment in Longtables..

Post by Stefan Kottwitz »

dmuthu_cse wrote:I am getting some errors.. like .. undefined control sequence.. near the \raisebox code...
\raisebox is defined by the LaTeX kernel, \height too. What's the exact error message?
dmuthu_cse wrote:But my actual question is to center the "text" which is fist to columns. i.e. related to the coding i have given
I know, but the problem is here, that the images will be aligned at their bottom line by default. The text would be vertically centered in relation to the image bottom line, that's causing the effect. Raising the image or using a \parbox would help.

Stefan
LaTeX.org admin
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Row alignment in Longtables..

Post by Stefan Kottwitz »

dmuthu_cse wrote:It say thats no packages related to "syntrace" need to installed..
So, i tried of downloading syntrace package manually..
I don't see a connection to the problem because syntrace is a package providing support for traces in trees.

Stefan
LaTeX.org admin
dmuthu_cse
Posts: 97
Joined: Fri Sep 04, 2009 4:56 pm

Row alignment in Longtables..

Post by dmuthu_cse »

Hello Stefan,

Thanks...

I am wrong.. The solution you have given is working fine... I missed out the curly brackets.. i.e.

Code: Select all

\raisebox{-.5\height} {Text to be raised}
Regards,
Muthu
Post Reply