1

I have a table in my document, the code of which is as follows:

\onecolumn
\begin{table}[b]
\centering
    \begin{tabular}{cccr}
    \hline
    \textbf{Hydrofob del}   & \textbf{Hydrofil del}             & \textbf{Samlet tensidstruktur}       & \textbf{Tensidtype}    \\ \hline
    Alkylbenzen             & \ce{--SO_3^-}               & alkylbenzensulfonater       & anionisk      \\
    \ce{CH_3[CH_2]_nCH_2}-- & --\ce{OSO_3^-}      & alkylsulfater               & anionisk      \\
    \ce{CH_3[CH_2]_nCH_2}-- & --\ce{COO^-}              & sæber                       & anionisk      \\
    \ce{CH_3[CH_2]_nCH_2}-- & --\ce{[OCH_2CH_2]_mOSO^-} & alkoholethersulfater        & anionisk      \\
    \ce{CH_3[CH_2]_nCH_2}-- & --\ce{CH(SO_3^-)C(O)OCH_3} & methylestersulfonater       & anionisk      \\
    \ce{CH_3[CH_2]_nCH_2}-- & --\ce{[OCH_2CH_2]_mOH}     & alkoholethoxylater          & nonionisk     \\
    \ce{CH_3[CH_2]_nCH_2}-- & --\ce{N^+(CH_3)_2(CH_2} $\phi$) & alkylbenzyldimethylammonium & kationisk     \\
    \ce{CH_3[CH_2]_nCH_2}-- & --\ce{[NCH_3)_2]\rightarrow O}        & alkyldimethylaminoxider     & nonionisk     \\
    \ce{CH_3[CH_2]_nCH_2}-- & --\ce{N^+(CH_3)_2CH_2COO^-} & betainer                    & zwitterionisk \\ \hline
    \end{tabular}

\caption{I denne tabel kan man se byggestenene for de vigtigste tensider i vaskemidler.}
\label{tab:vigtigste tensider}
\end{table}

Now the problem is that LaTeX just centers the table in the middle of a new page. I just want it at the bottom of a two-column page.

marked as duplicate by yo', mafp, Peter Jansson, jubobs, Stefan Kottwitz Dec 3 '13 at 23:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    If you select the source code part and click in the Code button ({}) it displays it as code. By the way, you could add the rest of the (necessary) code so it was a (minimal) compilable working example. – Manuel Dec 3 '13 at 16:26
  • 4
    (a minimum example would help.) if you're using the [twocolumn] option, a change from \twocolumn to \onecolumn (or vice versa), always starts a new page; documented in lamport, p.88. also, there's no facility for setting a full-width float at the bottom of a two-column page. – barbara beeton Dec 3 '13 at 17:14
  • Hi! I believe you can't get a significantly better answer than what @barbarabeeton suggests in How to put a full-width table at the top or bottom of the same two-column page as the reference text? in the second half of her answer. – yo' Dec 3 '13 at 21:44
  • 2
    You can also use \begin{table*}[b] with dblfloatfix, and issue the table one page before where you want it to appear. – Werner Dec 3 '13 at 22:04
2

Using the multicol package provides a more general solution which works even if the stuff you want in a single column is just text, for example.

Your code wouldn't easily compile for me as I don't know what package defines the \ce macro of if this is a custom macro or whatever. So I changed that to maths just to demonstrate the idea. I also added some text so there'd be something in two columns before the table. This puts the table on the same page as the end of the text in two columns although I didn't bother to make it pretty:

\documentclass{article}
\usepackage{lipsum}
\usepackage{multicol}

\begin{document}

\begin{multicols}{2}
    \lipsum
\end{multicols}

\begin{table}[b]
\centering
    \begin{tabular}{cccr}
    \hline
    \textbf{Hydrofob del}   & \textbf{Hydrofil del}             & \textbf{Samlet tensidstruktur}       & \textbf{Tensidtype}    \\ \hline
    Alkylbenzen             & ${CH_3[CH_2]_nCH_2}$               & alkylbenzensulfonater       & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$      & alkylsulfater               & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$              & sæber                       & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ & alkoholethersulfater        & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ & methylestersulfonater       & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$     & alkoholethoxylater          & nonionisk     \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ $\phi$) & alkylbenzyldimethylammonium & kationisk     \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}{\rightarrow O}$        & alkyldimethylaminoxider     & nonionisk     \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ & betainer                    & zwitterionisk \\ \hline
    \end{tabular}

\caption{I denne tabel kan man se byggestenene for de vigtigste tensider i vaskemidler.}
\label{tab:vigtigste tensider}
\end{table}

