Graphics, Figures & TablesTwo tables embedded with same width

Information and discussion about graphics, figures & tables in LaTeX documents.
Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Two tables embedded with same width

Post by Sundial »

svend_tveskaeg wrote:I am not sure understand what you are saying.
Simply that the same code with the original table has no trouble of references (figures+table), while the new code, which uses different packages, seems responsible of failure. So, the conflict could reside inside them.
Nethertheless, I'll investigate other solutions. Thank you, svend.

Edit. Could someone replicate this code?

Code: Select all

%---------- minimum.tex ---------- for forum replication ---------
\documentclass[a4paper,11pt] {article}
\usepackage [latin1]{inputenc}  
\usepackage[T1]{fontenc}
\usepackage[english]{babel}                        
\usepackage{fancybox}                                 
\usepackage{graphicx}  
\usepackage{amsmath}     
%-----------------
\usepackage{booktabs,array}
\usepackage{siunitx}
\sisetup{minimum-integer-digits=2}
\usepackage[tableposition=top]{caption}
%-----------------

\DeclareCaptionLabelSeparator{CapSpace}{:\quad}
\captionsetup{
font=small,
labelfont=sc,
labelsep=CapSpace,
width=0.7\textwidth
}

\begin{document}
 Most of them involve the parameters shown in Fig.~\ref{fig:eop}
 called by ...
   
\begin{figure}[h]   
\centering
  \fbox{\includegraphics[scale=0.90]{etic.pdf}}%
\label{fig:eop}
\caption{To execute frame transformations}  
\end{figure}

This procedure involves the knowlwdge of data coming from observations
carried out from a location ({\em Site}) and summarized in Table ~\ref{horse}:

%----------------------------------------------------------------------
\begin{table} [h]
\centering
\caption{Observation times, Right Ascension of Ascending Node,
 Declination, Site Coordinates}
\label{horse}
\begin{tabular}{
c
!{\quad}
S[table-format=2.0]
S[table-format=2.0]
S[table-format=2.2]
!{\quad}
S[table-format=2.0]
S[table-format=2.0]
S[table-format=2.2]
}
\toprule
Times & \multicolumn{3}{c}{RAAN} & \multicolumn{3}{c}{Dec}\\
& \si{\hour} & \si{\minute} & \si{\s} & \si{\degree} & \si{\arcminute} & \si{\arcsecond} \\
\midrule
11:40:28 & 00 & 03 & 45.48 & 18 & 40 & 03.78 \\
11:48:28 & 03 & 00 & 06.18 & 35 & 39 & 53.07 \\
11:52:28 & 04 & 31 & 32.80 & 36 & 59 & 47.70 \\
\midrule
Date & \multicolumn{6}{c}{Site Geodetic Coordinates}\\
Aug.~20, 2012 & \multicolumn{2}{c}{$\lambda = \SI{-110}{\degree}$} & \multicolumn{2}{c}{$\phi = \SI{40}{\degree}$} & \multicolumn{2}{c}{$H = \SI{2000}{\m}$} \\
\bottomrule
\end{tabular}
\end{table}
%--------------------------------------------------------------------------
\noindent
We assume the ellipsoid WGS84 as reference for computing the topocentric 
coordinates ($T_1,T_2,T_3$), at observations times ($t_1,t_2,t_3$).

\end{document}
What I erroneously obtain is shown in the att'd screenshot (Fig.??). Enclosed the called file in pdf, too.
Attachments
etic.pdf
This is the included graphical file
(11.12 KiB) Downloaded 531 times
Output of my compilation: pdflatex minimum (repeated twice)
Output of my compilation: pdflatex minimum (repeated twice)
scr05.png (42.07 KiB) Viewed 8569 times

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

alainremillard
Posts: 45
Joined: Fri Mar 16, 2012 8:22 pm

Two tables embedded with same width

Post by alainremillard »

The \label command should be after the \caption command. Then the reference will work just fine.

By the way, Table ~\ref{horse} give you a double spacing between table and 1. Simply remove the space in your code. Table~\ref{horse}

Have a nice day
Alain Rémillard
Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Two tables embedded with same width

Post by Sundial »

Oh yes, Alain! I can say now: end of my headhache!
In fact, by postponing \label to \caption, as per your suggestion, my document is properly referenced. Thanks also for the drift on suppressing one space before Table.

And now, my problem is definitively solved! Wow
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Two tables embedded with same width

Post by svend_tveskaeg »

One other thing: In ($T_1,T_2,T_3$) and ($t_1,t_2,t_3$), the parentheses should be in mathmode, i.e., inside the dollar signs. (That is, if it is coordinates.)
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Two tables embedded with same width

Post by Sundial »

svend_tveskaeg wrote:... the parentheses should be in mathmode ...
Thx, but that's my personal choice, I like they stay outside!
Thanks to you, again!
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Two tables embedded with same width

Post by svend_tveskaeg »

You are perfectly welcome to do that (of course!) but it can give you problems. Consider

Code: Select all

\documentclass{article}

\begin{document}
``\textit{The coordinates~($T_1,T_2,T_3$) are three-dimensional}'' versus
``\textit{the coordinates~$(T_1,T_2,T_3)$ are three-dimensional}''.
\end{document}
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Re: Two tables embedded with same width

Post by Sundial »

Hi svend,
any idea about the slight modification to do in the said table? Question is described inside the screenshot and table code shown previously.
Cheers
Attachments
scr07.png
scr07.png (93.25 KiB) Viewed 8552 times
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Two tables embedded with same width

Post by svend_tveskaeg »

The threeparttable seems to be one/the way to go. (I haven't used it myself.)
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Two tables embedded with same width

Post by Sundial »

svend_tveskaeg wrote:The threeparttable seems to be one/the way to go. (I haven't used it myself.)
Oh no! One more tutorial among the infinity available via the internet.
In such cases, a concise example is better than huge flows of words, and, up to now, I haven't digged out it. I like to define myself with ... this acronym:LBE, learner by example.
Thank you, svend.
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Re: Two tables embedded with same width

Post by svend_tveskaeg »

Give it a try, at least.

I don't want to do all the work for you.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Post Reply