Featured Book

LaTeX Beginners Guide

Who is online

In total there are 18 users online :: 1 registered, 0 hidden and 17 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: AleCes and 17 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Alignment of Figure References in Table

colorscross-referencingtablestabuAdd tags LaTeX specific issues not fitting into one of the other forums of this category.

Alignment of Figure References in Table

Postby pallav on Fri May 17th, 2013

I am facing a problem when I am referring a figure in a table. I have used the package tabu, as I like it most user friendly. Also I want to color (grey) the background of the table. But after referring the figs in table, I getting an alignment problem. Please help me to solve my problem.

Code: Select all  •  Open in writeLaTeX
\documentclass[10pt]{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[babel=true]{microtype}
\usepackage{mathpazo}
\usepackage{moreverb,amsmath,amssymb,amsthm,mathptmx,enumerate,multicol,stmaryrd,subfig,float,tabu}
\usepackage{caption}
\usepackage[demo]{graphicx}
\usepackage{booktabs,multirow,array}
\usepackage[table]{xcolor}
\usepackage{hyperref}
\hypersetup{colorlinks = true,linkcolor = blue, anchorcolor = blue, citecolor = blue, pdfstartpage=1, filecolor = red,urlcolor = red}
\usepackage[compact]{titlesec}
\definecolor{lightgray}{gray}{0.9}

\begin{document}
  \begin{table}[H]
    \caption{Nature of the....}
    \label{tab:6}
    \centering
    \scriptsize\addtolength{\tabcolsep}{-2pt}
    \colorbox{lightgray
}{%
      \begin{tabu} to .95\linewidth{X[1.2l]X[2.5l]X[1l]X[1l]X[2.5l]}
        \toprule[.5pt]
        {\bf bbbb} & {\bf pppp} &  & {\bf Figure}& {\bf gggg}\\
        \midrule[1pt]
        {$m$} & {$m=0.3$} &  & {\ref{Fig:Bif_Diag_disease} \subref{fig:subfig1_DP}} &{1(a)}  \\
        \midrule[.5pt]
        & {$m< 0.3$} & {} &  {\ref{Fig:Bif_Diag_disease} \subref{fig:subfig2_DP}} &{1(b)}  \\
        \midrule[.5pt]
        & {$m \leq 0.4$} &   {Yes} & {\ref{Fig:Bif_Diag_disease}\subref{fig:subfig1_DP}} &{1(a)}  \\
        \midrule[.5pt]
        & {$m\geq 0.4$} &  {No} & {\ref{Fig:Bif_Diag_disease}\subref{fig:subfig2_DP}} &{1(b)}  \\
        \bottomrule[.5pt]
      \end{tabu}
    }
  \end{table}
  \begin{figure}[htbp]
    \centering
    \subfloat[\label{fig:subfig1_DP}]{
      \includegraphics[height=3cm,width=3cm]{Bif_Diag_m.eps}
    }
    \subfloat[\label{fig:subfig2_DP}]{
      \includegraphics[height=3cm,width=3cm]{Bif_Diag_alpha.eps}
    }
    \caption{(Color online) (a) ..........}
    \label{Fig:Bif_Diag_disease}
  \end{figure}
\end{document
}


I suspect that the problem may occurs due to the use of \usepackage[table]{xcolor}, but it is required in order to color the background of the table.
Attachments
untitled.JPG
untitled.JPG (28.93 KiB) Viewed 719 times
pallav
 
Posts: 152
Joined: Wed Nov 12th, 2008

Re: Alignment of Figure References in Table

Postby pallav on Fri Jul 5th, 2013

Please someone help/reply for my quarry. Thanking you. Pallav
pallav
 
Posts: 152
Joined: Wed Nov 12th, 2008

Re: Alignment of Figure References in Table

Postby Stefan_K on Fri Jul 5th, 2013

You made a very good minimal example, so of course I tested it now that I saw it.

I got a correct alignment:

table-alignment.png
table-alignment.png (4.7 KiB) Viewed 607 times


Click above your example code on "Open in writeLaTeX" to see it there, it's fine as well. So I guess it's a version issue, perhaps update involved packages or make the final compilation on a different computer if you don't want to change your working environment for now.

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6269
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: Alignment of Figure References in Table

Postby pallav on Fri Jul 5th, 2013

Thank you. I shall check in another pc and return back to you.
pallav
 
Posts: 152
Joined: Wed Nov 12th, 2008


Topic Tags

colorscross-referencingtablestabu

Return to General

Who is online

Users browsing this forum: AleCes and 17 guests