How to add a footnote in table* environment? A solution is provided in the following link:
https://tex.stackexchange.com/questions/209802/footnote-in-table-environment
Here in the answer provide in the above link, the footnote appears along with the table notes. Is it possible for the footnote appear as the normal footnote in the footer page?
table* is typically associated with a two-column layout, and as a result delayed to not appear on the page it's called. We can use afterpage to delay execution of the \footnote so it'll appear on the same page as the table*:
\documentclass[twocolumn]{article}
\usepackage{lipsum,afterpage,refcount}
\newcommand{\setfootnotemark}{%
\refstepcounter{footnote}%
\footnotemark[\value{footnote}]}
\begin{document}
\lipsum[1-5]
\begin{table*}
\centering
\caption{A table caption}
\begin{tabular}{llll}
123\setfootnotemark\label{first} & 456 &
789\setfootnotemark\label{second} & abc \\
\end{tabular}
\afterpage{\footnotetext[\getrefnumber{first}]{First footnote.}
\footnotetext[\getrefnumber{second}]{Second footnote.}}
\end{table*}
\lipsum[6-10]
\end{document}
Related
I would like to redefine \columnwidth and set it to the value corresponding to (\textwidth-\columnsep)/2.
This is because I would like to use this redefined command inside tabular environment for controlling column width.
The problem with \columnwidth is that it disregards the space between columns, therefore it doesn't do the job.
Here's what I'm talking about. The following code compiles but gives an undesirable output.
\documentclass[twocolumn]{article}
\usepackage{lipsum}
\setlength{\columnsep}{2cm}
\newcommand\testcolwidth{(\textwidth-\columnsep)/2}
\begin{document}
\lipsum
\begin{table}[!h]
\begin{tabular}{p{.25\columnwidth}|p{.75\columnwidth}}
\hline
col 1 & col 2
\end{tabular}
\end{table}
\lipsum
\end{document}
This is what the output look like. It's undesirable because I don't want this line (and the table) to stretch into the space between the columns.
I have tried to define column width with the following line:
\newcommand\testcolwidth{(\textwidth-\columnsep)/2}
It results in an error when using \testcolwidth in place of \columnwidth. The error reads: Illegal unit of measure (pt inserted)
Any help? Thanks a lot.
The columnwidth already takes into account the space between the columns of the article, what is missing in your code is the tabcolsep which defines the space between the table columns. In your example, this space gets added four times, once at the front, once at the end and once on each site of the |. If you want to manually define your table like this, you need to know in advance how many columns it will have:
\documentclass[twocolumn]{article}
\usepackage{lipsum}
\setlength{\columnsep}{2cm}
\newcommand\testcolwidth{\dimexpr\columnwidth-4\tabcolsep}
\begin{document}
\lipsum
\begin{table}[!h]
\begin{tabular}{p{.25\testcolwidth}|p{.75\testcolwidth}}
\hline
col 1 & col 2
\end{tabular}
\end{table}
\lipsum
\end{document}
Much easier to let a package like tabularray do the job for you:
\documentclass[twocolumn]{article}
\usepackage{tabularray}
\usepackage{lipsum}
\begin{document}
\lipsum[2]
\begin{table}[!h]
\begin{tblr}{
colspec={X[1]|X[3]}
}
\hline
col 1 & col 2
\end{tblr}
\end{table}
\lipsum[2]
\end{document}
I want to put a basic table into a 2-columns document.
I saw that instead of:
\begin{table}
enter code here
\end{table}
we should use:
\begin{table*}
enter code here
\end{table*}
but it is not working.
If anyone has an idea, thanks in advance! Below a minimal example.
\documentclass[10pt]{article}
\usepackage{lipsum}% fake text
\usepackage{multicol}% enable writing in 2 columns
\setlength{\columnsep}{7mm}% separation between the two columns
\setlength{\columnseprule}{1pt}% width of the separation lign(comment if not wanted)
\begin{document}
\begin{multicols}{2}
\lipsum[1]
\begin{table*}[t]
\begin{tabular}{cc}
A & b\\
c & d
\end{tabular}
\end{table*}
\end{multicols}
\end{document}
It seems that the document class is important.
If I change
article -> scrartcl
I can use the
\captionof{table}{my caption}
without using the table environment.
But I don't know if it is the right way to do it.
Floats and marginpars are not allowed inside multicols environment. Also, table* would be page wide. If you comment the table* environment, you get the tabular in the second column:
\documentclass[10pt]{article}
\usepackage{lipsum}% fake text
\usepackage{multicol}% enable writing in 2 columns
\setlength{\columnsep}{7mm}% separation between the two columns
\setlength{\columnseprule}{1pt}% width of the separation lign(comment if not wanted)
\begin{document}
\begin{multicols}{2}
\lipsum[1]
%\begin{table*}[t]
\begin{tabular}{cc}
A & b\\
c & d
\end{tabular}
%\end{table*}
\end{multicols}
\end{document}
Rather, you can nest the tabular inside a center environment and, if you need, use the package caption to label and reference your tabular although it's not a float.
Here are the package I am using:
\documentclass[twocolumn,showpacs,preprintnumbers,amsmath,amssymb,superscriptaddress]{revtex4}
\usepackage{graphicx}
\usepackage{bm}
\usepackage{subcaption}
\usepackage{SIunits}
\captionsetup{justification=raggedright, singlelinecheck=false}
\bibliographystyle{approve}
In order to put two figures next to each other, using the full width of the page even with the twocolumn option, I use this syntax:
\begin{figure*}
\centering
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{mfploglog_A.eps}
\end{subfigure}%
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{mfploglog.eps}
\end{subfigure}
\caption{XXX}\protect\label{Eloglog}
\end{figure*}
The probleme is that using this the numbering is incorrect. For each figure, a number is skipped as if the subfigure environment was counting as one figure. For example if I put just this figure in my code, it is going to be labeled as figure number 2.
Does someone already encountered this kind of problem ?
Don't use the caption package (or subcaption) with revtex4-1. You'll note in the .log that there are compatibility issues between the package and the class. Instead, place the two images side-by-side in the same figure* without using a subfigure environment:
\documentclass[twocolumn,showpacs,preprintnumbers]{revtex4-1}
\usepackage{graphicx}
\begin{document}
\begin{figure*}
\centering
\includegraphics[width=.3333\linewidth]{example-image-a} \qquad
\includegraphics[width=.3333\linewidth]{example-image-b}
\caption{XXX}
\end{figure*}
\end{document}
If you wish to add captions to the sub-figures, set the construction inside a tabular and enumerate them manually:
\documentclass[twocolumn,showpacs,preprintnumbers]{revtex4-1}
\usepackage{graphicx}
\begin{document}
\begin{figure*}
\centering
\begin{tabular}{c #{\qquad} c }
\includegraphics[width=.3333\linewidth]{example-image-a} &
\includegraphics[width=.3333\linewidth]{example-image-b} \\
\small (a) Left & \small (b) Right
\end{tabular}
\caption{XXX}
\end{figure*}
\end{document}
I am inserting a table in to a file that already has some text in it. This is at the end of a section and right before the beginning of another.
First I added the following code (sample, the real table is a real long one)
\begin{tabular}{|c|c|c|c}
a&b&c&d\\
\hline
c&d&e&f\\
\hline
\end{tabular}
Everything is fine. However I realise I need a caption to the table. So, then I changed the code to:
\begin{table}
\caption {title}
\begin{tabular}{|c|c|c|c}
a&b&c&d\\
\hline
c&d&e&f\\
\hline
\end{tabular}
\end{table}
Now the table jumps into the next section and starts 3-4 lines after the next section.
What am I doing wrong here?
try using the longtable package. or you can use \begin{table}[!h]
I'd like to insert a picture (figure) into a document which is using a two-column layout. However, I want it to take one whole page and not be centered on one of the columns. Currently if I add a [p] modifier to the figure, the whole image lands on the last page, instead in the middle of the document.
How can I force one page to switch back to a single-column layout and insert a single big picture there?
Use the figure* environment. So instead of
\begin{figure}[ht] % I typically use ht
\centering
...
\end{figure}
you should use
\begin{figure*}[ht]
\centering
...
\end{figure*}
This also works for tables (i.e. table*).
Consider this link for more information
It is not elegant, but with float package loaded you can use:
\begin{figure}[H]
\onecolumn\includegraphics{arc}
\end{figure}
\twocolumn
But you have to place this piece of code to exact locetion in source code. Otherwise you'll get pagebreak anywhere in twocolumned page, then page with image image.
To supplement #Crowley's answer, to avoid pagebreak after implementation.
Instead of using \twocolumn, use this package instead \usepackage{multicol}.
Then,
\begin{multicols}{2}
\section Write or place anything you want
\end{multicols}
This works for me!
\usepackage{multicol} in your preamble.
Then
\begin{document}
\begin{multicols}{2}
blah blah blah text
\end{multicols}
\begin{figure}[H]
\includegraphics[width=1\textwidth]{arc}
\end{figure}
\begin{multicols}{2}
blah blah blah text
\end{multicols}
\end{document}
This is ugly, and dirty. and you will need to fiddle with where you figure is in order to get the text balanced, but it is exactly what you asked for.