4

I urgently need your help. I checked the whole TEX.StackExchange, but for last 4 hours could not solve anything. Please help :)

It is quite difficult to explain the question, so would better show it in a picture. In a two column page, I am trying to build a paper, which components, in the tex code, appear in a following order:

  1. Text #1
  2. Wide table #1 with many items
  3. One-column short table #2
  4. Wide table #3 with many items
  5. Text #2

enter image description here

I need to get an output as such: enter image description here

  • 1
    just move table2 forward in the file (so it will become table 1) and use [htp] so it has a chance of appearing mid-column, and as said before the question should have code preferably a complete document that shows the problem. – David Carlisle May 9 '14 at 23:25
  • Yeah, but I need to preserve the numbering in the caption, because first in the Text #1 I refer to the Table #1, then to the Table #2, then in the Text #2 to a Table #3. Frankly saying I tried so many codes simple table and longtables etc. The full code is here in the text file. dropbox.com/s/wa1gkdwpnilkgk9/code.txt – Nur May 9 '14 at 23:37
  • 1
    That is why you should never refer to table numbers explicitly sbut use \label and \ref so that when the tables are re-numbered references automatically keep the right number. If you really want the numbers to be out of order (which is very unusual) just put \setcounter{table}{0} before the table ypu want to have number 1 (and similarly any other numbers you want to force) but readers will not be expecting tables numbered in that way. – David Carlisle May 9 '14 at 23:51
  • 1
    Please don't link to external files (it makes a mess of the archive unless you will keep that dropbox link forever) make a small complete test document that shows the problem and paste it into the question. – David Carlisle May 9 '14 at 23:52
5

Never do this in a LaTeX source:

n the Table 3.

in LaTeX always do

n the Table \ref{somename}.

then do

 \caption{my table\label{somename}}

then whatever number latex gives the table will be used in the cross reference, and you won't want the \setcounter below to force the numbering out of order.

Please post complete documents as here: I don't think your readers will thank you for numbering the tables out of sequence (the point of numbering them is to help find them) but if you really want that, you can. This uses the sequence 2, 1, 3

enter image description here

\documentclass[twocolumn,a5paper]{article}

\usepackage{longtable}
\title{zzz}
\author{Yyy Yyy}
\begin{document}
\maketitle
\def\a{One two three four five. }
\def\b{\a Six seven eight nine ten. \a\a\a\a}
\b\b\a\a\a\b\a\a
\setcounter{table}{1}
\begin{table}[htp]
\caption{zzzz}
\begin{tabular}{cc}a&b\\c&d\end{tabular}
\end{table}
\a\a\b\a

\onecolumn
\setcounter{table}{0}
\begin{longtable}{cc}
\caption{a table}\\
A&B\endfirsthead
\caption*{a table (continued)}\\
A&B\endhead
aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\
AAaa&bb\\aa&BBbb\\aa&bb\\aa&bb\\AAaa&bb\\aa&bb\\aa&bb\\aa&bb\\
aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\
Aaa&bb\\aa&BBbb\\aa&bb\\aa&bAb\\AAaa&bb\\aa&bb\\aa&bb\\aa&bb\\
aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\aa&bb\\
\end{longtable}
\setcounter{table}{2}
\begin{longtable}{cc}
\caption{another table}\\
X&Y\endfirsthead
\caption*{another table (continued)}\\
X&Y\endhead
xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\
XXxx&yy\\xx&YYyy\\xx&yy\\xx&yy\\XXxx&yy\\xx&yy\\xx&yy\\xx&yy\\
xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\
Xxx&yy\\xx&YYyy\\xx&yy\\xx&yXy\\XXxx&yy\\xx&yy\\xx&yy\\xx&yy\\
xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\xx&yy\\
\end{longtable}
\twocolumn
\b\b\b

\end{document}
  • Thank you very much. I was preparing a conference paper, it worked perfectly. May God reward you with goodness. – Nur May 10 '14 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.