% added to clarify what I say in the comment below - the end of this two-column environment 
% ends up on the next page since the table above is placed at the bottom of the page on 
% which this environment starts i.e. the table is at the bottom of the two-column page and 
% not automatically pushed to the next one (it gets the position I'd expect if the text was 
% set normally with no columns involved at all
\begin{multicols}{2}
    \lipsum[1-2]
\end{multicols}

\end{document}

EDIT: If the table 'belongs with the text' as tohecz suggests below, you can work around things by using the table* environment within the multicols environment. This will push the table to the next page so it needs to be included on the code for the previous page. If it needs to be at the bottom of the first page which includes text in two-columns, you can include the table* environment before the start of the multicols environment and that gives the right result. But this is all rather fiddly since you need to know where the page breaks will be to get this right. So this is not a good answer if this is what's desired. If so, I'll delete this answer. Leaving temporarily in case it is of any use at all.

EDIT 2: What I mean is, you can do the following:

If you want the table at the bottom of the first page containing multicolumn text:

\documentclass{article}
\usepackage{lipsum}
\usepackage{multicol}

\begin{document}

\begin{table*}[b]
\centering
    \begin{tabular}{cccr}
    \hline
    \textbf{Hydrofob del}   & \textbf{Hydrofil del}             & \textbf{Samlet tensidstruktur}       & \textbf{Tensidtype}    \\ \hline
    Alkylbenzen             & ${CH_3[CH_2]_nCH_2}$               & alkylbenzensulfonater       & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$      & alkylsulfater               & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$              & sæber                       & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ & alkoholethersulfater        & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ & methylestersulfonater       & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$     & alkoholethoxylater          & nonionisk     \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ $\phi$) & alkylbenzyldimethylammonium & kationisk     \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}{\rightarrow O}$        & alkyldimethylaminoxider     & nonionisk     \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ & betainer                    & zwitterionisk \\ \hline
    \end{tabular}

\caption{I denne tabel kan man se byggestenene for de vigtigste tensider i vaskemidler.}
\label{tab:vigtigste tensider}
\end{table*}
\begin{multicols}{2}
\lipsum[1-5]
\end{multicols}

\end{document}

If you want it to appear at the bottom of the second page, include it in the text of the first page, within the multicols environment:

\documentclass{article}
\usepackage{lipsum}
\usepackage{multicol}

\begin{document}

\begin{multicols}{2}
\begin{table*}[b]
\centering
    \begin{tabular}{cccr}
    \hline
    \textbf{Hydrofob del}   & \textbf{Hydrofil del}             & \textbf{Samlet tensidstruktur}       & \textbf{Tensidtype}    \\ \hline
    Alkylbenzen             & ${CH_3[CH_2]_nCH_2}$               & alkylbenzensulfonater       & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$      & alkylsulfater               & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$              & sæber                       & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ & alkoholethersulfater        & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ & methylestersulfonater       & anionisk      \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$     & alkoholethoxylater          & nonionisk     \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ $\phi$) & alkylbenzyldimethylammonium & kationisk     \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}{\rightarrow O}$        & alkyldimethylaminoxider     & nonionisk     \\
    ${CH_3[CH_2]_nCH_2}$-- & --${CH_3[CH_2]_nCH_2}$ & betainer                    & zwitterionisk \\ \hline
    \end{tabular}

\caption{I denne tabel kan man se byggestenene for de vigtigste tensider i vaskemidler.}
\label{tab:vigtigste tensider}
\end{table*}
\lipsum[1-10]
\end{multicols}

\end{document}

EDIT 3: Note that multicol does support wide floats. What it doesn't support is narrow floats. That is, it doesn't work with floats which should appear within columns - only with page-wide floats.

  • 2
    However, this doesn't work really. It works only because the table is the last thing that you put into the code. The problem is that multicol doesn't really support wide floats. – yo' Dec 3 '13 at 21:39
  • Could you explain that? If I add a second \begin{multicols}{2}... \end{multicols} after the \end{table}, I get the float placement I would expect i.e. the table is at the bottom of the page, the text in the second multicols environment starts on the remaining space in the middle of that page and the remainder of it is placed on the following page in two columns. So the table still ends up at the bottom of the two column page even if the code for the table is not the last thing in the source. So I must have misunderstood either what was wanted or what the problem is. – cfr Dec 3 '13 at 22:40
  • I've made a cw answer below. Please, once you read and test it, tell me so that I can remove it (since it is not an answer, it shouldn't exist at all). If you want to discuss this more, we should use the chat. – yo' Dec 3 '13 at 22:59
  • Oh, OK. Yes. I agree that IF that's what you want, it would be ugly to use a second multicols environment. That is, if the table is supposed to be part of the text, so to speak. That wasn't clear to me from the question. When I use multicols, I usually want those breaks as part of how the document is structured. In that case, multicols works great. (It isn't 'ugly' in that case.) But, no, if the OP wants a solution of the sort you describe, it won't work. So now I'm just not clear about what is or isn't wanted. – cfr Dec 3 '13 at 23:09
  • You want a table to float. multicol doesn't allow this. Therefore the package is dead for me, I stick to \twocolumn and I'm more than happy with my decision. Anyways, as long as the table floats, multicol necessarily produces an ugly result. – yo' Dec 3 '13 at 23:47
-1

Now I know what I should do. I just put a star on figure: \begin{figure*} and \end{figure*}. And of course, I have deleted the \onecolumn.

  • And I thought you had a table not a figure. – masu Dec 3 '13 at 21:34
  • I assumed this solution was meant to work by changing the table environment to the figure* environment. However, I can't actually get this to work at all. Whatever I do, the tabular gets pushed to another page. – cfr Dec 3 '13 at 22:37

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